module Binance::Spot::Trade
def account(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) --
def account(**kwargs) @session.sign_request(:get, '/api/v3/account', params: kwargs) end
def all_order_list(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-all-order-lists-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:limit
(String
) -- Default 500; max 1000. -
:endTime
(String
) -- -
:startTime
(String
) -- -
:fromId
(Integer
) --
Parameters:
-
kwargs
(Hash
) --
def all_order_list(**kwargs) @session.sign_request(:get, '/api/v3/allOrderList', params: kwargs) end
def all_orders(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:limit
(String
) -- Default 500; max 1000. -
:endTime
(String
) -- -
:startTime
(String
) -- -
:orderId
(String
) --
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def all_orders(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/api/v3/allOrders', params: kwargs.merge(symbol: symbol)) end
def cancel_open_orders(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def cancel_open_orders(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/api/v3/openOrders', params: kwargs.merge(symbol: symbol)) end
def cancel_order(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:newClientOrderId
(String
) -- -
:origClientOrderId
(String
) -- -
:orderId
(Integer
) --
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def cancel_order(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/api/v3/order', params: kwargs.merge(symbol: symbol)) end
def cancel_order_list(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:newClientOrderId
(String
) -- -
:listClientOrderId
(String
) -- -
:orderListId
(Integer
) --
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def cancel_order_list(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:delete, '/api/v3/orderList', params: kwargs.merge(symbol: symbol)) end
def cancel_replace(symbol:, side:, type:, cancelReplaceMode:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:orderRateLimitExceededMode
(String
) -- DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit -
:cancelRestrictions
(String
) -- ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED -
:selfTradePreventionMode
(String
) -- The allowed enums is dependent on what is configured on the symbo -
:newOrderRespType
(String
) -- -
:icebergQty
(Float
) -- -
:trailingDelta
(Integer
) -- -
:stopPrice
(Float
) -- -
:strategyType
(Integer
) -- The value cannot be less than 1000000 -
:strategyId
(Integer
) -- -
:newClientOrderId
(String
) -- -
:cancelOrderId
(Integer
) -- -
:cancelOrigClientOrderId
(String
) -- -
:cancelNewClientOrderId
(String
) -- -
:price
(Float
) -- -
:quoteOrderQty
(Float
) -- -
:quantity
(Float
) -- -
:timeInForce
(String
) --
Parameters:
-
kwargs
(Hash
) -- -
cancelReplaceMode
(String
) -- STOP_ON_FAILURE or ALLOW_FAILURE -
type
(String
) -- -
side
(String
) -- -
symbol
(String
) -- the symbol
def cancel_replace(symbol:, side:, type:, cancelReplaceMode:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('type', type) Binance::Utils::Validation.require_param('cancelReplaceMode', cancelReplaceMode) @session.sign_request(:post, '/api/v3/order/cancelReplace', params: kwargs.merge( symbol: symbol, side: side, type: type, cancelReplaceMode: cancelReplaceMode )) end
def commission_rate(symbol:)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-commission-rates-user_data -
Parameters:
-
symbol
(String
) --
def commission_rate(symbol:) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/api/v3/account/commission', params: { symbol: symbol }) end
def get_order(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:origClientOrderId
(String
) -- -
:orderId
(Integer
) --
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def get_order(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/api/v3/order', params: kwargs.merge(symbol: symbol)) end
def get_order_rate_limit(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) --
def get_order_rate_limit(**kwargs) @session.sign_request(:get, '/api/v3/rateLimit/order', params: kwargs) end
def my_allocations(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-allocations-user_data -
Parameters:
-
kwargs
(Integer
) -- :orderId -
kwargs
(Integer
) -- :limit Default 500;Max 1000 -
kwargs
(Integer
) -- :fromAllocationId -
kwargs
(Integer
) -- :endTime -
kwargs
(Integer
) -- :startTime -
kwargs
(Hash
) -- -
symbol
(String
) --
def my_allocations(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/api/v3/myAllocations', params: kwargs.merge(symbol: symbol)) end
def my_prevented_matches(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data -
Parameters:
-
kwargs
(Integer
) -- :recvWindow The value cannot be greater than 60000 -
kwargs
(Integer
) -- :limit Default: 500; Max: 1000 -
kwargs
(Integer
) -- :fromPreventedMatchId -
kwargs
(Integer
) -- :orderId -
kwargs
(Integer
) -- :preventedMatchId -
kwargs
(Hash
) -- -
symbol
(String
) --
def my_prevented_matches(symbol:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) @session.sign_request(:get, '/api/v3/myPreventedMatches', params: kwargs.merge(symbol: symbol)) end
def my_trades(symbol:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-trade-list-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:limit
(Integer
) -- Default 500; max 1000. -
:fromId
(Integer
) -- TradeId to fetch from. Default gets most recent trades. -
:endTime
(Integer
) -- -
:startTime
(Integer
) -- -
:orderId
(Integer
) --
Parameters:
-
kwargs
(Hash
) -- -
symbol
(String
) -- the symbol
def my_trades(symbol:, **kwargs) @session.sign_request(:get, '/api/v3/myTrades', params: kwargs.merge(symbol: symbol)) end
def new_oco_order(symbol:, side:, quantity:, aboveType:, belowType:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:newOrderRespType
(String
) -- -
:belowStrategyType
(String
) -- Arbitrary numeric value identifying the below order strategy. Values smaller than 1000000 are reserved and cannot be used. -
:belowStrategyId
(Integer
) -- Arbitrary numeric value identifying the below order within an order strategy -
:belowTimeInForce
(String
) -- Required if the belowType is STOP_LOSS_LIMIT -
:belowTrailingDelta
(Integer
) -- -
:belowStopPrice
(Float
) -- Can be used if belowType is STOP_LOSS or STOP_LOSS_LIMIT. Either belowStopPrice or belowTrailingDelta or both, must be specified. -
:belowPrice
(Float
) -- Can be used if belowType is STOP_LOSS_LIMIT or LIMIT_MAKER to specify the limit price. -
:belowIcebergQty
(Integer
) -- Note that this can only be used if belowTimeInForce is GTC -
:belowClientOrderId
(String
) -- Arbitrary unique ID among open orders for the below order. Automatically generated if not sent -
:aboveStrategyType
(Integer
) -- Arbitrary numeric value identifying the above order strategy. Values smaller than 1000000 are reserved and cannot be used. -
:aboveStrategyId
(Integer
) -- Arbitrary numeric value identifying the above order within an order strategy. -
:aboveTimeInForce
(Float
) -- Required if the aboveType is STOP_LOSS_LIMIT. -
:aboveTrailingDelta
(Integer
) -- -
:aboveStopPriceCan
(Float
) -- be used if aboveType is STOP_LOSS or STOP_LOSS_LIMIT. Either aboveStopPrice or aboveTrailingDelta or both, must be specified. -
:abovePrice
(Float
) -- -
:aboveIcebergQty
(Integer
) -- Note that this can only be used if aboveTimeInForce is GTC -
:aboveClientOrderId
(String
) -- Arbitrary unique ID among open orders for the above order. Automatically generated if not sent -
:listClientOrderId
(String
) --
Parameters:
-
kwargs
(Hash
) -- -
belowType
(String
) -- -
aboveType
(String
) -- -
quantity
(Float
) -- -
side
(String
) -- -
symbol
(String
) -- the symbol
def new_oco_order(symbol:, side:, quantity:, aboveType:, belowType:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('quantity', quantity) Binance::Utils::Validation.require_param('aboveType', aboveType) Binance::Utils::Validation.require_param('belowType', belowType) @session.sign_request(:post, '/api/v3/order/oco', params: kwargs.merge( symbol: symbol, side: side, quantity: quantity, aboveType: aboveType, belowType: belowType )) end
def new_order(symbol:, side:, type:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:newOrderRespType
(String
) -- Set the response JSON. ACK, RESULT, or FULL. -
:icebergeQty
(Float
) -- -
:stopPrice
(Float
) -- -
:newClientOrderId
(String
) -- -
:price
(Float
) -- -
:quoteOrderQty
(Float
) -- -
:quantity
(Float
) -- -
:timeInForce
(String
) --
Parameters:
-
kwargs
(Hash
) -- -
type
(String
) -- -
side
(String
) -- -
symbol
(String
) -- the symbol
def new_order(symbol:, side:, type:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('type', type) @session.sign_request(:post, '/api/v3/order', params: kwargs.merge( symbol: symbol, side: side, type: type )) end
def new_order_test(symbol:, side:, type:, **kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#test-new-order-trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:newOrderRespType
(String
) -- Set the response JSON. ACK, RESULT, or FULL. -
:icebergeQty
(Float
) -- -
:stopPrice
(Float
) -- -
:newClientOrderId
(String
) -- -
:price
(Float
) -- -
:quoteOrderQty
(Float
) -- -
:quantity
(Float
) -- -
:timeInForce
(String
) --
Parameters:
-
kwargs
(Hash
) -- -
type
(String
) -- -
side
(String
) -- -
symbol
(String
) -- the symbol
def new_order_test(symbol:, side:, type:, **kwargs) Binance::Utils::Validation.require_param('symbol', symbol) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('type', type) @session.sign_request(:post, '/api/v3/order/test', params: kwargs.merge( symbol: symbol, side: side, type: type )) end
def open_order_list(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-open-order-lists-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) --
def open_order_list(**kwargs) @session.sign_request(:get, '/api/v3/openOrderList', params: kwargs) end
def open_orders(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:symbol
(String
) -- the symbol
Parameters:
-
kwargs
(Hash
) --
def open_orders(**kwargs) @session.sign_request(:get, '/api/v3/openOrders', params: kwargs) end
def order_list(**kwargs)
- See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-list-user_data -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:orgClientOrderId
(String
) -- -
:orderListId
(Integer
) --
Parameters:
-
kwargs
(Hash
) --
def order_list(**kwargs) @session.sign_request(:get, '/api/v3/orderList', params: kwargs) end