class Bitflyer::HTTP::Private::Client
Public Class Methods
new(key, secret)
click to toggle source
# File lib/bitflyer/http/private.rb, line 7 def initialize(key, secret) @connection = Connection.new(key, secret) end
Public Instance Methods
addresses()
click to toggle source
# File lib/bitflyer/http/private.rb, line 23 def addresses @connection.get('/v1/me/getaddresses').body end
balance()
click to toggle source
# File lib/bitflyer/http/private.rb, line 15 def balance @connection.get('/v1/me/getbalance').body end
balance_history(currency_code: nil, count: nil, before: nil, after: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 167 def balance_history(currency_code: nil, count: nil, before: nil, after: nil) query = { currency_code: currency_code, count: count, before: before, after: after }.delete_if { |_, v| v.nil? } @connection.get('/v1/me/getbalancehistory', query).body end
bank_accounts()
click to toggle source
# File lib/bitflyer/http/private.rb, line 35 def bank_accounts @connection.get('/v1/me/getbankaccounts').body end
cancel_all_child_orders(product_code: 'BTC_JPY')
click to toggle source
# File lib/bitflyer/http/private.rb, line 106 def cancel_all_child_orders(product_code: 'BTC_JPY') @connection.post('/v1/me/cancelallchildorders', product_code: product_code).body end
cancel_child_order(product_code: 'BTC_JPY', child_order_id: nil, child_order_acceptance_id: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 78 def cancel_child_order(product_code: 'BTC_JPY', child_order_id: nil, child_order_acceptance_id: nil) body = { product_code: product_code, child_order_id: child_order_id, child_order_acceptance_id: child_order_acceptance_id }.delete_if { |_, v| v.nil? } @connection.post('/v1/me/cancelchildorder', body).body end
cancel_parent_order(product_code: 'BTC_JPY', parent_order_id: nil, parent_order_acceptance_id: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 97 def cancel_parent_order(product_code: 'BTC_JPY', parent_order_id: nil, parent_order_acceptance_id: nil) body = { product_code: product_code, parent_order_id: parent_order_id, parent_order_acceptance_id: parent_order_acceptance_id }.delete_if { |_, v| v.nil? } @connection.post('/v1/me/cancelparentorder', body).body end
child_orders( product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_state: nil, parent_order_id: nil )
click to toggle source
# File lib/bitflyer/http/private.rb, line 110 def child_orders( product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_state: nil, parent_order_id: nil ) query = { product_code: product_code, count: count, before: before, after: after, child_order_state: child_order_state, parent_order_id: parent_order_id }.delete_if { |_, v| v.nil? } @connection.get('/v1/me/getchildorders', query).body end
coin_ins()
click to toggle source
# File lib/bitflyer/http/private.rb, line 27 def coin_ins @connection.get('/v1/me/getcoinins').body end
coin_outs()
click to toggle source
# File lib/bitflyer/http/private.rb, line 31 def coin_outs @connection.get('/v1/me/getcoinouts').body end
collateral()
click to toggle source
# File lib/bitflyer/http/private.rb, line 19 def collateral @connection.get('/v1/me/getcollateral').body end
deposits()
click to toggle source
# File lib/bitflyer/http/private.rb, line 39 def deposits @connection.get('/v1/me/getdeposits').body end
executions( product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_id: nil, child_order_acceptance_id: nil )
click to toggle source
# File lib/bitflyer/http/private.rb, line 148 def executions( product_code: 'BTC_JPY', count: nil, before: nil, after: nil, child_order_id: nil, child_order_acceptance_id: nil ) query = { product_code: product_code, count: count, before: before, after: after, child_order_id: child_order_id, child_order_acceptance_id: child_order_acceptance_id }.delete_if { |_, v| v.nil? } @connection.get('/v1/me/getexecutions', query).body end
parent_order(parent_order_id: nil, parent_order_acceptance_id: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 140 def parent_order(parent_order_id: nil, parent_order_acceptance_id: nil) query = { parent_order_id: parent_order_id, parent_order_acceptance_id: parent_order_acceptance_id }.delete_if { |_, v| v.nil? } @connection.get('/v1/me/getparentorder', query).body end
parent_orders(product_code: 'BTC_JPY', count: nil, before: nil, after: nil, parent_order_state: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 129 def parent_orders(product_code: 'BTC_JPY', count: nil, before: nil, after: nil, parent_order_state: nil) query = { product_code: product_code, count: count, before: before, after: after, parent_order_state: parent_order_state }.delete_if { |_, v| v.nil? } @connection.get('/v1/me/getparentorders', query).body end
permissions()
click to toggle source
# File lib/bitflyer/http/private.rb, line 11 def permissions @connection.get('/v1/me/getpermissions').body end
positions(product_code: 'FX_BTC_JPY')
click to toggle source
# File lib/bitflyer/http/private.rb, line 177 def positions(product_code: 'FX_BTC_JPY') @connection.get('/v1/me/getpositions', product_code: product_code).body end
send_child_order( product_code: 'BTC_JPY', child_order_type: nil, side: nil, price: nil, size: nil, minute_to_expire: nil, time_in_force: 'GTC' )
click to toggle source
# File lib/bitflyer/http/private.rb, line 57 def send_child_order( product_code: 'BTC_JPY', child_order_type: nil, side: nil, price: nil, size: nil, minute_to_expire: nil, time_in_force: 'GTC' ) body = { product_code: product_code, child_order_type: child_order_type, side: side, price: price, size: size, minute_to_expire: minute_to_expire, time_in_force: time_in_force }.delete_if { |_, v| v.nil? } @connection.post('/v1/me/sendchildorder', body).body end
send_parent_order(order_method: nil, minute_to_expire: nil, time_in_force: 'GTC', parameters: {})
click to toggle source
# File lib/bitflyer/http/private.rb, line 87 def send_parent_order(order_method: nil, minute_to_expire: nil, time_in_force: 'GTC', parameters: {}) body = { order_method: order_method, minute_to_expire: minute_to_expire, time_in_force: time_in_force, parameters: parameters }.delete_if { |_, v| v.nil? } @connection.post('/v1/me/sendparentorder', body).body end
trading_commission(product_code: 'BTC_JPY')
click to toggle source
# File lib/bitflyer/http/private.rb, line 181 def trading_commission(product_code: 'BTC_JPY') @connection.get('v1/me/gettradingcommission', product_code: product_code).body end
withdraw(currency_code: 'JPY', bank_account_id: nil, amount: nil, code: nil)
click to toggle source
# File lib/bitflyer/http/private.rb, line 43 def withdraw(currency_code: 'JPY', bank_account_id: nil, amount: nil, code: nil) body = { currency_code: currency_code, bank_account_id: bank_account_id, amount: amount, code: code }.delete_if { |_, v| v.nil? } @connection.post('/v1/me/withdraw', body).body end
withdrawals()
click to toggle source
# File lib/bitflyer/http/private.rb, line 53 def withdrawals @connection.get('/v1/me/getwithdrawals').body end