Sha256: 502894b73cea80d494fefa5d733451fbd53e926e48b09cdb2515d436abb8705b

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

module BitsDealer
  module CancelOrder
    def cancel_order(oid: nil)
      unless oid
        book = helper.ask_book(books: BitsDealer::Books::ALL_BOOKS)
        orders = with_retries(:max_tries => 3) { Bitsor.open_orders(book: book.id, limit: 100) }
        order = helper.ask_order(orders: orders)
        oid = order[:oid]
      end

      cancelled_order = with_retries(:max_tries => 3) { Bitsor.cancel_order(oid: oid) }
      prompt.ok "Order ##{cancelled_order.first} cancelled."

      nil
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bits_dealer-0.1.1 lib/bits_dealer/commands/cancel_order.rb