wiki/exchanges/binance.md
<a name="binance" id="binance"></a>
Kind: global class
Extends: <code>Exchange</code>
<a name="enableDemoTrading" id="enabledemotrading"></a>
enables or disables demo trading mode
Kind: instance method of <code>binance</code>
See
| Param | Type | Required | Description |
|---|---|---|---|
| enable | <code>boolean</code> | No | true if demo trading should be enabled, false otherwise |
binance.enableDemoTrading ([enable])
<a name="fetchTime" id="fetchtime"></a>
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of <code>binance</code>
Returns: <code>int</code> - the current integer timestamp in milliseconds from the exchange server
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchTime ([params])
<a name="fetchCurrencies" id="fetchcurrencies"></a>
fetches all available currencies on an exchange
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an associative dictionary of currencies
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchCurrencies ([params])
<a name="fetchMarkets" id="fetchmarkets"></a>
retrieves data on all markets for binance
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - an array of objects representing market data
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchMarkets ([params])
<a name="fetchBalance" id="fetchbalance"></a>
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi' |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | <code>Array<string></code>, <code>undefined</code> | No | unified market symbols, only used in isolated margin mode |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the balance for a portfolio margin account |
| params.subType | <code>string</code> | No | 'linear' or 'inverse' |
binance.fetchBalance ([params])
<a name="fetchOrderBook" id="fetchorderbook"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.rpi | <code>boolean</code> | No | future only set to true to use the RPI endpoint |
binance.fetchOrderBook (symbol[, limit, params])
<a name="fetchStatus" id="fetchstatus"></a>
the latest known information on the availability of the exchange API
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a status structure
See: https://developers.binance.com/docs/wallet/others/system-status
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchStatus ([params])
<a name="fetchTicker" id="fetchticker"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.rolling | <code>boolean</code> | No | (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker |
binance.fetchTicker (symbol[, params])
<a name="fetchBidsAsks" id="fetchbidsasks"></a>
fetches the bid and ask price and volume for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchBidsAsks (symbols[, params])
<a name="fetchLastPrices" id="fetchlastprices"></a>
fetches the last price for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of lastprices structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | unified symbols of the markets to fetch the last prices |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchLastPrices (symbols[, params])
<a name="fetchTickers" id="fetchtickers"></a>
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
| params.type | <code>string</code> | No | 'spot', 'option', use params["subType"] for swap and future markets |
binance.fetchTickers ([symbols, params])
<a name="fetchMarkPrice" id="fetchmarkprice"></a>
fetches mark price for the market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchMarkPrice (symbol[, params])
<a name="fetchMarkPrices" id="fetchmarkprices"></a>
fetches mark prices for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchMarkPrices ([symbols, params])
<a name="fetchOHLCV" id="fetchohlcv"></a>
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.price | <code>string</code> | No | "mark" or "index" for mark price and index price candles |
| params.until | <code>int</code> | No | timestamp in ms of the latest candle to fetch |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchOHLCV (symbol, timeframe[, since, limit, params])
<a name="fetchTrades" id="fetchtrades"></a>
get the list of most recent trades for a particular symbol Default fetchTradesMethod
Kind: instance method of <code>binance</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' |
| limit | <code>int</code> | No | default 500, max 1000 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' |
| params.fetchTradesMethod | <code>int</code> | No | 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades' |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | <code>int</code> | No | trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades' |
binance.fetchTrades (symbol[, since, limit, params])
<a name="editContractOrder" id="editcontractorder"></a>
edit a trade order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | cancel order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to edit an order in a portfolio margin account |
binance.editContractOrder (id, symbol, type, side, amount[, price, params])
<a name="editOrder" id="editorder"></a>
edit a trade order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | cancel order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.editOrder (id, symbol, type, side, amount[, price, params])
<a name="editOrders" id="editorders"></a>
edit a list of trade orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.editOrders (orders[, params])
<a name="createOrders" id="createorders"></a>
contract only create a list of trade orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| orders | <code>Array</code> | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createOrders (orders[, params])
<a name="createOrder" id="createorder"></a>
create a trade order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of you want to trade in units of the base currency |
| price | <code>float</code> | No | the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.reduceOnly | <code>string</code> | No | for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean. |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for spot margin trading |
| params.sor | <code>boolean</code> | No | spot only whether to use SOR (Smart Order Routing) or not, default is false |
| params.test | <code>boolean</code> | No | spot only whether to use the test endpoint or not, default is false |
| params.trailingPercent | <code>float</code> | No | the percent to trail away from the current market price |
| params.trailingTriggerPrice | <code>float</code> | No | the price to trigger a trailing order, default uses the price argument |
| params.triggerPrice | <code>float</code> | No | the price that a trigger order is triggered at |
| params.stopLossPrice | <code>float</code> | No | the price that a stop loss order is triggered at |
| params.takeProfitPrice | <code>float</code> | No | the price that a take profit order is triggered at |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to create an order in a portfolio margin account |
| params.selfTradePrevention | <code>string</code> | No | set unified value for stp, one of NONE, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH |
| params.icebergAmount | <code>float</code> | No | set iceberg amount for limit orders |
| params.stopLossOrTakeProfit | <code>string</code> | No | 'stopLoss' or 'takeProfit', required for spot trailing orders |
| params.positionSide | <code>string</code> | No | swap and portfolio margin only "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode |
| params.hedged | <code>bool</code> | No | swap and portfolio margin only true for hedged mode, false for one way mode, default is false |
| params.clientOrderId | <code>string</code> | No | the clientOrderId of the order |
binance.createOrder (symbol, type, side, amount[, price, params])
<a name="createMarketOrderWithCost" id="createmarketorderwithcost"></a>
create a market order by providing the symbol, side and cost
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createMarketOrderWithCost (symbol, side, cost[, params])
<a name="createMarketBuyOrderWithCost" id="createmarketbuyorderwithcost"></a>
create a market buy order by providing the symbol and cost
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createMarketBuyOrderWithCost (symbol, cost[, params])
<a name="createMarketSellOrderWithCost" id="createmarketsellorderwithcost"></a>
create a market sell order by providing the symbol and cost
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| cost | <code>float</code> | Yes | how much you want to trade in units of the quote currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createMarketSellOrderWithCost (symbol, cost[, params])
<a name="fetchOrder" id="fetchorder"></a>
fetches information on an order made by the user
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch an order in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch a trigger or conditional order |
binance.fetchOrder (id, symbol[, params])
<a name="fetchOrders" id="fetchorders"></a>
fetches information on multiple orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for spot margin trading |
| params.until | <code>int</code> | No | the latest time in ms to fetch orders for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
binance.fetchOrders (symbol[, since, limit, params])
<a name="fetchOpenOrders" id="fetchopenorders"></a>
fetch all unfilled currently open orders
Kind: instance method of <code>binance</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch open orders in the portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account conditional orders |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchOpenOrders (symbol[, since, limit, params])
<a name="fetchOpenOrder" id="fetchopenorder"></a>
fetch an open order by the id
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.trigger | <code>string</code> | No | set to true if you would like to fetch portfolio margin account stop or conditional orders |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch for a portfolio margin account |
binance.fetchOpenOrder (id, symbol[, params])
<a name="fetchClosedOrders" id="fetchclosedorders"></a>
fetches information on multiple closed orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<Order></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
binance.fetchClosedOrders (symbol[, since, limit, params])
<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>
fetches information on multiple canceled orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
binance.fetchCanceledOrders (symbol[, since, limit, params])
<a name="fetchCanceledAndClosedOrders" id="fetchcanceledandclosedorders"></a>
fetches information on multiple canceled orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to fetch portfolio margin account trigger or conditional orders |
binance.fetchCanceledAndClosedOrders (symbol[, since, limit, params])
<a name="cancelOrder" id="cancelorder"></a>
cancels an open order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to cancel an order in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to cancel a portfolio margin account conditional order |
binance.cancelOrder (id, symbol[, params])
<a name="cancelAllOrders" id="cancelallorders"></a>
cancel all open orders in a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market to cancel orders in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code> | No | 'cross' or 'isolated', for spot margin trading |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to cancel orders in a portfolio margin account |
| params.trigger | <code>boolean</code> | No | set to true if you would like to cancel portfolio margin account conditional orders |
binance.cancelAllOrders (symbol[, params])
<a name="cancelOrders" id="cancelorders"></a>
cancel multiple orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| ids | <code>Array<string></code> | Yes | order ids |
| symbol | <code>string</code> | No | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.clientOrderIds | <code>Array<string></code> | No | alternative to ids, array of client order ids EXCHANGE SPECIFIC PARAMETERS |
| params.origClientOrderIdList | <code>Array<string></code> | No | max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma |
| params.recvWindow | <code>Array<int></code> | No |
binance.cancelOrders (ids[, symbol, params])
<a name="fetchOrderTrades" id="fetchordertrades"></a>
fetch all the trades made from a single order
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOrderTrades (id, symbol[, since, limit, params])
<a name="fetchMyTrades" id="fetchmytrades"></a>
fetch all trades made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<Trade></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch trades for a portfolio margin account |
binance.fetchMyTrades (symbol[, since, limit, params])
<a name="fetchMyDustTrades" id="fetchmydusttrades"></a>
fetch all dust trades made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See: https://developers.binance.com/docs/wallet/asset/dust-log
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | not used by binance fetchMyDustTrades () |
| since | <code>int</code> | No | the earliest time in ms to fetch my dust trades for |
| limit | <code>int</code> | No | the maximum number of dust trades to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | 'spot' or 'margin', default spot |
binance.fetchMyDustTrades (symbol[, since, limit, params])
<a name="fetchDeposits" id="fetchdeposits"></a>
fetch all deposits made to an account
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of transaction structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch deposits for |
| limit | <code>int</code> | No | the maximum number of deposits structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.fiat | <code>bool</code> | No | if true, only fiat deposits will be returned |
| params.until | <code>int</code> | No | the latest time in ms to fetch entries for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchDeposits (code[, since, limit, params])
<a name="fetchWithdrawals" id="fetchwithdrawals"></a>
fetch all withdrawals made from an account
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of transaction structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch withdrawals for |
| limit | <code>int</code> | No | the maximum number of withdrawals structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.fiat | <code>bool</code> | No | if true, only fiat withdrawals will be returned |
| params.until | <code>int</code> | No | the latest time in ms to fetch withdrawals for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
binance.fetchWithdrawals (code[, since, limit, params])
<a name="transfer" id="transfer"></a>
transfer currency internally between wallets on the same account
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a transfer structure
See: https://developers.binance.com/docs/wallet/asset/user-universal-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | amount to transfer |
| fromAccount | <code>string</code> | Yes | account to transfer from |
| toAccount | <code>string</code> | Yes | account to transfer to |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code> | No | exchange specific transfer type |
| params.symbol | <code>string</code> | No | the unified symbol, required for isolated margin transfers |
binance.transfer (code, amount, fromAccount, toAccount[, params])
<a name="fetchTransfers" id="fetchtransfers"></a>
fetch a history of internal transfers made on an account
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of transfer structures
See: https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency transferred |
| since | <code>int</code> | No | the earliest time in ms to fetch transfers for |
| limit | <code>int</code> | No | the maximum number of transfers structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | the latest time in ms to fetch transfers for |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.internal | <code>boolean</code> | No | default false, when true will fetch pay trade history |
binance.fetchTransfers (code[, since, limit, params])
<a name="fetchDepositAddress" id="fetchdepositaddress"></a>
fetch the deposit address for a currency associated with this account
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an address structure
See: https://developers.binance.com/docs/wallet/capital/deposite-address
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.network | <code>string</code> | No | network for fetch deposit address |
binance.fetchDepositAddress (code[, params])
<a name="fetchTransactionFees" id="fetchtransactionfees"></a>
DEPRECATED
please use fetchDepositWithdrawFees instead
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of fee structures
See: https://developers.binance.com/docs/wallet/capital/all-coins-info
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | not used by binance fetchTransactionFees () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchTransactionFees (codes[, params])
<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>
fetch deposit and withdraw fees
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of fee structures
See: https://developers.binance.com/docs/wallet/capital/all-coins-info
| Param | Type | Required | Description |
|---|---|---|---|
| codes | <code>Array<string></code>, <code>undefined</code> | Yes | not used by binance fetchDepositWithdrawFees () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchDepositWithdrawFees (codes[, params])
<a name="withdraw" id="withdraw"></a>
make a withdrawal
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a transaction structure
See: https://developers.binance.com/docs/wallet/capital/withdraw
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| amount | <code>float</code> | Yes | the amount to withdraw |
| address | <code>string</code> | Yes | the address to withdraw to |
| tag | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.withdraw (code, amount, address, tag[, params])
<a name="fetchTradingFee" id="fetchtradingfee"></a>
fetch the trading fees for a market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a fee structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch trading fees in a portfolio margin account |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchTradingFee (symbol[, params])
<a name="fetchTradingFees" id="fetchtradingfees"></a>
fetch the trading fees for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of fee structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchTradingFees ([params])
<a name="fetchFundingRate" id="fetchfundingrate"></a>
fetch the current funding rate
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a funding rate structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchFundingRate (symbol[, params])
<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>
fetches historical funding rate prices
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the funding rate history for |
| since | <code>int</code> | No | timestamp in ms of the earliest funding rate to fetch |
| limit | <code>int</code> | No | the maximum amount of funding rate structures to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest funding rate |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchFundingRateHistory (symbol[, since, limit, params])
<a name="fetchFundingRates" id="fetchfundingrates"></a>
fetch the funding rate for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of funding rate structures, indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchFundingRates (symbols[, params])
<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of leverage tiers structures, indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the leverage tiers for a portfolio margin account |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchLeverageTiers (symbols[, params])
<a name="fetchPosition" id="fetchposition"></a>
fetch data on an open position
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a position structure
See: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchPosition (symbol[, params])
<a name="fetchOptionPositions" id="fetchoptionpositions"></a>
fetch data on open options positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structures
See: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOptionPositions (symbols[, params])
<a name="fetchPositions" id="fetchpositions"></a>
fetch all open positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | method name to call, "positionRisk", "account" or "option", default is "positionRisk" |
| params.useV2 | <code>bool</code> | No | set to true if you want to use the obsolete endpoint, where some more additional fields were provided |
binance.fetchPositions ([symbols, params])
<a name="fetchFundingHistory" id="fetchfundinghistory"></a>
fetch the history of funding payments paid and received on this account
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a funding history structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch funding history for |
| limit | <code>int</code> | No | the maximum number of funding history structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest funding history entry |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the funding history for a portfolio margin account |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchFundingHistory (symbol[, since, limit, params])
<a name="setLeverage" id="setleverage"></a>
set the level of leverage for a market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | <code>float</code> | Yes | the rate of leverage |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to set the leverage for a trading pair in a portfolio margin account |
binance.setLeverage (leverage, symbol[, params])
<a name="setMarginMode" id="setmarginmode"></a>
set margin mode to 'cross' or 'isolated'
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | <code>string</code> | Yes | 'cross' or 'isolated' |
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.setMarginMode (marginMode, symbol[, params])
<a name="setPositionMode" id="setpositionmode"></a>
set hedged to true or false for a market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange
See
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | <code>bool</code> | Yes | set to true to use dualSidePosition |
| symbol | <code>string</code> | Yes | not used by binance setPositionMode () |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to set the position mode for a portfolio margin account |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.setPositionMode (hedged, symbol[, params])
<a name="fetchLeverages" id="fetchleverages"></a>
fetch the set leverage for all markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a list of leverage structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | a list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchLeverages ([symbols, params])
<a name="fetchSettlementHistory" id="fetchsettlementhistory"></a>
fetches historical settlement records
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of settlement history objects
See: https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the settlement history |
| since | <code>int</code> | No | timestamp in ms |
| limit | <code>int</code> | No | number of records, default 100, max 100 |
| params | <code>object</code> | No | exchange specific params |
binance.fetchSettlementHistory (symbol[, since, limit, params])
<a name="fetchMySettlementHistory" id="fetchmysettlementhistory"></a>
fetches historical settlement records of the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of [settlement history objects]
See: https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the settlement history |
| since | <code>int</code> | No | timestamp in ms |
| limit | <code>int</code> | No | number of records |
| params | <code>object</code> | No | exchange specific params |
binance.fetchMySettlementHistory (symbol[, since, limit, params])
<a name="fetchLedgerEntry" id="fetchledgerentry"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ledger structure
See: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the identification number of the ledger entry |
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchLedgerEntry (id, code[, params])
<a name="fetchLedger" id="fetchledger"></a>
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ledger structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| since | <code>int</code> | No | timestamp in ms of the earliest ledger entry |
| limit | <code>int</code> | No | max number of ledger entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest ledger entry |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the ledger for a portfolio margin account |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchLedger ([code, since, limit, params])
<a name="reduceMargin" id="reducemargin"></a>
remove margin from a position
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | the amount of margin to remove |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.reduceMargin (symbol, amount[, params])
<a name="addMargin" id="addmargin"></a>
add margin
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| amount | <code>float</code> | Yes | amount of margin to add |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.addMargin (symbol, amount[, params])
<a name="fetchCrossBorrowRate" id="fetchcrossborrowrate"></a>
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a borrow rate structure
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchCrossBorrowRate (code[, params])
<a name="fetchIsolatedBorrowRate" id="fetchisolatedborrowrate"></a>
fetch the rate of interest to borrow a currency for margin trading
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an isolated borrow rate structure
See: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | <code>object</code> | No | user's current specific margin data will be returned if viplevel is omitted |
binance.fetchIsolatedBorrowRate (symbol[, params])
<a name="fetchIsolatedBorrowRates" id="fetchisolatedborrowrates"></a>
fetch the borrow interest rates of all currencies
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a borrow rate structure
See: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.symbol | <code>object</code> | No | unified market symbol EXCHANGE SPECIFIC PARAMETERS |
| params.vipLevel | <code>object</code> | No | user's current specific margin data will be returned if viplevel is omitted |
binance.fetchIsolatedBorrowRates ([params])
<a name="fetchBorrowRateHistory" id="fetchborrowratehistory"></a>
retrieves a history of a currencies borrow interest rate at specific time slots
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - an array of borrow rate structures
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code |
| since | <code>int</code> | No | timestamp for the earliest borrow rate |
| limit | <code>int</code> | No | the maximum number of borrow rate structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchBorrowRateHistory (code[, since, limit, params])
<a name="createGiftCode" id="creategiftcode"></a>
create gift code
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - The gift code id, code, currency and amount
See: https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | gift code |
| amount | <code>float</code> | Yes | amount of currency for the gift |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createGiftCode (code, amount[, params])
<a name="redeemGiftCode" id="redeemgiftcode"></a>
redeem gift code
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange
See: https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
| Param | Type | Required | Description |
|---|---|---|---|
| giftcardCode | <code>string</code> | Yes | |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.redeemGiftCode (giftcardCode[, params])
<a name="verifyGiftCode" id="verifygiftcode"></a>
verify gift code
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | reference number id |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.verifyGiftCode (id[, params])
<a name="fetchBorrowInterest" id="fetchborrowinterest"></a>
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of borrow interest structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | unified currency code |
| symbol | <code>string</code> | No | unified market symbol when fetch interest in isolated markets |
| since | <code>int</code> | No | the earliest time in ms to fetch borrrow interest for |
| limit | <code>int</code> | No | the maximum number of structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch the borrow interest in a portfolio margin account |
binance.fetchBorrowInterest ([code, symbol, since, limit, params])
<a name="repayCrossMargin" id="repaycrossmargin"></a>
repay borrowed margin and interest
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to repay margin in a portfolio margin account |
| params.repayCrossMarginMethod | <code>string</code> | No | portfolio margin only 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative) |
| params.specifyRepayAssets | <code>string</code> | No | portfolio margin papiPostMarginRepayDebt only specific asset list to repay debt |
binance.repayCrossMargin (code, amount[, params])
<a name="repayIsolatedMargin" id="repayisolatedmargin"></a>
repay borrowed margin and interest
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure
See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, required for isolated margin |
| code | <code>string</code> | Yes | unified currency code of the currency to repay |
| amount | <code>float</code> | Yes | the amount to repay |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.repayIsolatedMargin (symbol, code, amount[, params])
<a name="borrowCrossMargin" id="borrowcrossmargin"></a>
create a loan to borrow margin
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to borrow margin in a portfolio margin account |
binance.borrowCrossMargin (code, amount[, params])
<a name="borrowIsolatedMargin" id="borrowisolatedmargin"></a>
create a loan to borrow margin
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure
See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol, required for isolated margin |
| code | <code>string</code> | Yes | unified currency code of the currency to borrow |
| amount | <code>float</code> | Yes | the amount to borrow |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.borrowIsolatedMargin (symbol, code, amount[, params])
<a name="fetchOpenInterestHistory" id="fetchopeninteresthistory"></a>
Retrieves the open interest history of a currency
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of open interest structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | Unified CCXT market symbol |
| timeframe | <code>string</code> | Yes | "5m","15m","30m","1h","2h","4h","6h","12h", or "1d" |
| since | <code>int</code> | No | the time(ms) of the earliest record to retrieve as a unix timestamp |
| limit | <code>int</code> | No | default 30, max 500 |
| params | <code>object</code> | No | exchange specific parameters |
| params.until | <code>int</code> | No | the time(ms) of the latest record to retrieve as a unix timestamp |
| params.paginate | <code>boolean</code> | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
binance.fetchOpenInterestHistory (symbol, timeframe[, since, limit, params])
<a name="fetchOpenInterest" id="fetchopeninterest"></a>
retrieves the open interest of a contract trading pair
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an open interest structurehttps://docs.ccxt.com/?id=open-interest-structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| params | <code>object</code> | No | exchange specific parameters |
binance.fetchOpenInterest (symbol[, params])
<a name="fetchMyLiquidations" id="fetchmyliquidations"></a>
retrieves the users liquidated positions
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the binance api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest liquidation |
| params.paginate | <code>boolean</code> | No | spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to fetch liquidations in a portfolio margin account |
| params.type | <code>string</code> | No | "spot" |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchMyLiquidations ([symbol, since, limit, params])
<a name="fetchGreeks" id="fetchgreeks"></a>
fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a greeks structure
See: https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch greeks for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchGreeks (symbol[, params])
<a name="fetchAllGreeks" id="fetchallgreeks"></a>
fetches all option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a greeks structure
See: https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | unified symbols of the markets to fetch greeks for, all markets are returned if not assigned |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchAllGreeks ([symbols, params])
<a name="fetchPositionMode" id="fetchpositionmode"></a>
fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an object detailing whether the market is in hedged or one-way mode
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchPositionMode (symbol[, params])
<a name="fetchMarginModes" id="fetchmarginmodes"></a>
fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a list of margin mode structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchMarginModes (symbols[, params])
<a name="fetchMarginMode" id="fetchmarginmode"></a>
fetches the margin mode of a specific symbol
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin mode structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchMarginMode (symbol[, params])
<a name="fetchOption" id="fetchoption"></a>
fetches option data that is commonly found in an option chain
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an option chain structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOption (symbol[, params])
<a name="fetchMarginAdjustmentHistory" id="fetchmarginadjustmenthistory"></a>
fetches the history of margin added or reduced from contract isolated positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of margin structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| type | <code>string</code> | No | "add" or "reduce" |
| since | <code>int</code> | No | timestamp in ms of the earliest change to fetch |
| limit | <code>int</code> | No | the maximum amount of changes to fetch |
| params | <code>object</code> | Yes | extra parameters specific to the exchange api endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest change to fetch |
binance.fetchMarginAdjustmentHistory (symbol[, type, since, limit, params])
<a name="fetchConvertCurrencies" id="fetchconvertcurrencies"></a>
fetches all available currencies that can be converted
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an associative dictionary of currencies
See: https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchConvertCurrencies ([params])
<a name="fetchConvertQuote" id="fetchconvertquote"></a>
fetch a quote for converting from one currency to another
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a conversion structure
See: https://developers.binance.com/docs/convert/trade/Send-quote-request
| Param | Type | Required | Description |
|---|---|---|---|
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | Yes | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.walletType | <code>string</code> | No | either 'SPOT' or 'FUNDING', the default is 'SPOT' |
binance.fetchConvertQuote (fromCode, toCode, amount[, params])
<a name="createConvertTrade" id="createconverttrade"></a>
convert from one currency to another
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a conversion structure
See: https://developers.binance.com/docs/convert/trade/Accept-Quote
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to make |
| fromCode | <code>string</code> | Yes | the currency that you want to sell and convert from |
| toCode | <code>string</code> | Yes | the currency that you want to buy and convert into |
| amount | <code>float</code> | No | how much you want to trade in units of the from currency |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.createConvertTrade (id, fromCode, toCode[, amount, params])
<a name="fetchConvertTrade" id="fetchconverttrade"></a>
fetch the data for a conversion trade
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a conversion structure
See: https://developers.binance.com/docs/convert/trade/Order-Status
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | the id of the trade that you want to fetch |
| code | <code>string</code> | No | the unified currency code of the conversion trade |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchConvertTrade (id[, code, params])
<a name="fetchConvertTradeHistory" id="fetchconverttradehistory"></a>
fetch the users history of conversion trades
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of conversion structures
See: https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
| Param | Type | Required | Description |
|---|---|---|---|
| code | <code>string</code> | No | the unified currency code |
| since | <code>int</code> | No | the earliest time in ms to fetch conversions for |
| limit | <code>int</code> | No | the maximum number of conversion structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest conversion to fetch |
binance.fetchConvertTradeHistory ([code, since, limit, params])
<a name="fetchFundingIntervals" id="fetchfundingintervals"></a>
fetch the funding rate interval for multiple markets
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of funding rate structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.subType | <code>string</code> | No | "linear" or "inverse" |
binance.fetchFundingIntervals ([symbols, params])
<a name="fetchLongShortRatioHistory" id="fetchlongshortratiohistory"></a>
fetches the long short ratio history for a unified market symbol
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - an array of long short ratio structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the long short ratio for |
| timeframe | <code>string</code> | No | the period for the ratio, default is 24 hours |
| since | <code>int</code> | No | the earliest time in ms to fetch ratios for |
| limit | <code>int</code> | No | the maximum number of long short ratio structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | No | timestamp in ms of the latest ratio to fetch |
binance.fetchLongShortRatioHistory (symbol[, timeframe, since, limit, params])
<a name="fetchADLRank" id="fetchadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a symbol
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an auto de leverage structure
See: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the auto deleveraging rank for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchADLRank (symbol[, params])
<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>
fetches the auto deleveraging rank and risk percentage for a list of symbols that have open positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - an array of auto de leverage structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true for the portfolio margin account |
binance.fetchPositionsADLRank ([symbols, params])
<a name="ensureUserDataStreamWsSubscribeSignature" id="ensureuserdatastreamwssubscribesignature"></a>
watches best bid & ask for symbols
Kind: instance property of <code>binance</code>
Returns: Promise<number> The subscription ID for the user data stream
See: Binance User Data Stream Documentation
| Param | Type | Description |
|---|---|---|
| marketType | <code>string</code> | only support on 'spot' |
binance.ensureUserDataStreamWsSubscribeSignature (marketType, [undefined])
<a name="ensureUserDataStreamWsSubscribeListenToken" id="ensureuserdatastreamwssubscribelistentoken"></a>
subscribes to user data stream using listenToken (for margin)
Kind: instance property of <code>binance</code>
Returns: Promise<void>
See: Binance User Data Stream Documentation
| Param | Type | Required | Description |
|---|---|---|---|
| marketType | <code>string</code> | Yes | the market type (e.g., 'margin') |
| params | <code>object</code> | Yes | extra parameters specific to the request |
| params.symbol | <code>string</code> | No | required for isolated margin |
| params.isIsolated | <code>boolean</code> | No | whether it is isolated margin |
| params.validity | <code>number</code> | No | validity in milliseconds, default 24 hours, max 24 hours |
binance.ensureUserDataStreamWsSubscribeListenToken (marketType, params[])
<a name="watchLiquidations" id="watchliquidations"></a>
watch the public liquidations of a trading pair
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
binance.watchLiquidations (symbol[, since, limit, params])
<a name="watchLiquidationsForSymbols" id="watchliquidationsforsymbols"></a>
watch the public liquidations of a trading pair
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
binance.watchLiquidationsForSymbols (symbols[, since, limit, params])
<a name="watchMyLiquidations" id="watchmyliquidations"></a>
watch the private liquidations of a trading pair
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified CCXT market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
binance.watchMyLiquidations (symbol[, since, limit, params])
<a name="watchMyLiquidationsForSymbols" id="watchmyliquidationsforsymbols"></a>
watch the private liquidations of a trading pair
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | list of unified market symbols |
| since | <code>int</code> | No | the earliest time in ms to fetch liquidations for |
| limit | <code>int</code> | No | the maximum number of liquidation structures to retrieve |
| params | <code>object</code> | No | exchange specific parameters for the bitmex api endpoint |
binance.watchMyLiquidationsForSymbols (symbols[, since, limit, params])
<a name="watchOrderBook" id="watchorderbook"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.watchOrderBook (symbol[, limit, params])
<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.rpi | <code>boolean</code> | No | future only set to true to use the RPI endpoint |
binance.watchOrderBookForSymbols (symbols[, limit, params])
<a name="unWatchOrderBookForSymbols" id="unwatchorderbookforsymbols"></a>
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified array of symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchOrderBookForSymbols (symbols[, params])
<a name="unWatchOrderBook" id="unwatchorderbook"></a>
unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified array of symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchOrderBook (symbol[, params])
<a name="fetchOrderBookWs" id="fetchorderbookws"></a>
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - A dictionary of order book structures indexed by market symbols
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the order book for |
| limit | <code>int</code> | No | the maximum amount of order book entries to return |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOrderBookWs (symbol[, limit, params])
<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>
get the list of most recent trades for a list of symbols
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.name | <code>string</code> | No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
binance.watchTradesForSymbols (symbols[, since, limit, params])
<a name="unWatchTradesForSymbols" id="unwatchtradesforsymbols"></a>
unsubscribes from the trades channel
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.name | <code>string</code> | No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
binance.unWatchTradesForSymbols (symbols[, params])
<a name="unWatchTrades" id="unwatchtrades"></a>
unsubscribes from the trades channel
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.name | <code>string</code> | No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
binance.unWatchTrades (symbol[, params])
<a name="watchTrades" id="watchtrades"></a>
get the list of most recent trades for a particular symbol
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch trades for |
| since | <code>int</code> | No | timestamp in ms of the earliest trade to fetch |
| limit | <code>int</code> | No | the maximum amount of trades to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.name | <code>string</code> | No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
binance.watchTrades (symbol[, since, limit, params])
<a name="watchOHLCV" id="watchohlcv"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.timezone | <code>object</code> | No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
binance.watchOHLCV (symbol, timeframe[, since, limit, params])
<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | <code>Array<Array<string>></code> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| since | <code>int</code> | No | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | No | the maximum amount of candles to fetch |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.timezone | <code>object</code> | No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
binance.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])
<a name="unWatchOHLCVForSymbols" id="unwatchohlcvforsymbols"></a>
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbolsAndTimeframes | <code>Array<Array<string>></code> | Yes | array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']] |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.timezone | <code>object</code> | No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
binance.unWatchOHLCVForSymbols (symbolsAndTimeframes[, params])
<a name="unWatchOHLCV" id="unwatchohlcv"></a>
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | <code>string</code> | Yes | the length of time each candle represents |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.timezone | <code>object</code> | No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
binance.unWatchOHLCV (symbol, timeframe[, params])
<a name="fetchTickerWs" id="fetchtickerws"></a>
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.method | <code>string</code> | No | method to use can be ticker.price or ticker.book |
| params.returnRateLimits | <code>boolean</code> | No | return the rate limits for the exchange |
binance.fetchTickerWs (symbol[, params])
<a name="fetchOHLCVWs" id="fetchohlcvws"></a>
query historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines
| Param | Type | Description |
|---|---|---|
| symbol | <code>string</code> | unified symbol of the market to query OHLCV data for |
| timeframe | <code>string</code> | the length of time each candle represents |
| since | <code>int</code> | timestamp in ms of the earliest candle to fetch |
| limit | <code>int</code> | the maximum amount of candles to fetch |
| params | <code>object</code> | extra parameters specific to the exchange API endpoint |
| params.until | <code>int</code> | timestamp in ms of the earliest candle to fetch EXCHANGE SPECIFIC PARAMETERS |
| params.timeZone | <code>string</code> | default=0 (UTC) |
binance.fetchOHLCVWs (symbol, timeframe, since, limit, params[])
<a name="watchTicker" id="watchticker"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.name | <code>string</code> | No | stream to use can be ticker or miniTicker |
binance.watchTicker (symbol[, params])
<a name="watchMarkPrice" id="watchmarkprice"></a>
watches a mark price for a specific market
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
binance.watchMarkPrice (symbol[, params])
<a name="watchMarkPrices" id="watchmarkprices"></a>
watches the mark price for all markets
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.use1sFreq | <code>boolean</code> | No | default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds |
binance.watchMarkPrices (symbols[, params])
<a name="watchTickers" id="watchtickers"></a>
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.watchTickers (symbols[, params])
<a name="unWatchTickers" id="unwatchtickers"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchTickers (symbols[, params])
<a name="unWatchMarkPrices" id="unwatchmarkprices"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchMarkPrices (symbols[, params])
<a name="unWatchMarkPrice" id="unwatchmarkprice"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchMarkPrice (symbol[, params])
<a name="unWatchTicker" id="unwatchticker"></a>
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.unWatchTicker (symbol[, params])
<a name="watchBidsAsks" id="watchbidsasks"></a>
watches best bid & ask for symbols
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | Yes | unified symbol of the market to fetch the ticker for |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.watchBidsAsks (symbols[, params])
<a name="fetchBalanceWs" id="fetchbalancews"></a>
fetch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a balance structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.type | <code>string</code>, <code>undefined</code> | No | 'future', 'delivery', 'savings', 'funding', or 'spot' |
| params.marginMode | <code>string</code>, <code>undefined</code> | No | 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null |
| params.symbols | <code>Array<string></code>, <code>undefined</code> | No | unified market symbols, only used in isolated margin mode |
| params.method | <code>string</code>, <code>undefined</code> | No | method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status |
binance.fetchBalanceWs ([params])
<a name="fetchPositionWs" id="fetchpositionws"></a>
fetch data on an open position
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the position is held in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchPositionWs (symbol[, params])
<a name="fetchPositionsWs" id="fetchpositionsws"></a>
fetch all open positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code> | No | list of unified market symbols |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.returnRateLimits | <code>boolean</code> | No | set to true to return rate limit informations, defaults to false. |
| params.method | <code>string</code>, <code>undefined</code> | No | method to use. Can be account.position or v2/account.position |
binance.fetchPositionsWs ([symbols, params])
<a name="watchBalance" id="watchbalance"></a>
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a balance structure
| Param | Type | Required | Description |
|---|---|---|---|
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to watch the balance of a portfolio margin account |
binance.watchBalance ([params])
<a name="createOrderWs" id="createorderws"></a>
create a trade order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of currency you want to trade in units of base currency |
| price | <code>float</code>, <code>undefined</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.test | <code>boolean</code> | Yes | test order, default false |
| params.returnRateLimits | <code>boolean</code> | Yes | set to true to return rate limit information, default false |
binance.createOrderWs (symbol, type, side, amount[, price, params])
<a name="editOrderWs" id="editorderws"></a>
edit a trade order
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | Yes | unified symbol of the market to create an order in |
| type | <code>string</code> | Yes | 'market' or 'limit' |
| side | <code>string</code> | Yes | 'buy' or 'sell' |
| amount | <code>float</code> | Yes | how much of the currency you want to trade in units of the base currency |
| price | <code>float</code>, <code>undefined</code> | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.editOrderWs (id, symbol, type, side, amount[, price, params])
<a name="cancelOrderWs" id="cancelorderws"></a>
cancel multiple orders
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | No | unified market symbol, default is undefined |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.cancelRestrictions | <code>string</code>, <code>undefined</code> | No | Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED. |
| params.trigger | <code>boolean</code> | No | set to true if you would like to cancel a conditional order |
binance.cancelOrderWs (id[, symbol, params])
<a name="cancelAllOrdersWs" id="cancelallordersws"></a>
cancel all open orders in a market
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | No | unified market symbol of the market to cancel orders in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.cancelAllOrdersWs ([symbol, params])
<a name="fetchOrderWs" id="fetchorderws"></a>
fetches information on an order made by the user
Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure
See
| Param | Type | Required | Description |
|---|---|---|---|
| id | <code>string</code> | Yes | order id |
| symbol | <code>string</code> | No | unified symbol of the market the order was made in |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOrderWs (id[, symbol, params])
<a name="fetchOrdersWs" id="fetchordersws"></a>
fetches information on multiple orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.orderId | <code>int</code> | No | order id to begin at |
| params.startTime | <code>int</code> | No | earliest time in ms to retrieve orders for |
| params.endTime | <code>int</code> | No | latest time in ms to retrieve orders for |
| params.limit | <code>int</code> | No | the maximum number of order structures to retrieve |
binance.fetchOrdersWs (symbol[, since, limit, params])
<a name="fetchClosedOrdersWs" id="fetchclosedordersws"></a>
fetch closed orders
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchClosedOrdersWs (symbol[, since, limit, params])
<a name="fetchOpenOrdersWs" id="fetchopenordersws"></a>
fetch all unfilled currently open orders
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch open orders for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of open orders structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
binance.fetchOpenOrdersWs (symbol[, since, limit, params])
<a name="watchOrders" id="watchorders"></a>
watches information on multiple orders made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of order structures
See
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market the orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | <code>string</code>, <code>undefined</code> | No | 'cross' or 'isolated', for spot margin |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to watch portfolio margin account orders |
binance.watchOrders (symbol[, since, limit, params])
<a name="watchPositions" id="watchpositions"></a>
watch all open positions
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | <code>Array<string></code>, <code>undefined</code> | Yes | list of unified market symbols |
| since | <code>number</code> | No | since timestamp |
| limit | <code>number</code> | No | limit |
| params | <code>object</code> | Yes | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to watch positions in a portfolio margin account |
binance.watchPositions (symbols[, since, limit, params])
<a name="fetchMyTradesWs" id="fetchmytradesws"></a>
fetch all trades made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code>, <code>undefined</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code>, <code>undefined</code> | No | the maximum number of trades structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.endTime | <code>int</code> | No | the latest time in ms to fetch trades for |
| params.fromId | <code>int</code> | No | first trade Id to fetch |
binance.fetchMyTradesWs (symbol[, since, limit, params])
<a name="fetchTradesWs" id="fetchtradesws"></a>
fetch all trades made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol |
| since | <code>int</code> | No | the earliest time in ms to fetch trades for |
| limit | <code>int</code> | No | the maximum number of trades structures to retrieve, default=500, max=1000 |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.fromId | <code>int</code> | No | trade ID to begin at |
binance.fetchTradesWs (symbol[, since, limit, params])
<a name="watchMyTrades" id="watchmytrades"></a>
watches information on multiple trades made by the user
Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | <code>string</code> | Yes | unified market symbol of the market orders were made in |
| since | <code>int</code> | No | the earliest time in ms to fetch orders for |
| limit | <code>int</code> | No | the maximum number of order structures to retrieve |
| params | <code>object</code> | No | extra parameters specific to the exchange API endpoint |
| params.portfolioMargin | <code>boolean</code> | No | set to true if you would like to watch trades in a portfolio margin account |
binance.watchMyTrades (symbol[, since, limit, params])