Class: Bitex::Bid
Overview
A Bid is an order to buy a given specie.
Instance Attribute Summary collapse
-
#amount ⇒ BigDecimal
Amount of USD to spend in this Bid.
-
#created_at ⇒ Time
Time when this Bid was created.
-
#id ⇒ Integer
This Bid’s unique ID.
-
#price ⇒ BigDecimal
Maximum price to pay per unit.
-
#remaining_amount ⇒ BigDecimal
Amount of USD left to be spent in this Bid.
-
#specie ⇒ Symbol
:btc or :ltc.
-
#status ⇒ Object
The status of this Bid in its lifecycle.
Class Method Summary collapse
-
.create!(specie, amount, price) ⇒ Object
Create a new Bid for spending Amount USD paying no more than price per unit.
Methods inherited from OrderBase
Instance Attribute Details
#amount ⇒ BigDecimal
65 66 67 |
# File 'lib/bitex/order.rb', line 65 def amount @amount end |
#created_at ⇒ Time
|
|
# File 'lib/bitex/order.rb', line 57
|
#id ⇒ Integer
|
|
# File 'lib/bitex/order.rb', line 54
|
#price ⇒ BigDecimal
|
|
# File 'lib/bitex/order.rb', line 71
|
#remaining_amount ⇒ BigDecimal
69 70 71 |
# File 'lib/bitex/order.rb', line 69 def remaining_amount @remaining_amount end |
#specie ⇒ Symbol
|
|
# File 'lib/bitex/order.rb', line 60
|
#status ⇒ Object
The status of this Bid in its lifecycle.
-
:received queued to check if you have enough funds.
-
:executing available in our ourderbook waiting to be matched.
-
:cancelling To be cancelled as soon as our trading engine unlocks it.
-
:cancelled no further executed. May have some Remaining Amount.
-
:completed Fully executed, Remaining Amount should be 0.
|
|
# File 'lib/bitex/order.rb', line 74
|
Class Method Details
.create!(specie, amount, price) ⇒ Object
Create a new Bid for spending Amount USD paying no more than price per unit.
91 92 93 94 95 96 97 98 |
# File 'lib/bitex/order.rb', line 91 def self.create!(specie, amount, price) params = { amount: amount, price: price, specie: {btc: 1, ltc: 2}[specie] } from_json(Api.private(:post, "/private#{base_path}", params)) end |