module Binance::Spot::Convert
def convert_accept_quote(quoteId:, **kwargs)
- See: https://developers.binance.com/docs/convert/trade/Accept-Quote -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) -- -
quoteId
(String
) --
def convert_accept_quote(quoteId:, **kwargs) Binance::Utils::Validation.require_param('quoteId', quoteId) @session.sign_request(:post, '/sapi/v1/convert/acceptQuote', params: kwargs.merge( quoteId: quoteId )) end
def convert_asset_info(**kwargs)
- See: https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) --
def convert_asset_info(**kwargs) @session.sign_request(:get, '/sapi/v1/convert/assetInfo', params: kwargs) end
def convert_exchange_info(**kwargs)
- See: https://developers.binance.com/docs/convert/market-data -
Options Hash:
(**kwargs)
-
:toAsset
(String
) -- Either fromAsset or toAsset or both should be send. User spends coin -
:fromAsset
(String
) -- Either fromAsset or toAsset or both should be send. User spends coin
Parameters:
-
kwargs
(Hash
) --
def convert_exchange_info(**kwargs) @session.sign_request(:get, '/sapi/v1/convert/exchangeInfo', params: kwargs) end
def convert_get_quote(fromAsset:, toAsset:, **kwargs)
- See: https://developers.binance.com/docs/convert/trade -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:validTime
(String
) -- 10s, 30s, 1m, default 10s -
:walletType
(String
) -- SPOT or FUNDING. Default is SPOT -
:toAmount
(Float
) -- Either fromAmount or toAmount should be specified. When specified, it is the amount you will be credited after the conversion -
:fromAmount
(Float
) -- Either fromAmount or toAmount should be specified. When specified, it is the amount you will be debited after the conversion
Parameters:
-
kwargs
(Hash
) -- -
toAsset
(String
) -- -
fromAsset
(String
) --
def convert_get_quote(fromAsset:, toAsset:, **kwargs) Binance::Utils::Validation.require_param('fromAsset', fromAsset) Binance::Utils::Validation.require_param('toAsset', toAsset) @session.sign_request(:post, '/sapi/v1/convert/getQuote', params: kwargs.merge( fromAsset: fromAsset, toAsset: toAsset )) end
def convert_limit_cancel_order(orderId:, **kwargs)
- See: https://developers.binance.com/docs/convert/trade/Cancel-Order -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) -- -
orderId
(String
) --
def convert_limit_cancel_order(orderId:, **kwargs) Binance::Utils::Validation.require_param('orderId', orderId) @session.sign_request(:post, '/sapi/v1/convert/limit/cancelOrder', params: kwargs.merge( orderId: orderId )) end
def convert_limit_place_order(baseAsset:, quoteAsset:, limitPrice:, side:, expiredType:, **kwargs)
- See: https://developers.binance.com/docs/convert/trade/Place-Order -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:walletType
(String
) -- SPOT or FUNDING or SPOT_FUNDING. It is to use which type of assets. Default is SPOT. -
:quoteAmount
(Float
) -- Quote asset amount. (One of baseAmount or quoteAmount is required) -
:baseAmount
(Float
) -- Base asset amount. (One of baseAmount or quoteAmount is required)
Parameters:
-
kwargs
(Hash
) -- -
expiredType
(String
) -- 1_D, 3_D, 7_D, 30_D (D means day) -
side
(String
) -- BUY or SELL -
limitPrice
(Float
) -- Symbol limit price (from baseAsset to quoteAsset) -
quoteAsset
(String
) -- quote asset -
baseAsset
(String
) -- base asset (use the response fromIsBase from GET /sapi/v1/convert/exchangeInfo api to check which one is baseAsset)
def convert_limit_place_order(baseAsset:, quoteAsset:, limitPrice:, side:, expiredType:, **kwargs) Binance::Utils::Validation.require_param('baseAsset', baseAsset) Binance::Utils::Validation.require_param('quoteAsset', quoteAsset) Binance::Utils::Validation.require_param('limitPrice', limitPrice) Binance::Utils::Validation.require_param('side', side) Binance::Utils::Validation.require_param('expiredType', expiredType) @session.sign_request(:post, '/sapi/v1/convert/limit/placeOrder', params: kwargs.merge( baseAsset: baseAsset, quoteAsset: quoteAsset, limitPrice: limitPrice, side: side, expiredType: expiredType )) end
def convert_limit_query_open_orders(**kwargs)
- See: https://developers.binance.com/docs/convert/trade/Query-Order -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000
Parameters:
-
kwargs
(Hash
) --
def convert_limit_query_open_orders(**kwargs) @session.sign_request(:post, '/sapi/v1/convert/limit/queryOpenOrders', params: kwargs) end
def convert_order_status(**kwargs)
- See: https://developers.binance.com/docs/convert/trade/Order-Status -
Options Hash:
(**kwargs)
-
:quoteId
(String
) -- Either orderId or quoteId is required -
:orderId
(String
) -- Either orderId or quoteId is required
Parameters:
-
kwargs
(Hash
) --
def convert_order_status(**kwargs) @session.sign_request(:get, '/sapi/v1/convert/orderStatus', params: kwargs) end
def convert_trade_flow(startTime:, endTime:, **kwargs)
- See: https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History -
Options Hash:
(**kwargs)
-
:recvWindow
(Integer
) -- The value cannot be greater than 60000 -
:limit
(Integer
) -- default 100, max 1000
Parameters:
-
kwargs
(Hash
) -- -
endTime
(Integer
) -- -
startTime
(Integer
) --
def convert_trade_flow(startTime:, endTime:, **kwargs) Binance::Utils::Validation.require_param('startTime', startTime) Binance::Utils::Validation.require_param('endTime', endTime) @session.sign_request(:get, '/sapi/v1/convert/tradeFlow', params: kwargs.merge( startTime: startTime, endTime: endTime )) end