Class: Kucoin::Api::Endpoints::Trade::Orders

Inherits:
Kucoin::Api::Endpoints::Trade show all
Defined in:
lib/kucoin/api/endpoints/trade/orders.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#assert_param_is_one_of, #assert_required_param, #auth, #initialize, #open, #path, #url

Constructor Details

This class inherits a constructor from Kucoin::Api::Endpoints::Base

Instance Method Details

#create(client_oid, side, symbol, options = {}) ⇒ Object Also known as: place



7
8
9
10
11
12
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 7

def create client_oid, side, symbol, options={}
  options = { clientOid: client_oid, side: side, symbol: symbol }.merge(options)
  assert_required_param options, :side, side_types
  assert_param_is_one_of options, :type, order_types if options.has_key?(:type)
  auth.ku_request :post, :index, **options
end

#delete(order_id) ⇒ Object Also known as: cancel



36
37
38
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 36

def delete order_id
  auth.ku_request :delete, :show, order_id: order_id
end

#delete_all(options = {}) ⇒ Object Also known as: cancel_all



21
22
23
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 21

def delete_all options={}
  auth.ku_request :delete, :index, **options
end

#index(options = {}) ⇒ Object Also known as: all, list



15
16
17
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 15

def index options={}
  auth.ku_request :get, :index, **options
end

#recentObject



26
27
28
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 26

def recent
  auth.ku_request :get, :recent
end

#show(order_id) ⇒ Object Also known as: get, detail



30
31
32
# File 'lib/kucoin/api/endpoints/trade/orders.rb', line 30

def show order_id
  auth.ku_request :get, :show, order_id: order_id
end