Module: KucoinRuby::Trading
- Defined in:
- lib/kucoin_ruby/trading.rb
Class Method Summary collapse
- .active_orders(symbol = nil) ⇒ Object
- .cancel_order(symbol, order_id, type) ⇒ Object
- .create_order(symbol, type, price, amount) ⇒ Object
- .dealt_orders(symbol, type, limit, page, since, before) ⇒ Object
- .symbol_dealt_order(symbol, type, limit, page) ⇒ Object
Class Method Details
.active_orders(symbol = nil) ⇒ Object
9 10 11 12 13 |
# File 'lib/kucoin_ruby/trading.rb', line 9 def self.active_orders(symbol = nil) endpoint = '/v1/order/active' query_string = {symbol: symbol} KucoinRuby::Net.signed_get(endpoint, query_string) end |
.cancel_order(symbol, order_id, type) ⇒ Object
15 16 17 18 19 |
# File 'lib/kucoin_ruby/trading.rb', line 15 def self.cancel_order(symbol, order_id, type) endpoint = '/v1/cancel-order' payload = {symbol: symbol, type: type, order_id: order_id} KucoinRuby::Net.signed_post(endpoint, payload) end |
.create_order(symbol, type, price, amount) ⇒ Object
3 4 5 6 7 |
# File 'lib/kucoin_ruby/trading.rb', line 3 def self.create_order(symbol, type, price, amount) endpoint = '/v1/order' payload = {symbol: symbol, type: type, price: price, amount: amount} KucoinRuby::Net.signed_post(endpoint, payload) end |
.dealt_orders(symbol, type, limit, page, since, before) ⇒ Object
21 22 23 24 25 |
# File 'lib/kucoin_ruby/trading.rb', line 21 def self.dealt_orders(symbol, type, limit, page, since, before) endpoint = '/v1/order/dealt' query_string = {before: before, limit: limit, page: page, since: since, symbol: symbol, type: type} KucoinRuby::Net.signed_get(endpoint, query_string) end |
.symbol_dealt_order(symbol, type, limit, page) ⇒ Object
27 28 29 30 31 |
# File 'lib/kucoin_ruby/trading.rb', line 27 def self.symbol_dealt_order(symbol, type, limit, page ) endpoint = '/v1/deal-orders' query_string = {limit: limit, page: page, symbol: symbol, type: type} KucoinRuby::Net.signed_get(endpoint, query_string) end |