Class: BitmexClient::HTTP::Private::Client
- Inherits:
-
Object
- Object
- BitmexClient::HTTP::Private::Client
- Defined in:
- lib/bitmex_client/http/private.rb
Instance Method Summary collapse
- #cancel_all_order ⇒ Object
- #cancel_order(id, cid) ⇒ Object
- #close_position(symbol, price = nil) ⇒ Object
- #create_order(symbol, order_qty, options = {}) ⇒ Object
- #execution(options = {}) ⇒ Object
- #execution_trade_history(options = {}) ⇒ Object
-
#initialize(key, secret) ⇒ Client
constructor
A new instance of Client.
- #leaderboard_name ⇒ Object
- #order(options = {}) ⇒ Object
- #position(options = {}) ⇒ Object
- #trade_bucketed(bin_size = '1m', options = {}) ⇒ Object
- #user ⇒ Object
- #user_affiliate_status ⇒ Object
- #user_wallet(currency = 'XBt') ⇒ Object
- #user_wallet_history(currency = 'XBt') ⇒ Object
- #user_wallet_summary(currency = 'XBt') ⇒ Object
Constructor Details
#initialize(key, secret) ⇒ Client
Returns a new instance of Client.
6 7 8 |
# File 'lib/bitmex_client/http/private.rb', line 6 def initialize(key, secret) @connection = Connection.new(key, secret) end |
Instance Method Details
#cancel_all_order ⇒ Object
41 42 43 |
# File 'lib/bitmex_client/http/private.rb', line 41 def cancel_all_order @connection.delete('/api/v1/order/all').body end |
#cancel_order(id, cid) ⇒ Object
36 37 38 |
# File 'lib/bitmex_client/http/private.rb', line 36 def cancel_order(id, cid) @connection.delete('/api/v1/order', {orderID: id, clOrdID: cid }).body end |
#close_position(symbol, price = nil) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/bitmex_client/http/private.rb', line 51 def close_position(symbol, price = nil) = { symbol: symbol, price: price }.delete_if { |_, v| v.nil? } @connection.post('/api/v1/order/closePosition', ).body end |
#create_order(symbol, order_qty, options = {}) ⇒ Object
31 32 33 |
# File 'lib/bitmex_client/http/private.rb', line 31 def create_order(symbol, order_qty, = {}) @connection.post('/api/v1/order', { symbol: symbol, orderQty: order_qty }.merge()).body end |
#execution(options = {}) ⇒ Object
11 12 13 |
# File 'lib/bitmex_client/http/private.rb', line 11 def execution( = {}) @connection.get('/api/v1/execution', ).body end |
#execution_trade_history(options = {}) ⇒ Object
16 17 18 |
# File 'lib/bitmex_client/http/private.rb', line 16 def execution_trade_history( = {}) @connection.get('/api/v1/execution/tradeHistory', ).body end |
#leaderboard_name ⇒ Object
21 22 23 |
# File 'lib/bitmex_client/http/private.rb', line 21 def leaderboard_name @connection.get('/api/v1/leaderboard/name').body end |
#order(options = {}) ⇒ Object
26 27 28 |
# File 'lib/bitmex_client/http/private.rb', line 26 def order( = {}) @connection.get('/api/v1/order', ).body end |
#position(options = {}) ⇒ Object
46 47 48 |
# File 'lib/bitmex_client/http/private.rb', line 46 def position( = {}) @connection.get('/api/v1/position', ).body end |
#trade_bucketed(bin_size = '1m', options = {}) ⇒ Object
60 61 62 |
# File 'lib/bitmex_client/http/private.rb', line 60 def trade_bucketed(bin_size = '1m', = {}) @connection.get('/api/v1/trade/bucketed', { binSize: bin_size }.merge()).body end |
#user ⇒ Object
65 66 67 |
# File 'lib/bitmex_client/http/private.rb', line 65 def user @connection.get('/api/v1/user').body end |
#user_affiliate_status ⇒ Object
70 71 72 |
# File 'lib/bitmex_client/http/private.rb', line 70 def user_affiliate_status @connection.get('/api/v1/user/affiliateStatus').body end |
#user_wallet(currency = 'XBt') ⇒ Object
75 76 77 |
# File 'lib/bitmex_client/http/private.rb', line 75 def user_wallet(currency = 'XBt') @connection.get('/api/v1/user/wallet', { currency: currency }).body end |
#user_wallet_history(currency = 'XBt') ⇒ Object
80 81 82 |
# File 'lib/bitmex_client/http/private.rb', line 80 def user_wallet_history(currency = 'XBt') @connection.get('/api/v1/user/walletHistory', { currency: currency }).body end |
#user_wallet_summary(currency = 'XBt') ⇒ Object
85 86 87 |
# File 'lib/bitmex_client/http/private.rb', line 85 def user_wallet_summary(currency = 'XBt') @connection.get('/api/v1/user/walletSummary', { currency: currency }).body end |