Back to Ccxt

Binance

wiki/exchanges/binance.md

4.5.52178.0 KB
Original Source

<a name="binance" id="binance"></a>

binance{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="enableDemoTrading" id="enabledemotrading"></a>

enableDemoTrading{docsify-ignore}

enables or disables demo trading mode

Kind: instance method of <code>binance</code>

See

ParamTypeRequiredDescription
enable<code>boolean</code>Notrue if demo trading should be enabled, false otherwise
javascript
binance.enableDemoTrading ([enable])

<a name="fetchTime" id="fetchtime"></a>

fetchTime{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchTime ([params])

<a name="fetchCurrencies" id="fetchcurrencies"></a>

fetchCurrencies{docsify-ignore}

fetches all available currencies on an exchange

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an associative dictionary of currencies

See

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchCurrencies ([params])

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchMarkets ([params])

<a name="fetchBalance" id="fetchbalance"></a>

fetchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra 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>Nounified market symbols, only used in isolated margin mode
params.portfolioMargin<code>boolean</code>Noset to true if you would like to fetch the balance for a portfolio margin account
params.subType<code>string</code>No'linear' or 'inverse'
javascript
binance.fetchBalance ([params])

<a name="fetchOrderBook" id="fetchorderbook"></a>

fetchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.rpi<code>boolean</code>Nofuture only set to true to use the RPI endpoint
javascript
binance.fetchOrderBook (symbol[, limit, params])

<a name="fetchStatus" id="fetchstatus"></a>

fetchStatus{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchStatus ([params])

<a name="fetchTicker" id="fetchticker"></a>

fetchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra 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
javascript
binance.fetchTicker (symbol[, params])

<a name="fetchBidsAsks" id="fetchbidsasks"></a>

fetchBidsAsks{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yesunified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchBidsAsks (symbols[, params])

<a name="fetchLastPrices" id="fetchlastprices"></a>

fetchLastPrices{docsify-ignore}

fetches the last price for multiple markets

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of lastprices structures

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yesunified symbols of the markets to fetch the last prices
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchLastPrices (symbols[, params])

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra 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
javascript
binance.fetchTickers ([symbols, params])

<a name="fetchMarkPrice" id="fetchmarkprice"></a>

fetchMarkPrice{docsify-ignore}

fetches mark price for the market

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchMarkPrice (symbol[, params])

<a name="fetchMarkPrices" id="fetchmarkprices"></a>

fetchMarkPrices{docsify-ignore}

fetches mark prices for multiple markets

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a dictionary of ticker structures

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchMarkPrices ([symbols, params])

<a name="fetchOHLCV" id="fetchohlcv"></a>

fetchOHLCV{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra 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>Notimestamp in ms of the latest candle to fetch
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
javascript
binance.fetchOHLCV (symbol, timeframe[, since, limit, params])

<a name="fetchTrades" id="fetchtrades"></a>

fetchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Noonly used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
limit<code>int</code>Nodefault 500, max 1000
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Noonly 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>Nodefault 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>Notrade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
javascript
binance.fetchTrades (symbol[, since, limit, params])

<a name="editContractOrder" id="editcontractorder"></a>

editContractOrder{docsify-ignore}

edit a trade order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yescancel order id
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to edit an order in a portfolio margin account
javascript
binance.editContractOrder (id, symbol, type, side, amount[, price, params])

<a name="editOrder" id="editorder"></a>

editOrder{docsify-ignore}

edit a trade order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yescancel order id
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.editOrder (id, symbol, type, side, amount[, price, params])

<a name="editOrders" id="editorders"></a>

editOrders{docsify-ignore}

edit a list of trade orders

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
orders<code>Array</code>Yeslist 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>Noextra parameters specific to the exchange API endpoint
javascript
binance.editOrders (orders[, params])

<a name="createOrders" id="createorders"></a>

createOrders{docsify-ignore}

contract only create a list of trade orders

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
orders<code>Array</code>Yeslist 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>Noextra parameters specific to the exchange API endpoint
javascript
binance.createOrders (orders[, params])

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

create a trade order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified 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>Yeshow much of you want to trade in units of the base currency
price<code>float</code>Nothe price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.reduceOnly<code>string</code>Nofor 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>Nospot only whether to use SOR (Smart Order Routing) or not, default is false
params.test<code>boolean</code>Nospot only whether to use the test endpoint or not, default is false
params.trailingPercent<code>float</code>Nothe percent to trail away from the current market price
params.trailingTriggerPrice<code>float</code>Nothe price to trigger a trailing order, default uses the price argument
params.triggerPrice<code>float</code>Nothe price that a trigger order is triggered at
params.stopLossPrice<code>float</code>Nothe price that a stop loss order is triggered at
params.takeProfitPrice<code>float</code>Nothe price that a take profit order is triggered at
params.portfolioMargin<code>boolean</code>Noset to true if you would like to create an order in a portfolio margin account
params.selfTradePrevention<code>string</code>Noset unified value for stp, one of NONE, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH
params.icebergAmount<code>float</code>Noset iceberg amount for limit orders
params.stopLossOrTakeProfit<code>string</code>No'stopLoss' or 'takeProfit', required for spot trailing orders
params.positionSide<code>string</code>Noswap 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>Noswap and portfolio margin only true for hedged mode, false for one way mode, default is false
params.clientOrderId<code>string</code>Nothe clientOrderId of the order
javascript
binance.createOrder (symbol, type, side, amount[, price, params])

<a name="createMarketOrderWithCost" id="createmarketorderwithcost"></a>

createMarketOrderWithCost{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to create an order in
side<code>string</code>Yes'buy' or 'sell'
cost<code>float</code>Yeshow much you want to trade in units of the quote currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.createMarketOrderWithCost (symbol, side, cost[, params])

<a name="createMarketBuyOrderWithCost" id="createmarketbuyorderwithcost"></a>

createMarketBuyOrderWithCost{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to create an order in
cost<code>float</code>Yeshow much you want to trade in units of the quote currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.createMarketBuyOrderWithCost (symbol, cost[, params])

<a name="createMarketSellOrderWithCost" id="createmarketsellorderwithcost"></a>

createMarketSellOrderWithCost{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to create an order in
cost<code>float</code>Yeshow much you want to trade in units of the quote currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.createMarketSellOrderWithCost (symbol, cost[, params])

<a name="fetchOrder" id="fetchorder"></a>

fetchOrder{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesthe order id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra 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>Noset to true if you would like to fetch an order in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch a trigger or conditional order
javascript
binance.fetchOrder (id, symbol[, params])

<a name="fetchOrders" id="fetchorders"></a>

fetchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra 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>Nothe latest time in ms to fetch orders for
params.paginate<code>boolean</code>Nodefault 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>Noset to true if you would like to fetch orders in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch portfolio margin account trigger or conditional orders
javascript
binance.fetchOrders (symbol[, since, limit, params])

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

fetch all unfilled currently open orders

Kind: instance method of <code>binance</code>
Returns: <code>Array<Order></code> - a list of order structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra 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>Noset to true if you would like to fetch open orders in the portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch portfolio margin account conditional orders
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchOpenOrders (symbol[, since, limit, params])

<a name="fetchOpenOrder" id="fetchopenorder"></a>

fetchOpenOrder{docsify-ignore}

fetch an open order by the id

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trigger<code>string</code>Noset to true if you would like to fetch portfolio margin account stop or conditional orders
params.portfolioMargin<code>boolean</code>Noset to true if you would like to fetch for a portfolio margin account
javascript
binance.fetchOpenOrder (id, symbol[, params])

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault 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>Noset to true if you would like to fetch orders in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch portfolio margin account trigger or conditional orders
javascript
binance.fetchClosedOrders (symbol[, since, limit, params])

<a name="fetchCanceledOrders" id="fetchcanceledorders"></a>

fetchCanceledOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault 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>Noset to true if you would like to fetch orders in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch portfolio margin account trigger or conditional orders
javascript
binance.fetchCanceledOrders (symbol[, since, limit, params])

<a name="fetchCanceledAndClosedOrders" id="fetchcanceledandclosedorders"></a>

fetchCanceledAndClosedOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault 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>Noset to true if you would like to fetch orders in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to fetch portfolio margin account trigger or conditional orders
javascript
binance.fetchCanceledAndClosedOrders (symbol[, since, limit, params])

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to cancel an order in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to cancel a portfolio margin account conditional order
javascript
binance.cancelOrder (id, symbol[, params])

<a name="cancelAllOrders" id="cancelallorders"></a>

cancelAllOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market to cancel orders in
params<code>object</code>Noextra 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>Noset to true if you would like to cancel orders in a portfolio margin account
params.trigger<code>boolean</code>Noset to true if you would like to cancel portfolio margin account conditional orders
javascript
binance.cancelAllOrders (symbol[, params])

<a name="cancelOrders" id="cancelorders"></a>

cancelOrders{docsify-ignore}

cancel multiple orders

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an list of order structures

See

ParamTypeRequiredDescription
ids<code>Array<string></code>Yesorder ids
symbol<code>string</code>Nounified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.clientOrderIds<code>Array<string></code>Noalternative to ids, array of client order ids EXCHANGE SPECIFIC PARAMETERS
params.origClientOrderIdList<code>Array<string></code>Nomax 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
javascript
binance.cancelOrders (ids[, symbol, params])

<a name="fetchOrderTrades" id="fetchordertrades"></a>

fetchOrderTrades{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOrderTrades (id, symbol[, since, limit, params])

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.paginate<code>boolean</code>Nodefault 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>Nothe latest time in ms to fetch entries for
params.portfolioMargin<code>boolean</code>Noset to true if you would like to fetch trades for a portfolio margin account
javascript
binance.fetchMyTrades (symbol[, since, limit, params])

<a name="fetchMyDustTrades" id="fetchmydusttrades"></a>

fetchMyDustTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesnot used by binance fetchMyDustTrades ()
since<code>int</code>Nothe earliest time in ms to fetch my dust trades for
limit<code>int</code>Nothe maximum number of dust trades to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.type<code>string</code>No'spot' or 'margin', default spot
javascript
binance.fetchMyDustTrades (symbol[, since, limit, params])

<a name="fetchDeposits" id="fetchdeposits"></a>

fetchDeposits{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch deposits for
limit<code>int</code>Nothe maximum number of deposits structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.fiat<code>bool</code>Noif true, only fiat deposits will be returned
params.until<code>int</code>Nothe latest time in ms to fetch entries for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
javascript
binance.fetchDeposits (code[, since, limit, params])

<a name="fetchWithdrawals" id="fetchwithdrawals"></a>

fetchWithdrawals{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Nothe earliest time in ms to fetch withdrawals for
limit<code>int</code>Nothe maximum number of withdrawals structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.fiat<code>bool</code>Noif true, only fiat withdrawals will be returned
params.until<code>int</code>Nothe latest time in ms to fetch withdrawals for
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
javascript
binance.fetchWithdrawals (code[, since, limit, params])

<a name="transfer" id="transfer"></a>

transfer{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesamount to transfer
fromAccount<code>string</code>Yesaccount to transfer from
toAccount<code>string</code>Yesaccount to transfer to
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.type<code>string</code>Noexchange specific transfer type
params.symbol<code>string</code>Nothe unified symbol, required for isolated margin transfers
javascript
binance.transfer (code, amount, fromAccount, toAccount[, params])

<a name="fetchTransfers" id="fetchtransfers"></a>

fetchTransfers{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code of the currency transferred
since<code>int</code>Nothe earliest time in ms to fetch transfers for
limit<code>int</code>Nothe maximum number of transfers structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Nothe latest time in ms to fetch transfers for
params.paginate<code>boolean</code>Nodefault 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>Nodefault false, when true will fetch pay trade history
javascript
binance.fetchTransfers (code[, since, limit, params])

<a name="fetchDepositAddress" id="fetchdepositaddress"></a>

fetchDepositAddress{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.network<code>string</code>Nonetwork for fetch deposit address
javascript
binance.fetchDepositAddress (code[, params])

<a name="fetchTransactionFees" id="fetchtransactionfees"></a>

fetchTransactionFees{docsify-ignore}

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

ParamTypeRequiredDescription
codes<code>Array<string></code>, <code>undefined</code>Yesnot used by binance fetchTransactionFees ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchTransactionFees (codes[, params])

<a name="fetchDepositWithdrawFees" id="fetchdepositwithdrawfees"></a>

fetchDepositWithdrawFees{docsify-ignore}

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

ParamTypeRequiredDescription
codes<code>Array<string></code>, <code>undefined</code>Yesnot used by binance fetchDepositWithdrawFees ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchDepositWithdrawFees (codes[, params])

<a name="withdraw" id="withdraw"></a>

withdraw{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesthe amount to withdraw
address<code>string</code>Yesthe address to withdraw to
tag<code>string</code>Yes
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.withdraw (code, amount, address, tag[, params])

<a name="fetchTradingFee" id="fetchtradingfee"></a>

fetchTradingFee{docsify-ignore}

fetch the trading fees for a market

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a fee structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to fetch trading fees in a portfolio margin account
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchTradingFee (symbol[, params])

<a name="fetchTradingFees" id="fetchtradingfees"></a>

fetchTradingFees{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchTradingFees ([params])

<a name="fetchFundingRate" id="fetchfundingrate"></a>

fetchFundingRate{docsify-ignore}

fetch the current funding rate

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a funding rate structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchFundingRate (symbol[, params])

<a name="fetchFundingRateHistory" id="fetchfundingratehistory"></a>

fetchFundingRateHistory{docsify-ignore}

fetches historical funding rate prices

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of funding rate structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the funding rate history for
since<code>int</code>Notimestamp in ms of the earliest funding rate to fetch
limit<code>int</code>Nothe maximum amount of funding rate structures to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest funding rate
params.paginate<code>boolean</code>Nodefault 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"
javascript
binance.fetchFundingRateHistory (symbol[, since, limit, params])

<a name="fetchFundingRates" id="fetchfundingrates"></a>

fetchFundingRates{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchFundingRates (symbols[, params])

<a name="fetchLeverageTiers" id="fetchleveragetiers"></a>

fetchLeverageTiers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset 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"
javascript
binance.fetchLeverageTiers (symbols[, params])

<a name="fetchPosition" id="fetchposition"></a>

fetchPosition{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the position is held in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchPosition (symbol[, params])

<a name="fetchOptionPositions" id="fetchoptionpositions"></a>

fetchOptionPositions{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOptionPositions (symbols[, params])

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

fetch all open positions

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.method<code>string</code>Nomethod name to call, "positionRisk", "account" or "option", default is "positionRisk"
params.useV2<code>bool</code>Noset to true if you want to use the obsolete endpoint, where some more additional fields were provided
javascript
binance.fetchPositions ([symbols, params])

<a name="fetchFundingHistory" id="fetchfundinghistory"></a>

fetchFundingHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch funding history for
limit<code>int</code>Nothe maximum number of funding history structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest funding history entry
params.portfolioMargin<code>boolean</code>Noset 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"
javascript
binance.fetchFundingHistory (symbol[, since, limit, params])

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

set the level of leverage for a market

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange

See

ParamTypeRequiredDescription
leverage<code>float</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to set the leverage for a trading pair in a portfolio margin account
javascript
binance.setLeverage (leverage, symbol[, params])

<a name="setMarginMode" id="setmarginmode"></a>

setMarginMode{docsify-ignore}

set margin mode to 'cross' or 'isolated'

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - response from the exchange

See

ParamTypeRequiredDescription
marginMode<code>string</code>Yes'cross' or 'isolated'
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.setMarginMode (marginMode, symbol[, params])

<a name="setPositionMode" id="setpositionmode"></a>

setPositionMode{docsify-ignore}

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

ParamTypeRequiredDescription
hedged<code>bool</code>Yesset to true to use dualSidePosition
symbol<code>string</code>Yesnot used by binance setPositionMode ()
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset 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"
javascript
binance.setPositionMode (hedged, symbol[, params])

<a name="fetchLeverages" id="fetchleverages"></a>

fetchLeverages{docsify-ignore}

fetch the set leverage for all markets

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a list of leverage structures

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchLeverages ([symbols, params])

<a name="fetchSettlementHistory" id="fetchsettlementhistory"></a>

fetchSettlementHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the settlement history
since<code>int</code>Notimestamp in ms
limit<code>int</code>Nonumber of records, default 100, max 100
params<code>object</code>Noexchange specific params
javascript
binance.fetchSettlementHistory (symbol[, since, limit, params])

<a name="fetchMySettlementHistory" id="fetchmysettlementhistory"></a>

fetchMySettlementHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the settlement history
since<code>int</code>Notimestamp in ms
limit<code>int</code>Nonumber of records
params<code>object</code>Noexchange specific params
javascript
binance.fetchMySettlementHistory (symbol[, since, limit, params])

<a name="fetchLedgerEntry" id="fetchledgerentry"></a>

fetchLedgerEntry{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesthe identification number of the ledger entry
code<code>string</code>Yesunified currency code
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchLedgerEntry (id, code[, params])

<a name="fetchLedger" id="fetchledger"></a>

fetchLedger{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code
since<code>int</code>Notimestamp in ms of the earliest ledger entry
limit<code>int</code>Nomax number of ledger entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest ledger entry
params.paginate<code>boolean</code>Nodefault 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>Noset to true if you would like to fetch the ledger for a portfolio margin account
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchLedger ([code, since, limit, params])

<a name="reduceMargin" id="reducemargin"></a>

reduceMargin{docsify-ignore}

remove margin from a position

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesthe amount of margin to remove
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.reduceMargin (symbol, amount[, params])

<a name="addMargin" id="addmargin"></a>

addMargin{docsify-ignore}

add margin

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesamount of margin to add
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.addMargin (symbol, amount[, params])

<a name="fetchCrossBorrowRate" id="fetchcrossborrowrate"></a>

fetchCrossBorrowRate{docsify-ignore}

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

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchCrossBorrowRate (code[, params])

<a name="fetchIsolatedBorrowRate" id="fetchisolatedborrowrate"></a>

fetchIsolatedBorrowRate{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS
params.vipLevel<code>object</code>Nouser's current specific margin data will be returned if viplevel is omitted
javascript
binance.fetchIsolatedBorrowRate (symbol[, params])

<a name="fetchIsolatedBorrowRates" id="fetchisolatedborrowrates"></a>

fetchIsolatedBorrowRates{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.symbol<code>object</code>Nounified market symbol EXCHANGE SPECIFIC PARAMETERS
params.vipLevel<code>object</code>Nouser's current specific margin data will be returned if viplevel is omitted
javascript
binance.fetchIsolatedBorrowRates ([params])

<a name="fetchBorrowRateHistory" id="fetchborrowratehistory"></a>

fetchBorrowRateHistory{docsify-ignore}

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

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
since<code>int</code>Notimestamp for the earliest borrow rate
limit<code>int</code>Nothe maximum number of borrow rate structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchBorrowRateHistory (code[, since, limit, params])

<a name="createGiftCode" id="creategiftcode"></a>

createGiftCode{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Yesgift code
amount<code>float</code>Yesamount of currency for the gift
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.createGiftCode (code, amount[, params])

<a name="redeemGiftCode" id="redeemgiftcode"></a>

redeemGiftCode{docsify-ignore}

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

ParamTypeRequiredDescription
giftcardCode<code>string</code>Yes
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.redeemGiftCode (giftcardCode[, params])

<a name="verifyGiftCode" id="verifygiftcode"></a>

verifyGiftCode{docsify-ignore}

verify 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/Verify-Binance-Gift-Card-by-Gift-Card-Number

ParamTypeRequiredDescription
id<code>string</code>Yesreference number id
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.verifyGiftCode (id[, params])

<a name="fetchBorrowInterest" id="fetchborrowinterest"></a>

fetchBorrowInterest{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nounified currency code
symbol<code>string</code>Nounified market symbol when fetch interest in isolated markets
since<code>int</code>Nothe earliest time in ms to fetch borrrow interest for
limit<code>int</code>Nothe maximum number of structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to fetch the borrow interest in a portfolio margin account
javascript
binance.fetchBorrowInterest ([code, symbol, since, limit, params])

<a name="repayCrossMargin" id="repaycrossmargin"></a>

repayCrossMargin{docsify-ignore}

repay borrowed margin and interest

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure

See

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code of the currency to repay
amount<code>float</code>Yesthe amount to repay
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to repay margin in a portfolio margin account
params.repayCrossMarginMethod<code>string</code>Noportfolio margin only 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
params.specifyRepayAssets<code>string</code>Noportfolio margin papiPostMarginRepayDebt only specific asset list to repay debt
javascript
binance.repayCrossMargin (code, amount[, params])

<a name="repayIsolatedMargin" id="repayisolatedmargin"></a>

repayIsolatedMargin{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol, required for isolated margin
code<code>string</code>Yesunified currency code of the currency to repay
amount<code>float</code>Yesthe amount to repay
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.repayIsolatedMargin (symbol, code, amount[, params])

<a name="borrowCrossMargin" id="borrowcrossmargin"></a>

borrowCrossMargin{docsify-ignore}

create a loan to borrow margin

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin loan structure

See

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code of the currency to borrow
amount<code>float</code>Yesthe amount to borrow
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to borrow margin in a portfolio margin account
javascript
binance.borrowCrossMargin (code, amount[, params])

<a name="borrowIsolatedMargin" id="borrowisolatedmargin"></a>

borrowIsolatedMargin{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol, required for isolated margin
code<code>string</code>Yesunified currency code of the currency to borrow
amount<code>float</code>Yesthe amount to borrow
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.borrowIsolatedMargin (symbol, code, amount[, params])

<a name="fetchOpenInterestHistory" id="fetchopeninteresthistory"></a>

fetchOpenInterestHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>YesUnified CCXT market symbol
timeframe<code>string</code>Yes"5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
since<code>int</code>Nothe time(ms) of the earliest record to retrieve as a unix timestamp
limit<code>int</code>Nodefault 30, max 500
params<code>object</code>Noexchange specific parameters
params.until<code>int</code>Nothe time(ms) of the latest record to retrieve as a unix timestamp
params.paginate<code>boolean</code>Nodefault false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
javascript
binance.fetchOpenInterestHistory (symbol, timeframe[, since, limit, params])

<a name="fetchOpenInterest" id="fetchopeninterest"></a>

fetchOpenInterest{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
params<code>object</code>Noexchange specific parameters
javascript
binance.fetchOpenInterest (symbol[, params])

<a name="fetchMyLiquidations" id="fetchmyliquidations"></a>

fetchMyLiquidations{docsify-ignore}

retrieves the users liquidated positions

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an array of liquidation structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Nounified CCXT market symbol
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the binance api endpoint
params.until<code>int</code>Notimestamp in ms of the latest liquidation
params.paginate<code>boolean</code>Nospot 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>Noset 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"
javascript
binance.fetchMyLiquidations ([symbol, since, limit, params])

<a name="fetchGreeks" id="fetchgreeks"></a>

fetchGreeks{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch greeks for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchGreeks (symbol[, params])

<a name="fetchAllGreeks" id="fetchallgreeks"></a>

fetchAllGreeks{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbols of the markets to fetch greeks for, all markets are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchAllGreeks ([symbols, params])

<a name="fetchPositionMode" id="fetchpositionmode"></a>

fetchPositionMode{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchPositionMode (symbol[, params])

<a name="fetchMarginModes" id="fetchmarginmodes"></a>

fetchMarginModes{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchMarginModes (symbols[, params])

<a name="fetchMarginMode" id="fetchmarginmode"></a>

fetchMarginMode{docsify-ignore}

fetches the margin mode of a specific symbol

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a margin mode structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchMarginMode (symbol[, params])

<a name="fetchOption" id="fetchoption"></a>

fetchOption{docsify-ignore}

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

See: https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOption (symbol[, params])

<a name="fetchMarginAdjustmentHistory" id="fetchmarginadjustmenthistory"></a>

fetchMarginAdjustmentHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
type<code>string</code>No"add" or "reduce"
since<code>int</code>Notimestamp in ms of the earliest change to fetch
limit<code>int</code>Nothe maximum amount of changes to fetch
params<code>object</code>Yesextra parameters specific to the exchange api endpoint
params.until<code>int</code>Notimestamp in ms of the latest change to fetch
javascript
binance.fetchMarginAdjustmentHistory (symbol[, type, since, limit, params])

<a name="fetchConvertCurrencies" id="fetchconvertcurrencies"></a>

fetchConvertCurrencies{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchConvertCurrencies ([params])

<a name="fetchConvertQuote" id="fetchconvertquote"></a>

fetchConvertQuote{docsify-ignore}

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

ParamTypeRequiredDescription
fromCode<code>string</code>Yesthe currency that you want to sell and convert from
toCode<code>string</code>Yesthe currency that you want to buy and convert into
amount<code>float</code>Yeshow much you want to trade in units of the from currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.walletType<code>string</code>Noeither 'SPOT' or 'FUNDING', the default is 'SPOT'
javascript
binance.fetchConvertQuote (fromCode, toCode, amount[, params])

<a name="createConvertTrade" id="createconverttrade"></a>

createConvertTrade{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesthe id of the trade that you want to make
fromCode<code>string</code>Yesthe currency that you want to sell and convert from
toCode<code>string</code>Yesthe currency that you want to buy and convert into
amount<code>float</code>Nohow much you want to trade in units of the from currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.createConvertTrade (id, fromCode, toCode[, amount, params])

<a name="fetchConvertTrade" id="fetchconverttrade"></a>

fetchConvertTrade{docsify-ignore}

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

ParamTypeRequiredDescription
id<code>string</code>Yesthe id of the trade that you want to fetch
code<code>string</code>Nothe unified currency code of the conversion trade
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchConvertTrade (id[, code, params])

<a name="fetchConvertTradeHistory" id="fetchconverttradehistory"></a>

fetchConvertTradeHistory{docsify-ignore}

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

ParamTypeRequiredDescription
code<code>string</code>Nothe unified currency code
since<code>int</code>Nothe earliest time in ms to fetch conversions for
limit<code>int</code>Nothe maximum number of conversion structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest conversion to fetch
javascript
binance.fetchConvertTradeHistory ([code, since, limit, params])

<a name="fetchFundingIntervals" id="fetchfundingintervals"></a>

fetchFundingIntervals{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.subType<code>string</code>No"linear" or "inverse"
javascript
binance.fetchFundingIntervals ([symbols, params])

<a name="fetchLongShortRatioHistory" id="fetchlongshortratiohistory"></a>

fetchLongShortRatioHistory{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the long short ratio for
timeframe<code>string</code>Nothe period for the ratio, default is 24 hours
since<code>int</code>Nothe earliest time in ms to fetch ratios for
limit<code>int</code>Nothe maximum number of long short ratio structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest ratio to fetch
javascript
binance.fetchLongShortRatioHistory (symbol[, timeframe, since, limit, params])

<a name="fetchADLRank" id="fetchadlrank"></a>

fetchADLRank{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the auto deleveraging rank for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchADLRank (symbol[, params])

<a name="fetchPositionsADLRank" id="fetchpositionsadlrank"></a>

fetchPositionsADLRank{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true for the portfolio margin account
javascript
binance.fetchPositionsADLRank ([symbols, params])

<a name="ensureUserDataStreamWsSubscribeSignature" id="ensureuserdatastreamwssubscribesignature"></a>

ensureUserDataStreamWsSubscribeSignature{docsify-ignore}

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

ParamTypeDescription
marketType<code>string</code>only support on 'spot'
javascript
binance.ensureUserDataStreamWsSubscribeSignature (marketType, [undefined])

<a name="ensureUserDataStreamWsSubscribeListenToken" id="ensureuserdatastreamwssubscribelistentoken"></a>

ensureUserDataStreamWsSubscribeListenToken{docsify-ignore}

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

ParamTypeRequiredDescription
marketType<code>string</code>Yesthe market type (e.g., 'margin')
params<code>object</code>Yesextra parameters specific to the request
params.symbol<code>string</code>Norequired for isolated margin
params.isIsolated<code>boolean</code>Nowhether it is isolated margin
params.validity<code>number</code>Novalidity in milliseconds, default 24 hours, max 24 hours
javascript
binance.ensureUserDataStreamWsSubscribeListenToken (marketType, params[])

<a name="watchLiquidations" id="watchliquidations"></a>

watchLiquidations{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
binance.watchLiquidations (symbol[, since, limit, params])

<a name="watchLiquidationsForSymbols" id="watchliquidationsforsymbols"></a>

watchLiquidationsForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yeslist of unified market symbols
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
binance.watchLiquidationsForSymbols (symbols[, since, limit, params])

<a name="watchMyLiquidations" id="watchmyliquidations"></a>

watchMyLiquidations{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
binance.watchMyLiquidations (symbol[, since, limit, params])

<a name="watchMyLiquidationsForSymbols" id="watchmyliquidationsforsymbols"></a>

watchMyLiquidationsForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yeslist of unified market symbols
since<code>int</code>Nothe earliest time in ms to fetch liquidations for
limit<code>int</code>Nothe maximum number of liquidation structures to retrieve
params<code>object</code>Noexchange specific parameters for the bitmex api endpoint
javascript
binance.watchMyLiquidationsForSymbols (symbols[, since, limit, params])

<a name="watchOrderBook" id="watchorderbook"></a>

watchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.watchOrderBook (symbol[, limit, params])

<a name="watchOrderBookForSymbols" id="watchorderbookforsymbols"></a>

watchOrderBookForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified array of symbols
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.rpi<code>boolean</code>Nofuture only set to true to use the RPI endpoint
javascript
binance.watchOrderBookForSymbols (symbols[, limit, params])

<a name="unWatchOrderBookForSymbols" id="unwatchorderbookforsymbols"></a>

unWatchOrderBookForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified array of symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchOrderBookForSymbols (symbols[, params])

<a name="unWatchOrderBook" id="unwatchorderbook"></a>

unWatchOrderBook{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified array of symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchOrderBook (symbol[, params])

<a name="fetchOrderBookWs" id="fetchorderbookws"></a>

fetchOrderBookWs{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the order book for
limit<code>int</code>Nothe maximum amount of order book entries to return
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOrderBookWs (symbol[, limit, params])

<a name="watchTradesForSymbols" id="watchtradesforsymbols"></a>

watchTradesForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.name<code>string</code>Nothe name of the method to call, 'trade' or 'aggTrade', default is 'trade'
javascript
binance.watchTradesForSymbols (symbols[, since, limit, params])

<a name="unWatchTradesForSymbols" id="unwatchtradesforsymbols"></a>

unWatchTradesForSymbols{docsify-ignore}

unsubscribes from the trades channel

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch trades for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.name<code>string</code>Nothe name of the method to call, 'trade' or 'aggTrade', default is 'trade'
javascript
binance.unWatchTradesForSymbols (symbols[, params])

<a name="unWatchTrades" id="unwatchtrades"></a>

unWatchTrades{docsify-ignore}

unsubscribes from the trades channel

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of trade structures

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.name<code>string</code>Nothe name of the method to call, 'trade' or 'aggTrade', default is 'trade'
javascript
binance.unWatchTrades (symbol[, params])

<a name="watchTrades" id="watchtrades"></a>

watchTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch trades for
since<code>int</code>Notimestamp in ms of the earliest trade to fetch
limit<code>int</code>Nothe maximum amount of trades to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.name<code>string</code>Nothe name of the method to call, 'trade' or 'aggTrade', default is 'trade'
javascript
binance.watchTrades (symbol[, since, limit, params])

<a name="watchOHLCV" id="watchohlcv"></a>

watchOHLCV{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.timezone<code>object</code>Noif provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
javascript
binance.watchOHLCV (symbol, timeframe[, since, limit, params])

<a name="watchOHLCVForSymbols" id="watchohlcvforsymbols"></a>

watchOHLCVForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbolsAndTimeframes<code>Array<Array<string>></code>Yesarray of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.timezone<code>object</code>Noif provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
javascript
binance.watchOHLCVForSymbols (symbolsAndTimeframes[, since, limit, params])

<a name="unWatchOHLCVForSymbols" id="unwatchohlcvforsymbols"></a>

unWatchOHLCVForSymbols{docsify-ignore}

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

ParamTypeRequiredDescription
symbolsAndTimeframes<code>Array<Array<string>></code>Yesarray of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.timezone<code>object</code>Noif provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
javascript
binance.unWatchOHLCVForSymbols (symbolsAndTimeframes[, params])

<a name="unWatchOHLCV" id="unwatchohlcv"></a>

unWatchOHLCV{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.timezone<code>object</code>Noif provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
javascript
binance.unWatchOHLCV (symbol, timeframe[, params])

<a name="fetchTickerWs" id="fetchtickerws"></a>

fetchTickerWs{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.method<code>string</code>Nomethod to use can be ticker.price or ticker.book
params.returnRateLimits<code>boolean</code>Noreturn the rate limits for the exchange
javascript
binance.fetchTickerWs (symbol[, params])

<a name="fetchOHLCVWs" id="fetchohlcvws"></a>

fetchOHLCVWs{docsify-ignore}

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

ParamTypeDescription
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)
javascript
binance.fetchOHLCVWs (symbol, timeframe, since, limit, params[])

<a name="watchTicker" id="watchticker"></a>

watchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.name<code>string</code>Nostream to use can be ticker or miniTicker
javascript
binance.watchTicker (symbol[, params])

<a name="watchMarkPrice" id="watchmarkprice"></a>

watchMarkPrice{docsify-ignore}

watches a mark price for a specific market

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.use1sFreq<code>boolean</code>Nodefault is true if set to true, the mark price will be updated every second, otherwise every 3 seconds
javascript
binance.watchMarkPrice (symbol[, params])

<a name="watchMarkPrices" id="watchmarkprices"></a>

watchMarkPrices{docsify-ignore}

watches the mark price for all markets

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.use1sFreq<code>boolean</code>Nodefault is true if set to true, the mark price will be updated every second, otherwise every 3 seconds
javascript
binance.watchMarkPrices (symbols[, params])

<a name="watchTickers" id="watchtickers"></a>

watchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.watchTickers (symbols[, params])

<a name="unWatchTickers" id="unwatchtickers"></a>

unWatchTickers{docsify-ignore}

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

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchTickers (symbols[, params])

<a name="unWatchMarkPrices" id="unwatchmarkprices"></a>

unWatchMarkPrices{docsify-ignore}

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: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchMarkPrices (symbols[, params])

<a name="unWatchMarkPrice" id="unwatchmarkprice"></a>

unWatchMarkPrice{docsify-ignore}

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: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchMarkPrice (symbol[, params])

<a name="unWatchTicker" id="unwatchticker"></a>

unWatchTicker{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.unWatchTicker (symbol[, params])

<a name="watchBidsAsks" id="watchbidsasks"></a>

watchBidsAsks{docsify-ignore}

watches best bid & ask for symbols

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - a ticker structure

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.watchBidsAsks (symbols[, params])

<a name="fetchBalanceWs" id="fetchbalancews"></a>

fetchBalanceWs{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra 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>Nounified market symbols, only used in isolated margin mode
params.method<code>string</code>, <code>undefined</code>Nomethod to use. Can be account.balance, account.status, v2/account.balance or v2/account.status
javascript
binance.fetchBalanceWs ([params])

<a name="fetchPositionWs" id="fetchpositionws"></a>

fetchPositionWs{docsify-ignore}

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/usds-margined-futures/trade/websocket-api/Position-Information

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the position is held in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchPositionWs (symbol[, params])

<a name="fetchPositionsWs" id="fetchpositionsws"></a>

fetchPositionsWs{docsify-ignore}

fetch all open positions

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure

See

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.returnRateLimits<code>boolean</code>Noset to true to return rate limit informations, defaults to false.
params.method<code>string</code>, <code>undefined</code>Nomethod to use. Can be account.position or v2/account.position
javascript
binance.fetchPositionsWs ([symbols, params])

<a name="watchBalance" id="watchbalance"></a>

watchBalance{docsify-ignore}

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

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to watch the balance of a portfolio margin account
javascript
binance.watchBalance ([params])

<a name="createOrderWs" id="createorderws"></a>

createOrderWs{docsify-ignore}

create a trade order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified 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>Yeshow much of currency you want to trade in units of base currency
price<code>float</code>, <code>undefined</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.test<code>boolean</code>Yestest order, default false
params.returnRateLimits<code>boolean</code>Yesset to true to return rate limit information, default false
javascript
binance.createOrderWs (symbol, type, side, amount[, price, params])

<a name="editOrderWs" id="editorderws"></a>

editOrderWs{docsify-ignore}

edit a trade order

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified 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>Yeshow much of the currency you want to trade in units of the base currency
price<code>float</code>, <code>undefined</code>Nothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.editOrderWs (id, symbol, type, side, amount[, price, params])

<a name="cancelOrderWs" id="cancelorderws"></a>

cancelOrderWs{docsify-ignore}

cancel multiple orders

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - an list of order structures

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Nounified market symbol, default is undefined
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.cancelRestrictions<code>string</code>, <code>undefined</code>NoSupported 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>Noset to true if you would like to cancel a conditional order
javascript
binance.cancelOrderWs (id[, symbol, params])

<a name="cancelAllOrdersWs" id="cancelallordersws"></a>

cancelAllOrdersWs{docsify-ignore}

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: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol of the market to cancel orders in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.cancelAllOrdersWs ([symbol, params])

<a name="fetchOrderWs" id="fetchorderws"></a>

fetchOrderWs{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of <code>binance</code>
Returns: <code>object</code> - An order structure

See

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Nounified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOrderWs (id[, symbol, params])

<a name="fetchOrdersWs" id="fetchordersws"></a>

fetchOrdersWs{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>, <code>undefined</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>, <code>undefined</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.orderId<code>int</code>Noorder id to begin at
params.startTime<code>int</code>Noearliest time in ms to retrieve orders for
params.endTime<code>int</code>Nolatest time in ms to retrieve orders for
params.limit<code>int</code>Nothe maximum number of order structures to retrieve
javascript
binance.fetchOrdersWs (symbol[, since, limit, params])

<a name="fetchClosedOrdersWs" id="fetchclosedordersws"></a>

fetchClosedOrdersWs{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchClosedOrdersWs (symbol[, since, limit, params])

<a name="fetchOpenOrdersWs" id="fetchopenordersws"></a>

fetchOpenOrdersWs{docsify-ignore}

fetch all unfilled currently open 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#current-open-orders-user_data

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>, <code>undefined</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>, <code>undefined</code>Nothe maximum number of open orders structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
binance.fetchOpenOrdersWs (symbol[, since, limit, params])

<a name="watchOrders" id="watchorders"></a>

watchOrders{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market the orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra 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>Noset to true if you would like to watch portfolio margin account orders
javascript
binance.watchOrders (symbol[, since, limit, params])

<a name="watchPositions" id="watchpositions"></a>

watchPositions{docsify-ignore}

watch all open positions

Kind: instance method of <code>binance</code>
Returns: <code>Array<object></code> - a list of position structure

ParamTypeRequiredDescription
symbols<code>Array<string></code>, <code>undefined</code>Yeslist of unified market symbols
since<code>number</code>Nosince timestamp
limit<code>number</code>Nolimit
params<code>object</code>Yesextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to watch positions in a portfolio margin account
javascript
binance.watchPositions (symbols[, since, limit, params])

<a name="fetchMyTradesWs" id="fetchmytradesws"></a>

fetchMyTradesWs{docsify-ignore}

fetch all 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/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>, <code>undefined</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>, <code>undefined</code>Nothe maximum number of trades structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.endTime<code>int</code>Nothe latest time in ms to fetch trades for
params.fromId<code>int</code>Nofirst trade Id to fetch
javascript
binance.fetchMyTradesWs (symbol[, since, limit, params])

<a name="fetchTradesWs" id="fetchtradesws"></a>

fetchTradesWs{docsify-ignore}

fetch all 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/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trades structures to retrieve, default=500, max=1000
params<code>object</code>Noextra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS
params.fromId<code>int</code>Notrade ID to begin at
javascript
binance.fetchTradesWs (symbol[, since, limit, params])

<a name="watchMyTrades" id="watchmytrades"></a>

watchMyTrades{docsify-ignore}

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

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.portfolioMargin<code>boolean</code>Noset to true if you would like to watch trades in a portfolio margin account
javascript
binance.watchMyTrades (symbol[, since, limit, params])