Class: Remitano::Client::Orders
- Inherits:
-
Object
- Object
- Remitano::Client::Orders
- Defined in:
- lib/remitano/client/orders.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #cancel(id) ⇒ Object
- #create(pair:, side:, price:, amount:) ⇒ Object
-
#initialize(config:) ⇒ Orders
constructor
A new instance of Orders.
- #open(pair, **params) ⇒ Object
Constructor Details
#initialize(config:) ⇒ Orders
Returns a new instance of Orders.
7 8 9 |
# File 'lib/remitano/client/orders.rb', line 7 def initialize(config:) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/remitano/client/orders.rb', line 5 def config @config end |
Instance Method Details
#cancel(id) ⇒ Object
15 16 17 |
# File 'lib/remitano/client/orders.rb', line 15 def cancel(id) config.net.post("/orders/#{id}/cancel").execute end |
#create(pair:, side:, price:, amount:) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/remitano/client/orders.rb', line 19 def create(pair:, side:, price:, amount:) config.net.post( "/orders", pair: pair, side: side, price: price, amount: amount ).execute end |
#open(pair, **params) ⇒ Object
11 12 13 |
# File 'lib/remitano/client/orders.rb', line 11 def open(pair, **params) config.net.get("/orders/open?pair=#{pair}&#{params.to_query}").execute end |