Module: Cointrader::Order

Included in:
Client
Defined in:
lib/cointrader.net/client/order.rb

Instance Method Summary collapse

Instance Method Details

#cancel(params = {}) ⇒ Object



13
14
15
16
# File 'lib/cointrader.net/client/order.rb', line 13

def cancel params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/cancel", order_id: params[:order_id])
end

#limit_buy(params = {}) ⇒ Object



3
4
5
6
# File 'lib/cointrader.net/client/order.rb', line 3

def limit_buy params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/buy", total_quantity: params[:total_quantity], price: params[:price])
end

#limit_sell(params = {}) ⇒ Object



8
9
10
11
# File 'lib/cointrader.net/client/order.rb', line 8

def limit_sell params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/sell", total_quantity: params[:total_quantity], price: params[:price])
end

#list(params = {}) ⇒ Object



18
19
20
21
# File 'lib/cointrader.net/client/order.rb', line 18

def list params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/list")
end

#market_buy(params = {}) ⇒ Object



23
24
25
26
# File 'lib/cointrader.net/client/order.rb', line 23

def market_buy params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/marketbuy", total_amount: params[:total_amount])
end

#market_sell(params = {}) ⇒ Object



28
29
30
31
# File 'lib/cointrader.net/client/order.rb', line 28

def market_sell params={}
  params = get_defaults(params)
  request(:post, "/order/#{params[:currency_pair]}/marketsell", total_amount: params[:total_amount])
end