{"id":26244989,"url":"https://github.com/ccxt/node-binance-api","last_synced_at":"2025-05-13T15:13:11.317Z","repository":{"id":37431934,"uuid":"105945813","full_name":"ccxt/node-binance-api","owner":"ccxt","description":"Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.","archived":false,"fork":false,"pushed_at":"2025-05-08T15:05:20.000Z","size":2356,"stargazers_count":1617,"open_issues_count":291,"forks_count":765,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-05-09T04:03:20.226Z","etag":null,"topics":["algorithmic-trading","binance","crypto","cryptocurrency","cryptocurrency-exchanges","javascript","node","trading"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ccxt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-10-05T22:15:44.000Z","updated_at":"2025-05-08T15:12:51.000Z","dependencies_parsed_at":"2024-01-11T21:33:15.562Z","dependency_job_id":"3129f43f-0a7d-4943-9dd3-81400e7c276a","html_url":"https://github.com/ccxt/node-binance-api","commit_stats":{"total_commits":788,"total_committers":96,"mean_commits":8.208333333333334,"dds":0.6078680203045685,"last_synced_commit":"950d773a5f2c3a61c6e29b53e3af57594921a239"},"previous_names":["carlosmiei/node-binance-api","jaggedsoft/node-binance-api","ccxt/node-binance-api"],"tags_count":120,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fnode-binance-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fnode-binance-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fnode-binance-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ccxt%2Fnode-binance-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ccxt","download_url":"https://codeload.github.com/ccxt/node-binance-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253617962,"owners_count":21936896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithmic-trading","binance","crypto","cryptocurrency","cryptocurrency-exchanges","javascript","node","trading"],"created_at":"2025-03-13T12:02:30.281Z","updated_at":"2025-05-13T15:13:06.302Z","avatar_url":"https://github.com/ccxt.png","language":"TypeScript","readme":"\n\u003c!-- [![Binance Community API](https://cdn.discordapp.com/attachments/569865969120575519/718166995354255370/binance-api-black.png)](https://dev.binance.vision/) --\u003e\n\n\u003c!-- ![Last Commit](https://badgen.net/github/last-commit/jaggedsoft/node-binance-api?scale=2\u0026label=🟣%20Updated\u0026labelColor=black\u0026color=448AFF\u0026cache=9999) --\u003e\n\u003c!-- [![npm downloads](https://img.shields.io/npm/dt/node-binance-api.svg?maxAge=7200)](https://www.npmjs.com/package/node-binance-api) [![Build Status](https://travis-ci.org/jaggedsoft/node-binance-api.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/jaggedsoft/node-binance-api) [![Coverage Status](https://coveralls.io/repos/github/jaggedsoft/node-binance-api/badge.svg?branch=master\u0026style=flat-square)](https://coveralls.io/github/jaggedsoft/node-binance-api) [![CodeCov](https://codecov.io/gh/jaggedsoft/node-binance-api/branch/master/graph/badge.svg?style=flat-square)](https://codecov.io/github/jaggedsoft/node-binance-api/) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/996757cec66542c0a64fca2b4cf8a936)](https://www.codacy.com/app/jaggedsoft/node-binance-api?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=jaggedsoft/node-binance-api\u0026utm_campaign=Badge_Coverage) [![Codacy Grade](https://api.codacy.com/project/badge/Grade/996757cec66542c0a64fca2b4cf8a936)](https://www.codacy.com/app/jaggedsoft/node-binance-api) https://img.shields.io/npm/dm/node-binance-api.svg?labelColor=blueviolet)\nhttps://badgen.net/npm/dm/node-binance-api?labelColor=7C4DFF\u0026color=green\u0026scale=2\u0026label=Downloads\u0026icon=bitcoin\n🟣 Used by 727 https://badgen.net/github/dependents-repo/jaggedsoft/node-binance-api?labelColor=blue\u0026color=purple\u0026label=Used%20by\u0026icon=github\n🧪 Releases 87 https://badgen.net/github/releases/jaggedsoft/node-binance-api?scale=2\u0026icon=github\u0026labelColor=purple\u0026color=green\u0026label=%F0%9F%A7%AA%20Release\n🎈💡 Merged PRs 79 https://badgen.net/github/merged-prs/jaggedsoft/node-binance-api\n⭐ Stars 630 https://badgen.net/github/stars/jaggedsoft/node-binance-api?scale=2\u0026label=%E2%AD%90Stars\u0026labelColor=black\u0026color=purple\n✅ship Commits 568 https://badgen.net/github/commits/micromatch/micromatch?label=%E2%9C%A8Commits\u0026labelColor=black\u0026color=red\n⚡ Updated about 16 hours ago https://badgen.net/github/last-commit/jaggedsoft/node-binance-api?scale=2\u0026icon=bitcoin-lightning\u0026label=Updated\u0026labelColor=black\u0026color=448AFF\n👀👁 Watchers 48 https://badgen.net/github/watchers/jaggedsoft/node-binance-api\ncolor=blueviolet 🔵q\n--\u003e\n\u003c!-- [![Latest Version](https://img.shields.io/github/release/jaggedsoft/node-binance-api.svg?style=flat-square\u0026labelColor=blueviolet\u0026label=release)](https://github.com/jaggedsoft/node-binance-api/releases) [![GitHub last commit](https://img.shields.io/github/last-commit/jaggedsoft/node-binance-api.svg?maxAge=2400\u0026labelColor=333\u0026label=🟣%20updated)](#) [![Monthly Downloads](https://img.shields.io/npm/dm/node-binance-api.svg?labelColor=29B6F6\u0026color=3D5AFE\u0026label=downloads\u0026logo=bitcoin-lightning)](https://npm-stat.com/charts.html?package=node-binance-api\u0026from=2017-07-01\u0026to=2020-07-01)  --\u003e\n\n\n\n# Node Binance API\n\n[![telegram](https://patrolavia.github.io/telegram-badge/chat.png)](https://t.me/nodebinanceapi) [![Yearly Downloads](https://img.shields.io/npm/dy/node-binance-api.svg)](https://www.npmjs.com/package/node-binance-api)  [![jaggedsoft on X](https://img.shields.io/twitter/follow/jaggedsoft.svg?style=social)](https://x.com/jaggedsoft)\n\nThis project is designed to help you make your own projects that interact with the [Binance API](https://github.com/binance-exchange/binance-official-api-docs). You can stream candlestick chart data, market depth, or use other advanced features such as setting stop losses and iceberg orders. This project seeks to have complete API coverage including WebSockets.\n\n\n\n\u003cb\u003e\u003cp align=\"center\"\u003e\n  \u003ca href=\"#binance-futures-api\" style=\"color:#f9c513\"\u003eFutures API\u003c/a\u003e \u0026amp;\n  \u003ca href=\"#futures-websocket-streams\" style=\"color:#f9c513\"\u003eStreams\u003c/a\u003e •\n  \u003ca href=\"#binance-api-spot-trading\" style=\"color:#282828\"\u003eSpot Trading API\u003c/a\u003e \u0026amp;\n  \u003ca href=\"#websockets-implementation\" style=\"color:#282828\"\u003eStreams\u003c/a\u003e •\n  \u003ca href=\"#binance-margin-api\"\u003eMargin API\u003c/a\u003e •\n  \u003ca href=\"#binance-lending-api\"\u003eLending API\u003c/a\u003e\u003cbr/\u003e\n  \u003ca href=\"https://github.com/jaggedsoft/node-binance-api/tree/master/examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#troubleshooting\"\u003eTroubleshooting\u003c/a\u003e •\n  \u003ca href=\"https://github.com/jaggedsoft/node-binance-api/releases\"\u003eChangelog\u003c/a\u003e •\n  \u003ca href=\"https://t.me/binance_api_english\"\u003eSupport\u003c/a\u003e\n\u003c/p\u003e\u003c/b\u003e\n\n#### Installation\n\n```\nnpm install node-binance-api\n```\n[![NPM](https://nodei.co/npm/node-binance-api.png?compact=true)](https://npmjs.org/package/node-binance-api)\n\u003c!-- [![npm install node-binance-api](https://nodei.co/npm/node-binance-api.png?mini=true)](https://npmjs.org/package/node-binance-api) --\u003e\n\n#### Community Telegram Chat\n\nhttps://t.me/nodebinanceapi\n\n\n**This project is powered by** \u003ca href=\"https://github.com/ccxt/ccxt\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/31901609\" width=4% height=4%\u003e\u003c/a\u003e\n\nActively maintained, typed, and safe SDK for the Binance REST APIs and Websockets. Supports ESM and CJS out of the box.\n\n### Features\n- Spot, Margin, Futures and Delivery API\n- Testnet support\n- Proxy support (REST and WS)\n- Customizable HTTP headers\n- Customizable request parameters\n- RSA/ECDSA support\n- Portfolio Margin API *\\*soon*\\*\n- Websocket handling with automatic reconnection\n- RecvWindow and automatic timestamps generation\n- Ability to call any endpoint, even if not supported directly by the library\n- Overridable hostnames (.us, .jp, etc)\n- Verbose mode to debug http requests/responses\n\n### Upgrading to v1.0.0+\n\n**We highly advise you to update from 0.0.X but minor adjustments might be needed.**\n\nThe library was fully refactored to use a modern and typed JavaScript/Typescript version, using the built-in await/async syntax and unifying some methods' signatures.\nSome important changes include the removal of callbacks as parameters of REST methods, adaptation of signatures to directly receive some important request values (symbol, orderId, ...), among others.\n\n\n#### Getting started (ESM)\n```javascript\nimport Binance from 'node-binance-api';\nasync function run() {\n    const exchange = new Binance();\n    const res = await exchange.futuresTime();\n    console.log( res );\n}\n```\n\n#### Getting started (CJS)\n```javascript\nconst Binance = require('node-binance-api');\nconst binance = new Binance({\n  APIKEY: '\u003ckey\u003e',\n  APISECRET: '\u003csecret\u003e',\n  test: true, // if you want to use the sandbox/testnet\n});\n```\n\n# Binance Futures API\n\n#### Futures Prices\n```js\nconsole.info( await binance.futuresPrices() );\n```\n\n#### Futures Account Balances \u0026 Positions\n```js\nconsole.info( await binance.futuresAccount() );\n```\n\n#### Futures Balances\n```js\nconsole.info( await binance.futuresBalance() );\n```\n\n#### Futures Limit Buy\n```js\nconsole.info( await binance.futuresBuy( 'LIMIT', 'BTCUSDT', 0.1, 8222 ) );\n```\n\n#### Futures Limit Sell\n```js\nconsole.info( await binance.futuresSell( 'LIMIT', 'BTCUSDT', 0.5, 11111 ) );\n```\n\n#### Futures Market Buy\n```js\nconsole.info( await binance.futuresMarketBuy( 'BNBUSDT', 5 ) );\n```\n\n#### Futures Market Sell\n```js\nconsole.info( await binance.futuresMarketSell( 'TRXUSDT', 1 ) );\n```\n\n#### Futures Place Multiple Orders\n```js\nlet orders = [\n  {\n  symbol:\"BTCUSDT\",\n  side: \"BUY\",\n  type: \"MARKET\",\n  quantity: \"0.01\",\n  },\n  {\n  symbol:\"BNBUSDT\",\n  side: \"SELL\",\n  type: \"MARKET\",\n  quantity: \"0.5\",\n  }\n]\nconsole.info( await binance.futuresMultipleOrders(orders) );\n```\n\n#### Futures Market Orders: Get the fill price using newOrderRespType\n```js\nconsole.info( await binance.futuresMarketBuy( 'BNBUSDT', amount, { newOrderRespType: 'RESULT' } ) );\n```\n\n#### Futures reduceOnly Order Example\n```js\nif ( side == 'LONG' ) order = await binance.futuresMarketSell( obj.symbol, amount, {reduceOnly: true} )\nelse order = await binance.futuresMarketBuy( obj.symbol, amount, {reduceOnly: true} )\n```\n\n#### Get Futures Positions\n```js\nconsole.info( await binance.futuresPositionRisk() );\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Example\u003c/summary\u003e\n\n```js\nlet position_data = await binance.futuresPositionRisk(), markets = Object.keys( position_data );\nfor ( let market of markets ) {\n  let obj = position_data[market], size = Number( obj.positionAmt );\n  if ( size == 0 ) continue;\n  console.info( `${leverage}x\\t${market}\\t${obj.unRealizedProfit}` );\n  //console.info( obj ); //positionAmt entryPrice markPrice unRealizedProfit liquidationPrice leverage marginType isolatedMargin isAutoAddMargin maxNotionalValue\n}\n```\n\u003c/details\u003e\n\n#### Adjust Leverage (1-125x)\n```js\nconsole.info( await binance.futuresLeverage( 'ETHUSDT', 50 ) );\n```\n\n#### Adjust Margin Type (ISOLATED, CROSSED)\n```js\nconsole.info( await binance.futuresMarginType( 'BTCUSDT', 'ISOLATED' ) );\n```\n\n#### Adjust Position Margin\n```js\n// Type: 1: Add postion margin，2: Reduce postion margin\nconsole.info( await binance.futuresPositionMargin( \"TRXUSDT\", amount, type ) );\n```\n\n```js\nconsole.info( await binance.futuresTime() );\nconsole.info( await binance.futuresExchangeInfo() );\nconsole.info( await binance.futuresCandles( \"TRXUSDT\", \"1m\" ) );\nconsole.info( await binance.futuresDepth( \"ADAUSDT\" ) );\nconsole.info( await binance.futuresQuote() );\nconsole.info( await binance.futuresQuote( \"BCHUSDT\" ) );\nconsole.info( await binance.futuresDaily() );\nconsole.info( await binance.futuresOpenInterest( \"BTCUSDT\" ) );\nconsole.info( await binance.futuresMarkPrice() );\nconsole.info( await binance.futuresMarkPrice( \"ETHUSDT\" ) );\nconsole.info( await binance.futuresTrades( \"LTCUSDT\" ) );\nconsole.info( await binance.futuresAggTrades( \"XTZUSDT\" ) );\nconsole.info( await binance.futuresLiquidationOrders() );\nconsole.info( await binance.futuresFundingRate() );\nconsole.info( await binance.futuresHistoricalTrades( \"XMRUSDT\" ) );\nconsole.info( await binance.futuresLeverageBracket( \"LINKUSDT\" ) );\nconsole.info( await binance.futuresIncome() );\nconsole.info( await binance.futuresCancelAll( \"BTCUSDT\" ) );\nconsole.info( await binance.futuresCancel( \"BTCUSDT\", \"1025137386\" ) );\nconsole.info( await binance.futuresCountdownCancelAll( \"BTCUSDT\", 45000 ) );\nconsole.info( await binance.futuresOrderStatus( \"BTCUSDT\", \"1025137386\") );\nconsole.info( await binance.futuresOpenOrders() );\nconsole.info( await binance.futuresOpenOrders( \"BTCUSDT\" ) );\nconsole.info( await binance.futuresAllOrders() );\nconsole.info( await binance.futuresAllOrders( \"BTCUSDT\" ) );\nconsole.info( await binance.futuresUserTrades( \"BTCUSDT\" ) );\nconsole.info( await binance.futuresGetDataStream() );\nconsole.info( await binance.futuresPositionMarginHistory( \"TRXUSDT\" ) );\nconsole.info( await binance.futuresPublicRequest( 'v1/time' ) );\nconsole.info( await binance.spotPublicRequest( 'v1/time')); // call any method by providing the path\nconsole.info( await binance.privateFuturesRequest('v3/account')); // custom futures private call\n// Batch orders, remaining WebSocket streams, and better documentation will be come later\n```\n\n### Proxy support\n\nIn some specific cases using a proxy is required, for example:\n- Exchange is not available in your location\n- You need to make a large amount of requests without getting blocked\n- ...\n\nThis package supports the following proxy types, `httpsProxy`, `proxyUrl` and `socksProxy`\n\n#### httpsProxy\n\nTo set a real http(s) proxy for your scripts, you need to have an access to a remote http or https proxy, so calls will be made directly to the target exchange, tunneled through your proxy server:\n\n```Js\nclient.httpsProxy = 'http://1.2.3.4:8080/';\n```\n\n#### proxyUrl\n\nThis property prepends an url to API requests. It might be useful for simple redirection or bypassing CORS browser restriction.\n\n```Js\nclient.proxyUrl = 'YOUR_PROXY_URL';\n```\n\n#### socksProxy\n\nTou can also use socks proxy with the following format:\n\n```Js\nclient.socksProxy = 'socks5://1.2.3.4:8080/';\n```\n\n#### Futures Historical Bulk Data Download API\n\n##### Get Download ID\n\n```js\nconsole.info( await binance.futuresHistDataId(\n  \"BTCUSDT\", {\n    startTime: new Date().getTime() - 24 * 60 * 60 * 1000,\n    endTime: new Date().getTime(),\n    dataType: 'T_TRADE'\n  } )\n)\n```\n\n##### Get Download Link\n\n```js\nconsole.info( await binance.futuresDownloadLink(7343) )\n```\n\n# Futures WebSocket Streams\n\n#### Futures miniTicker stream for all symbols\n```js\nbinance.futuresMiniTickerStream( miniTicker =\u003e {\n    console.info( miniTicker );\n} );\n```\n#### Futures miniTicker stream for a symbol\n```js\nbinance.futuresMiniTickerStream( 'BTCUSDT', console.log );\n```\n#### Futures bookTicker stream for all symbols\n```js\nbinance.futuresBookTickerStream( console.log );\n```\n#### Futures bookTicker stream for a symbol\n```js\nbinance.futuresBookTickerStream( 'BTCUSDT', console.log );\n```\n#### Futures prevDay ticker stream for all symbols\n```js\nbinance.futuresTickerStream( console.log );\n```\n#### Futures prevDay ticker stream for a symbol\n```js\nbinance.futuresTickerStream( 'BTCUSDT', console.log );\n```\n#### Futures mark price stream for all symbols\n```js\nbinance.futuresMarkPriceStream( console.log );\n```\n#### Futures mark price stream for a symbol\n```js\nbinance.futuresMarkPriceStream( 'BTCUSDT', console.log );\n```\n#### Futures aggregate trade stream for a symbol\n```js\nbinance.futuresAggTradeStream( 'BTCUSDT', console.log );\n```\n#### Futures complete chart cache\n```js\nbinance.futuresChart( 'BTCUSDT', '1m', console.log );\n```\n#### Futures Liquidation Stream for all symbols\n```js\nbinance.futuresLiquidationStream( console.log );\n```\n#### Futures Liquidation Stream for a symbol\n```js\nbinance.futuresLiquidationStream( 'BTCUSDT', console.log );\n```\n#### Connect to a custom endpoint. Easier shortcut functions will come later\n```js\nbinance.futuresSubscribe( 'btcusdt@kline_4h', console.log );\n```\n#### Terminate an existing socket\n```js\nbinance.futuresTerminate( 'btcusdt@kline_4h' );\n```\n#### Return active sockets and subscriptions\n```js\nconsole.log( binance.futuresSubscriptions() );\n```\n\n\n\n# Delivery API (Futures w/Expiration Date)\n```\ndeliveryBuy\ndeliverySell\ndeliveryMarketBuy\ndeliveryMarketSell\ndeliveryPrices\ndeliveryDaily\ndeliveryOpenInterest\ndeliveryExchangeInfo\ndeliveryOpenOrders\ndeliveryAllOrders\ndeliveryCandles\ndeliveryIndexKlines\ndeliveryContinuousKlines\ndeliveryMarkPriceKlines\ndeliveryMarkPrice\ndeliveryHistoricalTrades\ndeliveryTrades\ndeliveryAggTrades\ndeliveryUserTrades\ndeliveryLiquidationOrders\ndeliveryPositionRisk\ndeliveryLeverage\ndeliveryMarginType\ndeliveryPositionMargin\ndeliveryPositionMarginHistory\ndeliveryIncome\ndeliveryBalance\ndeliveryAccount\ndeliveryDepth\ndeliveryQuote\ndeliveryLeverageBracket\ndeliveryOrderStatus\ndeliveryCancel\ndeliveryCancelAll\ndeliveryCountdownCancelAll\ndeliveryOrder\ndeliveryGetDataStream\ndeliveryCloseDataStream\ndeliveryKeepDataStream\ndeliveryPing\ndeliveryTime\ndeliveryOrder\n```\n\n# Binance API (Spot Trading)\n\n#### Getting latest price of all symbols\n```javascript\nlet ticker = await binance.prices();\nconsole.info(`Price of BNB: ${ticker.BNBUSDT}`);\n```\n\n#### Getting latest price of a symbol\n```js\nbinance.prices('BNBBTC', (error, ticker) =\u003e {\n  console.info(\"Price of BNB: \", ticker.BNBBTC);\n});\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n{ ETHBTC: '0.07003500',\n  LTCBTC: '0.01176700',\n  BNBBTC: '0.00035735',\n  NEOBTC: '0.00809500',\n  QTUMETH: '0.03851200',\n  EOSETH: '0.00189600',\n  SNTETH: '0.00008595',\n  BNTETH: '0.00738800',\n  BCCBTC: '0.08104000',\n  GASBTC: '0.00629800',\n  BNBETH: '0.00509495',\n  BTMETH: '0.00018900',\n  HCCBTC: '0.00000180',\n  BTCUSDT: '4464.44000000',\n  ETHUSDT: '312.89000000',\n  HSRBTC: '0.00289000',\n  OAXETH: '0.00180000',\n  DNTETH: '0.00014190',\n  MCOETH: '0.02358300',\n  ICNETH: '0.00557000',\n  ELCBTC: '0.00000053',\n  MCOBTC: '0.00166900',\n  WTCBTC: '0.00184138',\n  WTCETH: '0.02601700',\n  LLTBTC: '0.00001669',\n  LRCBTC: '0.00001100',\n  LRCETH: '0.00016311',\n  QTUMBTC: '0.00271600',\n  YOYOBTC: '0.00000481',\n  OMGBTC: '0.00187800',\n  OMGETH: '0.02677400',\n  ZRXBTC: '0.00004319',\n  ZRXETH: '0.00060800',\n  STRATBTC: '0.00087800',\n  STRATETH: '0.01218800',\n  SNGLSBTC: '0.00003649',\n  SNGLSETH: '0.00051280',\n  BQXBTC: '0.00013150',\n  BQXETH: '0.00184240',\n  KNCBTC: '0.00038969',\n  KNCETH: '0.00550320',\n  FUNBTC: '0.00000573',\n  FUNETH: '0.00008433',\n  SNMBTC: '0.00003176',\n  SNMETH: '0.00047119',\n  NEOETH: '0.11500200',\n  IOTABTC: '0.00012136',\n  IOTAETH: '0.00171001',\n  LINKBTC: '0.00010646',\n  LINKETH: '0.00150999',\n  XVGBTC: '0.00000145',\n  XVGETH: '0.00002059',\n  CTRBTC: '0.00025532',\n  CTRETH: '0.00375180',\n  SALTBTC: '0.00080100',\n  SALTETH: '0.01140000',\n  MDABTC: '0.00057002',\n  MDAETH: '0.00819490' }\n//Price of BNB: 0.00035735\n```\n\u003c/details\u003e\n\n\n#### Getting list of current balances\n```javascript\nbinance.balance((error, balances) =\u003e {\n  if ( error ) return console.error(error);\n  console.info(\"balances()\", balances);\n  console.info(\"ETH balance: \", balances.ETH.available);\n});\n// If you have problems with this function,\n// see Troubleshooting at the bottom of this page.\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n{ BTC: { available: '0.77206464', onOrder: '0.00177975' },\n  LTC: { available: '0.00000000', onOrder: '0.00000000' },\n  ETH: { available: '1.14109900', onOrder: '0.00000000' },\n  BNC: { available: '0.00000000', onOrder: '0.00000000' },\n  ICO: { available: '0.00000000', onOrder: '0.00000000' },\n  NEO: { available: '0.00000000', onOrder: '0.00000000' },\n  BNB: { available: '41.33761879', onOrder: '0.00000000' },\n  QTUM: { available: '0.00000000', onOrder: '0.00000000' },\n  EOS: { available: '0.00000000', onOrder: '0.00000000' },\n  SNT: { available: '0.00000000', onOrder: '0.00000000' },\n  BNT: { available: '0.00000000', onOrder: '0.00000000' },\n  GAS: { available: '0.00000000', onOrder: '0.00000000' },\n  BCC: { available: '0.00000000', onOrder: '0.00000000' },\n  BTM: { available: '0.00000000', onOrder: '0.00000000' },\n  USDT: { available: '0.00000000', onOrder: '0.00000000' },\n  HCC: { available: '0.00000000', onOrder: '0.00000000' },\n  HSR: { available: '0.00000000', onOrder: '0.00000000' },\n  OAX: { available: '0.00000000', onOrder: '0.00000000' },\n  DNT: { available: '0.00000000', onOrder: '0.00000000' },\n  MCO: { available: '0.00000000', onOrder: '0.00000000' },\n  ICN: { available: '0.00000000', onOrder: '0.00000000' },\n  ELC: { available: '0.00000000', onOrder: '0.00000000' },\n  PAY: { available: '0.00000000', onOrder: '0.00000000' },\n  ZRX: { available: '0.00000000', onOrder: '0.00000000' },\n  OMG: { available: '0.00000000', onOrder: '0.00000000' },\n  WTC: { available: '0.00000000', onOrder: '0.00000000' },\n  LRX: { available: '0.00000000', onOrder: '0.00000000' },\n  YOYO: { available: '0.00000000', onOrder: '0.00000000' },\n  LRC: { available: '0.00000000', onOrder: '0.00000000' },\n  LLT: { available: '0.00000000', onOrder: '0.00000000' },\n  TRX: { available: '0.00000000', onOrder: '0.00000000' },\n  FID: { available: '0.00000000', onOrder: '0.00000000' },\n  SNGLS: { available: '0.00000000', onOrder: '0.00000000' },\n  STRAT: { available: '0.00000000', onOrder: '0.00000000' },\n  BQX: { available: '0.00000000', onOrder: '0.00000000' },\n  FUN: { available: '0.00000000', onOrder: '0.00000000' },\n  KNC: { available: '0.00000000', onOrder: '0.00000000' },\n  CDT: { available: '0.00000000', onOrder: '0.00000000' },\n  XVG: { available: '0.00000000', onOrder: '0.00000000' },\n  IOTA: { available: '0.00000000', onOrder: '0.00000000' },\n  SNM: { available: '0.76352833', onOrder: '0.00000000' },\n  LINK: { available: '0.00000000', onOrder: '0.00000000' },\n  CVC: { available: '0.00000000', onOrder: '0.00000000' },\n  TNT: { available: '0.00000000', onOrder: '0.00000000' },\n  REP: { available: '0.00000000', onOrder: '0.00000000' },\n  CTR: { available: '0.00000000', onOrder: '0.00000000' },\n  MDA: { available: '0.00000000', onOrder: '0.00000000' },\n  MTL: { available: '0.00000000', onOrder: '0.00000000' },\n  SALT: { available: '0.00000000', onOrder: '0.00000000' },\n  NULS: { available: '0.00000000', onOrder: '0.00000000' } }\n//ETH balance:  1.14109900\n```\n\u003c/details\u003e\n\n#### Getting bid/ask prices for a symbol\n```js\nbinance.bookTickers('BNBBTC', (error, ticker) =\u003e {\n  console.info(\"bookTickers\", ticker);\n});\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"symbol\": \"BNBBTC\",\n  \"bidPrice\": \"4.00000000\",\n  \"bidQty\": \"431.00000000\",\n  \"askPrice\": \"4.00000200\",\n  \"askQty\": \"9.00000000\"\n}\n\n// from: https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md#symbol-order-book-ticker\n```\n\u003c/details\u003e\n\n#### Getting bid/ask prices for all symbols\n```js\nbinance.bookTickers((error, ticker) =\u003e {\n  console.info(\"bookTickers()\", ticker);\n  console.info(\"Price of BNB: \", ticker.BNBBTC);\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n { ETHBTC:\n   { bid: '0.06201000',\n     bids: '1.28200000',\n     ask: '0.06201300',\n     asks: '0.34200000' },\n  LTCBTC:\n   { bid: '0.01042000',\n     bids: '41.45000000',\n     ask: '0.01048700',\n     asks: '16.81000000' },\n  BNBBTC:\n   { bid: '0.00028754',\n     bids: '727.00000000',\n     ask: '0.00028755',\n     asks: '400.00000000' },\n  NEOBTC:\n   { bid: '0.00601800',\n     bids: '16.82000000',\n     ask: '0.00603700',\n     asks: '73.43000000' },\n  QTUMETH:\n   { bid: '0.04062900',\n     bids: '1.30000000',\n     ask: '0.04075300',\n     asks: '0.58000000' },\n  EOSETH:\n   { bid: '0.00191400',\n     bids: '202.53000000',\n     ask: '0.00192500',\n     asks: '26.08000000' },\n  SNTETH:\n   { bid: '0.00007610',\n     bids: '403.00000000',\n     ask: '0.00007638',\n     asks: '19850.00000000' },\n  BNTETH:\n   { bid: '0.00736800',\n     bids: '7.82000000',\n     ask: '0.00745900',\n     asks: '177.32000000' },\n  BCCBTC:\n   { bid: '0.06862000',\n     bids: '1.56100000',\n     ask: '0.06893600',\n     asks: '0.81100000' },\n  GASBTC:\n   { bid: '0.00451700',\n     bids: '44.00000000',\n     ask: '0.00489700',\n     asks: '44.95000000' },\n  BNBETH:\n   { bid: '0.00462592',\n     bids: '32.00000000',\n     ask: '0.00467982',\n     asks: '57.00000000' },\n  BTMETH:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  HCCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  BTCUSDT:\n   { bid: '4786.01000000',\n     bids: '0.58627700',\n     ask: '4796.10000000',\n     asks: '0.28486400' },\n  ETHUSDT:\n   { bid: '297.01000000',\n     bids: '7.17846000',\n     ask: '297.90000000',\n     asks: '0.30742000' },\n  HSRBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  OAXETH:\n   { bid: '0.00156200',\n     bids: '96.00000000',\n     ask: '0.00169900',\n     asks: '552.90000000' },\n  DNTETH:\n   { bid: '0.00011782',\n     bids: '1273.00000000',\n     ask: '0.00012045',\n     asks: '238.00000000' },\n  MCOETH:\n   { bid: '0.02651200',\n     bids: '0.94000000',\n     ask: '0.02681200',\n     asks: '8.59000000' },\n  ICNETH:\n   { bid: '0.00484600',\n     bids: '448.76000000',\n     ask: '0.00490000',\n     asks: '0.01000000' },\n  ELCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  MCOBTC:\n   { bid: '0.00164600',\n     bids: '1.00000000',\n     ask: '0.00164700',\n     asks: '12.11000000' },\n  WTCBTC:\n   { bid: '0.00132101',\n     bids: '124.00000000',\n     ask: '0.00133200',\n     asks: '98.00000000' },\n  WTCETH:\n   { bid: '0.02130000',\n     bids: '784.35000000',\n     ask: '0.02140800',\n     asks: '10.70000000' },\n  LLTBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  LRCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  LRCETH:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  QTUMBTC:\n   { bid: '0.00252800',\n     bids: '123.48000000',\n     ask: '0.00253200',\n     asks: '10.50000000' },\n  YOYOBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  OMGBTC:\n   { bid: '0.00164900',\n     bids: '25.94000000',\n     ask: '0.00166400',\n     asks: '0.90000000' },\n  OMGETH:\n   { bid: '0.02660000',\n     bids: '9.86000000',\n     ask: '0.02698200',\n     asks: '43.21000000' },\n  ZRXBTC:\n   { bid: '0.00003936',\n     bids: '117.00000000',\n     ask: '0.00003982',\n     asks: '8596.00000000' },\n  ZRXETH:\n   { bid: '0.00062801',\n     bids: '239.00000000',\n     ask: '0.00063595',\n     asks: '2446.00000000' },\n  STRATBTC:\n   { bid: '0.00070600',\n     bids: '43.43000000',\n     ask: '0.00070900',\n     asks: '15.00000000' },\n  STRATETH:\n   { bid: '0.01092100',\n     bids: '9.00000000',\n     ask: '0.01162700',\n     asks: '47.90000000' },\n  SNGLSBTC:\n   { bid: '0.00003162',\n     bids: '366.00000000',\n     ask: '0.00003183',\n     asks: '308.00000000' },\n  SNGLSETH:\n   { bid: '0.00050064',\n     bids: '300.00000000',\n     ask: '0.00051543',\n     asks: '64.00000000' },\n  BQXBTC:\n   { bid: '0.00013334',\n     bids: '13.00000000',\n     ask: '0.00013889',\n     asks: '1224.00000000' },\n  BQXETH:\n   { bid: '0.00200740',\n     bids: '990.00000000',\n     ask: '0.00228890',\n     asks: '80.00000000' },\n  KNCBTC:\n   { bid: '0.00029509',\n     bids: '300.00000000',\n     ask: '0.00029842',\n     asks: '4.00000000' },\n  KNCETH:\n   { bid: '0.00481840',\n     bids: '411.00000000',\n     ask: '0.00484440',\n     asks: '10.00000000' },\n  FUNBTC:\n   { bid: '0.00000461',\n     bids: '217.00000000',\n     ask: '0.00000465',\n     asks: '16668.00000000' },\n  FUNETH:\n   { bid: '0.00007486',\n     bids: '2004.00000000',\n     ask: '0.00007617',\n     asks: '1419.00000000' },\n  SNMBTC:\n   { bid: '0.00002462',\n     bids: '6922.00000000',\n     ask: '0.00002495',\n     asks: '404.00000000' },\n  SNMETH:\n   { bid: '0.00040181',\n     bids: '373.00000000',\n     ask: '0.00043404',\n     asks: '9281.00000000' },\n  NEOETH:\n   { bid: '0.09610400',\n     bids: '8.02000000',\n     ask: '0.09891100',\n     asks: '5.00000000' },\n  IOTABTC:\n   { bid: '0.00009674',\n     bids: '206.00000000',\n     ask: '0.00009721',\n     asks: '269.00000000' },\n  IOTAETH:\n   { bid: '0.00155061',\n     bids: '1231.00000000',\n     ask: '0.00158100',\n     asks: '22.00000000' },\n  LINKBTC:\n   { bid: '0.00007670',\n     bids: '2278.00000000',\n     ask: '0.00007697',\n     asks: '8000.00000000' },\n  LINKETH:\n   { bid: '0.00123000',\n     bids: '3492.00000000',\n     ask: '0.00123999',\n     asks: '4000.00000000' },\n  XVGBTC:\n   { bid: '0.00000111',\n     bids: '47758.00000000',\n     ask: '0.00000113',\n     asks: '215443.00000000' },\n  XVGETH:\n   { bid: '0.00001801',\n     bids: '8329.00000000',\n     ask: '0.00001842',\n     asks: '85146.00000000' },\n  CTRBTC:\n   { bid: '0.00019801',\n     bids: '650.00000000',\n     ask: '0.00021103',\n     asks: '49.00000000' },\n  CTRETH:\n   { bid: '0.00320200',\n     bids: '538.00000000',\n     ask: '0.00351990',\n     asks: '2081.00000000' },\n  SALTBTC:\n   { bid: '0.00063900',\n     bids: '57.13000000',\n     ask: '0.00064000',\n     asks: '96.48000000' },\n  SALTETH:\n   { bid: '0.01030200',\n     bids: '728.27000000',\n     ask: '0.01038900',\n     asks: '0.04000000' },\n  MDABTC:\n   { bid: '0.00039031',\n     bids: '282.00000000',\n     ask: '0.00039994',\n     asks: '540.00000000' },\n  MDAETH:\n   { bid: '0.00635500',\n     bids: '432.00000000',\n     ask: '0.00641990',\n     asks: '185.00000000' },\n  MTLBTC:\n   { bid: '0.00145500',\n     bids: '45.00000000',\n     ask: '0.00145600',\n     asks: '42.12000000' },\n  MTLETH:\n   { bid: '0.02300100',\n     bids: '96.10000000',\n     ask: '0.02477400',\n     asks: '131.90000000' },\n  SUBBTC:\n   { bid: '0.00003250',\n     bids: '4474.00000000',\n     ask: '0.00003380',\n     asks: '3878.00000000' },\n  SUBETH:\n   { bid: '0.00053000',\n     bids: '740.00000000',\n     ask: '0.00053501',\n     asks: '580.00000000' } }\n/* Price of BNB:  { bid: '0.00028754',\n  bids: '727.00000000',\n  ask: '0.00028755',\n  asks: '400.00000000' } */\n```\n\u003c/details\u003e\n\n#### Get all bid/ask prices\n```javascript\nbinance.bookTickers((error, ticker) =\u003e {\n  console.info(\"bookTickers\", ticker);\n});\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n{ ETHBTC:\n   { bid: '0.06187700',\n     bids: '0.64000000',\n     ask: '0.06188300',\n     asks: '6.79700000' },\n  LTCBTC:\n   { bid: '0.01036000',\n     bids: '14.96000000',\n     ask: '0.01037000',\n     asks: '0.60000000' },\n  BNBBTC:\n   { bid: '0.00028226',\n     bids: '802.00000000',\n     ask: '0.00028268',\n     asks: '584.00000000' },\n  NEOBTC:\n   { bid: '0.00595600',\n     bids: '33.00000000',\n     ask: '0.00595900',\n     asks: '37.00000000' },\n  QTUMETH:\n   { bid: '0.03958000',\n     bids: '1.42000000',\n     ask: '0.04024300',\n     asks: '7.46000000' },\n  EOSETH:\n   { bid: '0.00192600',\n     bids: '29.31000000',\n     ask: '0.00193500',\n     asks: '418.91000000' },\n  SNTETH:\n   { bid: '0.00007607',\n     bids: '8864.00000000',\n     ask: '0.00007682',\n     asks: '1311.00000000' },\n  BNTETH:\n   { bid: '0.00740200',\n     bids: '1.36000000',\n     ask: '0.00746800',\n     asks: '419.86000000' },\n  BCCBTC:\n   { bid: '0.06786500',\n     bids: '0.18600000',\n     ask: '0.06835400',\n     asks: '0.72600000' },\n  GASBTC:\n   { bid: '0.00435500',\n     bids: '332.73000000',\n     ask: '0.00435600',\n     asks: '18.31000000' },\n  BNBETH:\n   { bid: '0.00456443',\n     bids: '4.00000000',\n     ask: '0.00461795',\n     asks: '192.00000000' },\n  BTMETH:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  HCCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  BTCUSDT:\n   { bid: '4801.05000000',\n     bids: '0.82289400',\n     ask: '4812.00000000',\n     asks: '1.04753200' },\n  ETHUSDT:\n   { bid: '296.32000000',\n     bids: '3.24294000',\n     ask: '297.81000000',\n     asks: '17.69901000' },\n  HSRBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  OAXETH:\n   { bid: '0.00154500',\n     bids: '422.64000000',\n     ask: '0.00169200',\n     asks: '159.94000000' },\n  DNTETH:\n   { bid: '0.00012059',\n     bids: '434.00000000',\n     ask: '0.00012100',\n     asks: '8311.00000000' },\n  MCOETH:\n   { bid: '0.02566000',\n     bids: '5.85000000',\n     ask: '0.02651200',\n     asks: '4.37000000' },\n  ICNETH:\n   { bid: '0.00489000',\n     bids: '232.97000000',\n     ask: '0.00500000',\n     asks: '0.01000000' },\n  ELCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  MCOBTC:\n   { bid: '0.00162700',\n     bids: '2.87000000',\n     ask: '0.00163800',\n     asks: '0.70000000' },\n  WTCBTC:\n   { bid: '0.00129604',\n     bids: '600.00000000',\n     ask: '0.00131600',\n     asks: '1.00000000' },\n  WTCETH:\n   { bid: '0.02080000',\n     bids: '30.00000000',\n     ask: '0.02097600',\n     asks: '24.00000000' },\n  LLTBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  LRCBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  LRCETH:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  QTUMBTC:\n   { bid: '0.00245100',\n     bids: '43.11000000',\n     ask: '0.00248500',\n     asks: '74.96000000' },\n  YOYOBTC:\n   { bid: '0.00000000',\n     bids: '0.00000000',\n     ask: '0.00000000',\n     asks: '0.00000000' },\n  OMGBTC:\n   { bid: '0.00160700',\n     bids: '300.00000000',\n     ask: '0.00161300',\n     asks: '36.05000000' },\n  OMGETH:\n   { bid: '0.02597100',\n     bids: '4.92000000',\n     ask: '0.02633200',\n     asks: '19.00000000' },\n  ZRXBTC:\n   { bid: '0.00003852',\n     bids: '9.00000000',\n     ask: '0.00003912',\n     asks: '103.00000000' },\n  ZRXETH:\n   { bid: '0.00062997',\n     bids: '645.00000000',\n     ask: '0.00062998',\n     asks: '5376.00000000' },\n  STRATBTC:\n   { bid: '0.00069200',\n     bids: '50.50000000',\n     ask: '0.00070000',\n     asks: '6.54000000' },\n  STRATETH:\n   { bid: '0.01080400',\n     bids: '5.00000000',\n     ask: '0.01200000',\n     asks: '5.88000000' },\n  SNGLSBTC:\n   { bid: '0.00003121',\n     bids: '726.00000000',\n     ask: '0.00003161',\n     asks: '153.00000000' },\n  SNGLSETH:\n   { bid: '0.00046686',\n     bids: '4782.00000000',\n     ask: '0.00051906',\n     asks: '32.00000000' },\n  BQXBTC:\n   { bid: '0.00011512',\n     bids: '87.00000000',\n     ask: '0.00011840',\n     asks: '133.00000000' },\n  BQXETH:\n   { bid: '0.00183080',\n     bids: '1051.00000000',\n     ask: '0.00195000',\n     asks: '626.00000000' },\n  KNCBTC:\n   { bid: '0.00027859',\n     bids: '7.00000000',\n     ask: '0.00028462',\n     asks: '35.00000000' },\n  KNCETH:\n   { bid: '0.00452830',\n     bids: '13.00000000',\n     ask: '0.00454970',\n     asks: '35.00000000' },\n  FUNBTC:\n   { bid: '0.00000464',\n     bids: '753.00000000',\n     ask: '0.00000465',\n     asks: '13924.00000000' },\n  FUNETH:\n   { bid: '0.00007126',\n     bids: '44131.00000000',\n     ask: '0.00007617',\n     asks: '1419.00000000' },\n  SNMBTC:\n   { bid: '0.00002489',\n     bids: '564.00000000',\n     ask: '0.00002559',\n     asks: '2553.00000000' },\n  SNMETH:\n   { bid: '0.00040060',\n     bids: '374.00000000',\n     ask: '0.00041494',\n     asks: '7624.00000000' },\n  NEOETH:\n   { bid: '0.09604700',\n     bids: '22.05000000',\n     ask: '0.09800000',\n     asks: '0.31000000' },\n  IOTABTC:\n   { bid: '0.00009515',\n     bids: '3.00000000',\n     ask: '0.00009529',\n     asks: '147.00000000' },\n  IOTAETH:\n   { bid: '0.00150002',\n     bids: '4311.00000000',\n     ask: '0.00155216',\n     asks: '7.00000000' },\n  LINKBTC:\n   { bid: '0.00007601',\n     bids: '4337.00000000',\n     ask: '0.00007630',\n     asks: '525.00000000' },\n  LINKETH:\n   { bid: '0.00121903',\n     bids: '3784.00000000',\n     ask: '0.00122965',\n     asks: '200.00000000' },\n  XVGBTC:\n   { bid: '0.00000113',\n     bids: '470101.00000000',\n     ask: '0.00000114',\n     asks: '147728.00000000' },\n  XVGETH:\n   { bid: '0.00001813',\n     bids: '8274.00000000',\n     ask: '0.00001843',\n     asks: '8320.00000000' },\n  CTRBTC:\n   { bid: '0.00020202',\n     bids: '625.00000000',\n     ask: '0.00020649',\n     asks: '1143.00000000' },\n  CTRETH:\n   { bid: '0.00330510',\n     bids: '387.00000000',\n     ask: '0.00339330',\n     asks: '436.00000000' },\n  SALTBTC:\n   { bid: '0.00063500',\n     bids: '76.00000000',\n     ask: '0.00064300',\n     asks: '437.54000000' },\n  SALTETH:\n   { bid: '0.01014200',\n     bids: '202.79000000',\n     ask: '0.01122600',\n     asks: '1.36000000' },\n  MDABTC:\n   { bid: '0.00038061',\n     bids: '8.00000000',\n     ask: '0.00041300',\n     asks: '1772.00000000' },\n  MDAETH:\n   { bid: '0.00655000',\n     bids: '547.00000000',\n     ask: '0.00660830',\n     asks: '8814.00000000' },\n  MTLBTC:\n   { bid: '0.00140600',\n     bids: '0.11000000',\n     ask: '0.00143800',\n     asks: '12.00000000' },\n  MTLETH:\n   { bid: '0.02300000',\n     bids: '1166.86000000',\n     ask: '0.02489500',\n     asks: '13.98000000' },\n  SUBBTC:\n   { bid: '0.00003580',\n     bids: '7617.00000000',\n     ask: '0.00003619',\n     asks: '1052.00000000' },\n  SUBETH:\n   { bid: '0.00056500',\n     bids: '3649.00000000',\n     ask: '0.00059988',\n     asks: '3649.00000000' } }\n```\n\u003c/details\u003e\n\n#### Get market depth for a symbol\n```javascript\nbinance.depth(\"BNBBTC\", (error, depth, symbol) =\u003e {\n  console.info(symbol+\" market depth\", depth);\n});\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\nmarket depth for BNBBTC\n{ bids:\n   { '0.00022997': '49.00000000',\n     '0.00022867': '11.00000000',\n     '0.00022865': '1149.00000000',\n     '0.00022810': '20.00000000',\n     '0.00022800': '1000.00000000',\n     '0.00022777': '1350.00000000',\n     '0.00022774': '96.00000000',\n     '0.00022765': '5.00000000',\n     '0.00022741': '12.00000000',\n     '0.00022705': '1372.00000000',\n     '0.00022700': '402.00000000',\n     '0.00022514': '756.00000000',\n     '0.00022513': '761.00000000',\n     '0.00022502': '2244.00000000',\n     '0.00022501': '2190.00000000',\n     '0.00022500': '5069.00000000',\n     '0.00022419': '1871.00000000',\n     '0.00022418': '1667.00000000',\n     '0.00022167': '1889.00000000',\n     '0.00022162': '1014.00000000',\n     '0.00022112': '13563.00000000',\n     '0.00022078': '4056.00000000',\n     '0.00022000': '8060.00000000',\n     '0.00021963': '13563.00000000',\n     '0.00021850': '52.00000000',\n     '0.00021800': '1282.00000000',\n     '0.00021710': '102.00000000',\n     '0.00021680': '100.00000000',\n     '0.00021652': '29.00000000',\n     '0.00021641': '154.00000000',\n     '0.00021500': '1491.00000000',\n     '0.00021471': '977.00000000',\n     '0.00021405': '478.00000000',\n     '0.00021400': '11.00000000',\n     '0.00021314': '686.00000000',\n     '0.00021219': '1089.00000000',\n     '0.00021200': '767.00000000',\n     '0.00021100': '5000.00000000',\n     '0.00021011': '50.00000000',\n     '0.00021000': '3468.00000000',\n     '0.00020900': '169.00000000',\n     '0.00020843': '90.00000000',\n     '0.00020811': '200.00000000',\n     '0.00020702': '50.00000000',\n     '0.00020691': '283.00000000',\n     '0.00020600': '3703.00000000',\n     '0.00020500': '107.00000000',\n     '0.00020450': '6363.00000000',\n     '0.00020250': '301.00000000',\n     '0.00020222': '200.00000000',\n     '0.00020200': '123.00000000',\n     '0.00020137': '50.00000000',\n     '0.00020122': '727.00000000',\n     '0.00020100': '6400.00000000',\n     '0.00020088': '10.00000000',\n     '0.00020020': '793.00000000',\n     '0.00020010': '500.00000000',\n     '0.00020009': '44.00000000',\n     '0.00020001': '20020.00000000',\n     '0.00020000': '45269.00000000',\n     '0.00019990': '270.00000000',\n     '0.00019880': '2117.00000000',\n     '0.00019800': '1200.00000000',\n     '0.00019783': '50.00000000',\n     '0.00019702': '300.00000000',\n     '0.00019686': '10.00000000',\n     '0.00019600': '1025.00000000',\n     '0.00019595': '139.00000000',\n     '0.00019501': '3227.00000000',\n     '0.00019500': '3832.00000000',\n     '0.00019488': '82.00000000',\n     '0.00019400': '1853.00000000',\n     '0.00019293': '10.00000000',\n     '0.00019289': '30.00000000',\n     '0.00019234': '1999.00000000',\n     '0.00019200': '4765.00000000',\n     '0.00019190': '6.00000000',\n     '0.00019100': '4353.00000000',\n     '0.00019073': '12.00000000',\n     '0.00019058': '28.00000000',\n     '0.00019050': '718.00000000',\n     '0.00019001': '20.00000000',\n     '0.00019000': '39478.00000000',\n     '0.00018907': '10.00000000',\n     '0.00018888': '10045.00000000',\n     '0.00018880': '15.00000000',\n     '0.00018800': '3528.00000000',\n     '0.00018700': '328.00000000',\n     '0.00018600': '1000.00000000',\n     '0.00018598': '2187.00000000',\n     '0.00018538': '1383.00000000',\n     '0.00018529': '10.00000000',\n     '0.00018500': '1512.00000000',\n     '0.00018253': '30.00000000',\n     '0.00018200': '3000.00000000',\n     '0.00018158': '10.00000000',\n     '0.00018106': '250.00000000',\n     '0.00018100': '4577.00000000',\n     '0.00018011': '500.00000000',\n     '0.00018000': '29832.00000000' },\n  asks:\n   { '0.00022999': '32.00000000',\n     '0.00023086': '583.00000000',\n     '0.00023095': '1154.00000000',\n     '0.00023119': '781.00000000',\n     '0.00023120': '3401.00000000',\n     '0.00023180': '4889.00000000',\n     '0.00023185': '83.00000000',\n     '0.00023211': '750.00000000',\n     '0.00023339': '9273.00000000',\n     '0.00023340': '474.00000000',\n     '0.00023440': '500.00000000',\n     '0.00023450': '1433.00000000',\n     '0.00023500': '1480.00000000',\n     '0.00023573': '87.00000000',\n     '0.00023580': '518.00000000',\n     '0.00023999': '863.00000000',\n     '0.00024000': '275.00000000',\n     '0.00024100': '60.00000000',\n     '0.00024119': '3736.00000000',\n     '0.00024180': '989.00000000',\n     '0.00024350': '1285.00000000',\n     '0.00024399': '500.00000000',\n     '0.00024400': '2964.00000000',\n     '0.00024419': '500.00000000',\n     '0.00024500': '4499.00000000',\n     '0.00024580': '542.00000000',\n     '0.00024584': '6.00000000',\n     '0.00024700': '250.00000000',\n     '0.00024789': '2938.00000000',\n     '0.00024790': '5535.00000000',\n     '0.00024800': '499.00000000',\n     '0.00024892': '2000.00000000',\n     '0.00024920': '652.00000000',\n     '0.00024972': '9242.00000000',\n     '0.00024999': '1262.00000000',\n     '0.00025000': '3739.00000000',\n     '0.00025078': '250.00000000',\n     '0.00025348': '1000.00000000',\n     '0.00025499': '220.00000000',\n     '0.00025500': '6029.00000000',\n     '0.00025518': '10.00000000',\n     '0.00025698': '17.00000000',\n     '0.00025700': '250.00000000',\n     '0.00025800': '265.00000000',\n     '0.00025925': '20.00000000',\n     '0.00025984': '1048.00000000',\n     '0.00025985': '1048.00000000',\n     '0.00025987': '1165.00000000',\n     '0.00025990': '465.00000000',\n     '0.00025994': '571.00000000',\n     '0.00025995': '390.00000000',\n     '0.00026000': '5033.00000000',\n     '0.00026028': '10.00000000',\n     '0.00026280': '40.00000000',\n     '0.00026300': '13.00000000',\n     '0.00026348': '50.00000000',\n     '0.00026500': '38.00000000',\n     '0.00026548': '10.00000000',\n     '0.00026594': '51.00000000',\n     '0.00026666': '15000.00000000',\n     '0.00026700': '500.00000000',\n     '0.00026800': '27.00000000',\n     '0.00026900': '1000.00000000',\n     '0.00026929': '50.00000000',\n     '0.00026990': '270.00000000',\n     '0.00027000': '8750.00000000',\n     '0.00027199': '50.00000000',\n     '0.00027300': '351.00000000',\n     '0.00027429': '50.00000000',\n     '0.00027480': '270.00000000',\n     '0.00027500': '38.00000000',\n     '0.00027690': '242.00000000',\n     '0.00027700': '500.00000000',\n     '0.00027789': '1317.00000000',\n     '0.00027906': '1457.00000000',\n     '0.00027912': '98.00000000',\n     '0.00027949': '50.00000000',\n     '0.00027950': '2000.00000000',\n     '0.00027977': '96.00000000',\n     '0.00027980': '1031.00000000',\n     '0.00028000': '782.00000000',\n     '0.00028300': '25.00000000',\n     '0.00028500': '48.00000000',\n     '0.00028590': '364.00000000',\n     '0.00028680': '50.00000000',\n     '0.00028699': '50.00000000',\n     '0.00028700': '1600.00000000',\n     '0.00028800': '3509.00000000',\n     '0.00028890': '175.00000000',\n     '0.00028900': '11474.00000000',\n     '0.00028999': '10000.00000000',\n     '0.00029000': '623.00000000',\n     '0.00029100': '303.00000000',\n     '0.00029141': '456.00000000',\n     '0.00029200': '9999.00000000',\n     '0.00029234': '104.00000000',\n     '0.00029300': '200.00000000',\n     '0.00029358': '325.00000000',\n     '0.00029399': '153.00000000',\n     '0.00029428': '100.00000000' } }\n```\n\u003c/details\u003e\n\n#### Placing a LIMIT order\n```javascript\nlet quantity = 1, price = 0.069;\nbinance.buy(\"ETHBTC\", quantity, price);\nbinance.sell(\"ETHBTC\", quantity, price);\n```\n\n#### Placing a MARKET order\n```javascript\n// These orders will be executed at current market price.\nlet quantity = 1;\nbinance.marketBuy(\"BNBBTC\", quantity);\nbinance.marketSell(\"ETHBTC\", quantity);\n```\n\n#### LIMIT order with callback\n```javascript\nlet quantity = 5, price = 0.00402030;\nbinance.buy(\"BNBETH\", quantity, price, {type:'LIMIT'}, (error, response) =\u003e {\n  console.info(\"Limit Buy response\", response);\n  console.info(\"order id: \" + response.orderId);\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```\nLimit Buy response {\n  symbol: 'BNBETH',\n  orderId: 4480717,\n  clientOrderId: 'te38xGILZUXrPZHnTQPH6h',\n  transactTime: 1509049732437,\n  price: '0.00402030',\n  origQty: '5.00000000',\n  executedQty: '5.00000000',\n  status: 'FILLED',\n  timeInForce: 'GTC',\n  type: 'LIMIT',\n  side: 'BUY' }\n//order id: 4480717\n```\n\n\u003c/details\u003e\n\n#### Chaining orders together\n```js\nlet quantity = 1;\nbinance.marketBuy(\"BNBBTC\", quantity, (error, response) =\u003e {\n  console.info(\"Market Buy response\", response);\n  console.info(\"order id: \" + response.orderId);\n  // Now you can limit sell with a stop loss, etc.\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```\nMarket Buy response {\n  symbol: 'BNBETH',\n  orderId: 4480553,\n  clientOrderId: 'rCGiCG08PGy7AwvbrG5d83',\n  transactTime: 1509049376261,\n  price: '0.00000000',\n  origQty: '1.00000000',\n  executedQty: '1.00000000',\n  status: 'FILLED',\n  timeInForce: 'GTC',\n  type: 'MARKET',\n  side: 'BUY' }\n//order id: 4480553\n```\n\n\u003c/details\u003e\n\n#### Placing a STOP LOSS order\n```javascript\n// When the stop is reached, a stop order becomes a market order\n// Note: You must also pass one of these type parameters:\n// STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT\nlet type = \"STOP_LOSS\";\nlet quantity = 1;\nlet price = 0.069;\nlet stopPrice = 0.068;\nbinance.sell(\"ETHBTC\", quantity, price, {stopPrice: stopPrice, type: type});\n```\n\n#### Placing an ICEBERG order\n```javascript\n// Iceberg orders are intended to conceal the order quantity.\nlet quantity = 1;\nlet price = 0.069;\nbinance.sell(\"ETHBTC\", quantity, price, {icebergQty: 10});\n```\n\n#### Cancel an order\n```javascript\nbinance.cancel(\"ETHBTC\", orderid, (error, response, symbol) =\u003e {\n  console.info(symbol+\" cancel response:\", response);\n});\n```\n\n#### Cancel all open orders\n```js\nconsole.info( await binance.cancelAll(\"XMRBTC\") );\n```\n\n#### Get open orders for a symbol\n```javascript\nbinance.openOrders(\"ETHBTC\", (error, openOrders, symbol) =\u003e {\n  console.info(\"openOrders(\"+symbol+\")\", openOrders);\n});\n```\n\n#### Get list of all open orders\n```javascript\nbinance.openOrders(false, (error, openOrders) =\u003e {\n  console.info(\"openOrders()\", openOrders);\n});\n```\n\n#### Check an order's status\n```javascript\nlet orderid = \"7610385\";\nbinance.orderStatus(\"ETHBTC\", orderid, (error, orderStatus, symbol) =\u003e {\n  console.info(symbol+\" order status:\", orderStatus);\n});\n```\n\n#### Get your Trade History\n```javascript\nbinance.trades(\"SNMBTC\", (error, trades, symbol) =\u003e {\n  console.info(symbol+\" trade history\", trades);\n});\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n[ { id: 9572,\n    orderId: 47884,\n    price: '0.00003701',\n    qty: '1467.00000000',\n    commission: '0.06774660',\n    commissionAsset: 'BNB',\n    time: 1507062500456,\n    isBuyer: true,\n    isMaker: true,\n    isBestMatch: true },\n  { id: 9575,\n    orderId: 47884,\n    price: '0.00003701',\n    qty: '735.00000000',\n    commission: '0.03394257',\n    commissionAsset: 'BNB',\n    time: 1507062502528,\n    isBuyer: true,\n    isMaker: true,\n    isBestMatch: true } } ]\n```\n\u003c/details\u003e\n\n#### Get all account orders; active, canceled, or filled.\n```javascript\nbinance.allOrders(\"ETHBTC\", (error, orders, symbol) =\u003e {\n  console.info(symbol+\" orders:\", orders);\n});\n```\n\n#### Get dust log\n```javascript\nbinance.dustLog((error, dustlog) =\u003e {\n  console.info(dustlog);\n})\n```\n\n#### Get 24hr ticker price change statistics for all symbols\n```javascript\nbinance.prevDay(false, (error, prevDay) =\u003e {\n  // console.info(prevDay); // view all data\n  for ( let obj of prevDay ) {\n    let symbol = obj.symbol;\n    console.info(symbol+\" volume:\"+obj.volume+\" change: \"+obj.priceChangePercent+\"%\");\n  }\n});\n```\n\n#### Get 24hr ticker price change statistics for a symbol\n```javascript\nbinance.prevDay(\"BNBBTC\", (error, prevDay, symbol) =\u003e {\n  console.info(symbol+\" previous day:\", prevDay);\n  console.info(\"BNB change since yesterday: \"+prevDay.priceChangePercent+\"%\")\n});\n```\n\n#### Get Kline/candlestick data for a symbol\nYou can use the optional API parameters for getting historical candlesticks, these are useful if you want to import data from earlier back in time.\nOptional parameters: limit (max/default 500), startTime, endTime.\n\n```javascript\n// Intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M\nbinance.candlesticks(\"BNBBTC\", \"5m\", (error, ticks, symbol) =\u003e {\n  console.info(\"candlesticks()\", ticks);\n  let last_tick = ticks[ticks.length - 1];\n  let [time, open, high, low, close, volume, closeTime, assetVolume, trades, buyBaseVolume, buyAssetVolume, ignored] = last_tick;\n  console.info(symbol+\" last close: \"+close);\n}, {limit: 500, endTime: 1514764800000});\n```\n\n# WebSockets Implementation\n\n#### Get Complete WebSocket Chart Cache\nThis function pulls existing chart data before connecting to the WebSocket, and provides you realtime synchronized chart information including the most recent 500 candles.\n\n```javascript\nbinance.websockets.chart(\"BNBBTC\", \"1m\", (symbol, interval, chart) =\u003e {\n  let tick = binance.last(chart);\n  const last = chart[tick].close;\n  console.info(chart);\n  // Optionally convert 'chart' object to array:\n  // let ohlc = binance.ohlc(chart);\n  // console.info(symbol, ohlc);\n  console.info(symbol+\" last price: \"+last)\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```\n{\n  '1517557800000':\n   { open: '0.00100090',\n     high: '0.00100650',\n     low: '0.00099810',\n     close: '0.00100370',\n     volume: '1161.52000000' },\n  '1517557860000':\n   { open: '0.00100360',\n     high: '0.00101010',\n     low: '0.00100000',\n     close: '0.00100310',\n     volume: '1977.68000000' },\n  '1517557920000':\n   { open: '0.00100100',\n     high: '0.00101130',\n     low: '0.00100080',\n     close: '0.00100670',\n     volume: '2002.00000000' },\n  '1517557980000':\n   { open: '0.00100660',\n     high: '0.00101400',\n     low: '0.00100200',\n     close: '0.00100640',\n     volume: '3896.40000000' },\n  '1517558040000':\n   { open: '0.00100630',\n     high: '0.00101390',\n     low: '0.00100350',\n     close: '0.00100470',\n     volume: '1675.48000000' },\n  '1517558100000':\n   { open: '0.00100860',\n     high: '0.00101450',\n     low: '0.00100100',\n     close: '0.00100270',\n     volume: '1918.46000000' },\n  '1517558160000':\n   { open: '0.00100460',\n     high: '0.00101480',\n     low: '0.00100310',\n     close: '0.00100670',\n     volume: '2464.12000000' },\n  '1517558220000':\n   { open: '0.00100510',\n     high: '0.00100660',\n     low: '0.00100110',\n     close: '0.00100250',\n     volume: '1484.59000000' } }\n// (..many more entries not shown)\n///BNBBTC last price: 0.00100250\n```\n\u003c/details\u003e\n\n\n#### Get Candlestick Updates via WebSocket\n```javascript\n// Periods: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M\nbinance.websockets.candlesticks(['BNBBTC'], \"1m\", (candlesticks) =\u003e {\n  let { e:eventType, E:eventTime, s:symbol, k:ticks } = candlesticks;\n  let { o:open, h:high, l:low, c:close, v:volume, n:trades, i:interval, x:isFinal, q:quoteVolume, V:buyVolume, Q:quoteBuyVolume } = ticks;\n  console.info(symbol+\" \"+interval+\" candlestick update\");\n  console.info(\"open: \"+open);\n  console.info(\"high: \"+high);\n  console.info(\"low: \"+low);\n  console.info(\"close: \"+close);\n  console.info(\"volume: \"+volume);\n  console.info(\"isFinal: \"+isFinal);\n});\n```\n\n#### Get Trade Updates via WebSocket\n```javascript\nbinance.websockets.trades(['BNBBTC', 'ETHBTC'], (trades) =\u003e {\n  let {e:eventType, E:eventTime, s:symbol, p:price, q:quantity, m:maker, a:tradeId} = trades;\n  console.info(symbol+\" trade update. price: \"+price+\", quantity: \"+quantity+\", maker: \"+maker);\n});\n```\n\n#### Get miniTicker via WebSocket\n```js\nbinance.websockets.miniTicker(markets =\u003e {\n  console.info(markets);\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```\n  ICXBNB:\n   { close: '0.34803000',\n     open: '0.34249000',\n     high: '0.35000000',\n     low: '0.31001000',\n     volume: '134681.88000000',\n     quoteVolume: '44351.78363150',\n     eventTime: 1520501508957 },\n  ELFETH:\n   { close: '0.00120820',\n     open: '0.00132816',\n     high: '0.00132926',\n     low: '0.00115888',\n     volume: '852919.00000000',\n     quoteVolume: '1045.37831133',\n     eventTime: 1520501508735 },\n  PIVXBTC:\n   { close: '0.00049510',\n     open: '0.00051000',\n     high: '0.00056290',\n     low: '0.00049200',\n     volume: '215530.27000000',\n     quoteVolume: '111.50245426',\n     eventTime: 1520501508367 }\n```\n\u003c/details\u003e\n\n#### Get 24hr Price Change Statistics via WebSocket\n```js\n// For all symbols:\nbinance.websockets.prevDay(false, (error, response) =\u003e {\n  console.info(response);\n});\n\n// For a specific symbol:\nbinance.websockets.prevDay('BNBBTC', (error, response) =\u003e {\n  console.info(response);\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```\n{ eventType: '24hrTicker',\n  eventTime: 1512629577435,\n  symbol: 'BNBBTC',\n  priceChange: '-0.00002671',\n  percentChange: '-12.844',\n  averagePrice: '0.00019282',\n  prevClose: '0.00020796',\n  close: '0.00018125',\n  closeQty: '55.00000000',\n  bestBid: '0.00018038',\n  bestBidQty: '580.00000000',\n  bestAsk: '0.00018125',\n  bestAskQty: '144.00000000',\n  open: '0.00020796',\n  high: '0.00021300',\n  low: '0.00017555',\n  volume: '3731915.00000000',\n  quoteVolume: '719.59011818',\n  openTime: 1512543177433,\n  closeTime: 1512629577433,\n  firstTradeId: 2248079,\n  lastTradeId: 2284725,\n  numTrades: 36647 }\n```\n\u003c/details\u003e\n\n#### Get Market Depth via WebSocket\n```javascript\nbinance.websockets.depth(['BNBBTC'], (depth) =\u003e {\n  let {e:eventType, E:eventTime, s:symbol, u:updateId, b:bidDepth, a:askDepth} = depth;\n  console.info(symbol+\" market depth update\");\n  console.info(bidDepth, askDepth);\n});\n```\n\n#### Maintain Market Depth Cache Locally via WebSocket\n```javascript\nbinance.websockets.depthCache(['BNBBTC'], (symbol, depth) =\u003e {\n  let bids = binance.sortBids(depth.bids);\n  let asks = binance.sortAsks(depth.asks);\n  console.info(symbol+\" depth cache update\");\n  console.info(\"bids\", bids);\n  console.info(\"asks\", asks);\n  console.info(\"best bid: \"+binance.first(bids));\n  console.info(\"best ask: \"+binance.first(asks));\n  console.info(\"last updated: \" + new Date(depth.eventTime));\n});\n```\n\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```javascript\nBNBBTC depth cache update\nasks { '0.00025400': 0.531114,\n  '0.00025440': 0.2602512,\n  '0.00025469': 0.01400795,\n  '0.00025500': 0.0051,\n  '0.00025555': 0.0245328,\n  '0.00025629': 0.05100171,\n  '0.00025630': 0.0146091,\n  '0.00025642': 0.02230854,\n  '0.00025825': 0.00180775,\n  '0.00025896': 0.21856224,\n  '0.00025927': 0.025927 }\nbids { '0.00025203': 0.201624,\n  '0.00025202': 0.04838784,\n  '0.00025200': 0.13482,\n  '0.00025195': 0.01385725,\n  '0.00025187': 0.25539618,\n  '0.00025138': 0.012569,\n  '0.00025136': 0.04247984,\n  '0.00025135': 0.0085459,\n  '0.00025100': 0.02259,\n  '0.00025072': 0.012536,\n  '0.00025071': 0.00401136 }\n//best ask: 0.00025400\n//best bid: 0.00025203\n//last updated: Thu Apr 18 2019 00:52:49 GMT-0400 (Eastern Daylight Time)\n```\n\u003c/details\u003e\n\n#### bookTickers stream includes the bid/ask price \u0026 amount, for all symbols\n```js\nbinance.websockets.bookTickers( console.log );\n```\n#### bookTickers stream includes the bid/ask price \u0026 amount, for a symbol\n```js\nbinance.websockets.bookTickers( 'BTCUSDT', console.log );\n```\n\n### Deposit \u0026 Withdraw\n\n#### Get Deposit Address\n```js\nbinance.depositAddress(\"XMR\", (error, response) =\u003e {\n  console.info(response);\n});\n```\n\n#### Get All Deposit History\n```js\nbinance.depositHistory((error, response) =\u003e {\n  console.info(response);\n});\n```\n\n#### Get Deposit History for a specific symbol\n```js\nbinance.depositHistory((error, response) =\u003e {\n  console.info(response);\n}, \"VEN\");\n```\n\n#### Get All Withdraw History\n```js\nbinance.withdrawHistory((error, response) =\u003e {\n  console.info(response);\n});\n```\n\n#### Get Withdraw History for a specific symbol\n```js\nbinance.withdrawHistory((error, response) =\u003e {\n  console.info(response);\n}, \"BTC\");\n```\n\n#### Withdraw with AddressTag\n```js\n// Required for coins like XMR, XRP, etc.\nlet address = \"44tLjmXrQNrWJ5NBsEj2R77ZBEgDa3fEe9GLpSf2FRmhexPvfYDUAB7EXX1Hdb3aMQ9FLqdJ56yaAhiXoRsceGJCRS3Jxkn\";\nlet addressTag = \"0e5e38a01058dbf64e53a4333a5acf98e0d5feb8e523d32e3186c664a9c762c1\";\nlet amount = 0.1;\nbinance.withdraw(\"XMR\", address, amount, addressTag);\n```\n\n#### Withdraw\n```js\nbinance.withdraw(\"BTC\", \"1C5gqLRs96Xq4V2ZZAR1347yUCpHie7sa\", 0.2);\n```\n\n### Universal Transfer / Internal Wallet Transfer\nExample Spot account transfer to USDⓈ-M Futures account , use ENUM -\u003e \"MAIN_UMFUTURE\"\n```js\nconsole.info( await binance.universalTransfer(\"MAIN_UMFUTURE\",\"USDT\",10) );\n```\nfor more account transfers (ENUMs) see [docs](https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer)\n\n# Binance Margin API\n\n#### Transfer from Main account to Margin account\n```js\nbinance.mgTransferMainToMargin(asset, amount, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    // Success! Transaction ID: response.tranId\n});\n\n```\n#### Transfer from Margin account to Main account\n```js\nbinance.mgTransferMarginToMain(asset, amount, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    // Success! Transaction ID: response.tranId\n});\n```\n\n#### Get maximum transfer-out amount from Margin account to Main account\n```js\nbinance.maxTransferable(asset, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    console.info(`Maximum transfer-out amount: ${response.amount}`);\n});\n```\n\n#### Get maximum borrow amount\n```js\nbinance.maxBorrowable(asset, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    console.info(`Maximum borrow amount: ${response.amount}`);\n});\n```\n\n#### Borrow from margin account\n```js\nbinance.mgBorrow(asset, amount, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    // Success! Transaction ID: response.tranId\n});\n```\n\n#### Repay margin account\n```js\nbinance.mgRepay(asset, amount, (error, response) =\u003e {\n    if ( error ) return console.warn(error);\n    // Success! Transaction ID: response.tranId\n});\n```\n\n#### Margin BUY and SELL orders\nInstead of `binance.buy()` use `binance.mgBuy()` and instead of `binance.sell()` use `binance.mgSell()`.\n\nFor market orders use `binance.mgMarketBuy()` and `binance.mgMarketSell()`.\n\nFor order operations, use `binance.mgCancel()`, `binance.mgCancelOrders()`, `binance.mgAllOrders()`, `binance.openOrders()`, `binance.mgOrderStatus()`.\n\nUsage and callbacks are the same as the 'regular account' counterparts.\n\n#### Get your Trade History for the Margin account\nUse `binance.mgTrades()` instead of `binance.trades()`. \n\n```javascript\nbinance.mgTrades(\"ETHUSDT\", (error, trades, symbol) =\u003e {\n  console.info(symbol+\" trade history\", trades);\n});\n```\n\u003cdetails\u003e\n \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js\n[ { symbol: 'ETHUSDT',\n    id: 9572,\n    orderId: 47884,\n    price: '2063.07',\n    qty: '1.44877',\n    commission: '2.98891392',\n    commissionAsset: 'USDT',\n    time: 1617900638521,\n    isBuyer: false,\n    isMaker: false,\n    isBestMatch: true,\n    isIsolated: true }]\n```\n\u003c/details\u003e\n\n#### Margin account details\n```javascript\nbinance.mgAccount((error, response) =\u003e {\n   if ( error ) return console.warn(error);\n   console.info(\"Account details response:\", response)\n})\n```\n\u003cdetails\u003e\n  \u003csummary\u003eView response\u003c/summary\u003e\n\n  ```javascript\n    {\n      borrowEnabled: true,\n      marginLevel: '999.00000000',\n      totalAssetOfBtc: '0.00000003',\n      totalLiabilityOfBtc: '0.00000000',\n      totalNetAssetOfBtc: '0.00000003',\n      tradeEnabled: true,\n      transferEnabled: true,\n      userAssets: [\n        {\n          asset: 'MATIC',\n          borrowed: '0.00000000',\n          free: '0.00000000',\n          interest: '0.00000000',\n          locked: '0.00000000',\n          netAsset: '0.00000000'\n        }\n      ]\n    }\n  ```\n\u003c/details\u003e\n\n# Binance Lending API\n\n#### Lending Account Details\n```javascript\nlet lendingData = await binance.lending();\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eView response\u003c/summary\u003e\n  \n  ```javascript\n    lendingData {\n      positionAmountVos: [\n        {\n          amount: '952983.20208997',\n          amountInBTC: '129.54853649',\n          amountInUSDT: '952983.20208997',\n          asset: 'USDT'\n        }\n      ],\n      totalAmountInBTC: '129.54853649',\n      totalAmountInUSDT: '952983.20208997',\n      totalFixedAmountInBTC: '13.59400000',\n      totalFixedAmountInUSDT: '100000.00000000',\n      totalFlexibleInBTC: '115.95453649',\n      totalFlexibleInUSDT: '852983.20208997'\n    }\n    {\n      positionAmountVos: [],\n      totalAmountInBTC: '0.00000000',\n      totalAmountInUSDT: '0.00000000',\n      totalFixedAmountInBTC: '0.00000000',\n      totalFixedAmountInUSDT: '0.00000000',\n      totalFlexibleInBTC: '0.00000000',\n      totalFlexibleInUSDT: '0.00000000'\n    }\n    {\n      positionAmountVos: [],\n      totalAmountInBTC: '0.00000000',\n      totalAmountInUSDT: '0.00000000',\n      totalFixedAmountInBTC: '0.00000000',\n      totalFixedAmountInUSDT: '0.00000000',\n      totalFlexibleInBTC: '0.00000000',\n      totalFlexibleInUSDT: '0.00000000'\n    }\n  ```\n\u003c/details\u003e\n\n#### [Advanced Examples](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md)\n\u003e [exchangeInfo: Pull minimum order size, quantity, etc](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#exchangeinfo-pull-minimum-order-size-quantity-etc)\\\n[Clamp order quantities to required amounts via minQty, minNotional, stepSize when placing orders](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#clamp-order-quantities-to-required-amounts-via-minqty-minnotional-stepsize-when-placing-orders)\\\n[Show API Rate limits](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#show-api-rate-limits)\\\n[Connect to all WebSockets at once](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#connect-to-all-websockets-at-once-thanks-keith1024)\\\n[Get last order for a symbol](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#get-last-order-for-a-symbol)\\\n[newOrderRespType example](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#neworderresptype-example-when-placing-orders)\\\n[Recent Trades (historicalTrades, recentTrades, aggTrades functions)](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#recent-trades-historicaltrades-recenttrades-aggtrades-functions)\\\n[Terminate WebSocket connections](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#terminate-websocket-connections)\\\n[User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#user-data-account-balance-updates-trade-updates-new-orders-filled-orders-cancelled-orders-via-websocket)\n[Margin User Data: Account Balance Updates, Trade Updates, New Orders, Filled Orders, Cancelled Orders via WebSocket](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#margin-user-data-account-balance-updates-trade-updates-new-orders-filled-orders-cancelled-orders-via-websocket)\n[Asynchronous Syntax Options](https://github.com/jaggedsoft/node-binance-api/blob/master/examples/advanced.md#asynchronous-syntax-options)\n\n### Troubleshooting\nVerify that your system time is correct. If you have any suggestions don't hesitate to file an issue.\n\nHaving problems? Try adding `useServerTime` to your options or setting `recvWindow`:\n```js\nbinance.options({\n  APIKEY: 'xxx',\n  APISECRET: 'xxx',\n  useServerTime: true,\n  recvWindow: 60000, // Set a higher recvWindow to increase response timeout\n  verbose: true, // Add extra output when subscribing to WebSockets, etc\n  log: log =\u003e {\n    console.log(log); // You can create your own logger here, or disable console output\n  }\n});\n```\n\nProblems getting your balance? Wrap the entry point of your application in useServerTime:\n```js\nawait binance.useServerTime();\nbinance.balance((error, balances) =\u003e {\n    if ( error ) return console.error(error);\n    console.info(\"balances()\", balances);\n    console.info(\"BNB balance: \", balances.BNB.available);\n});\n```\n\nYou can enable verbose mode to help with debugging WebSocket streams:\n```js\nbinance.setOption( 'verbose', true );\n```\n\n### Sponsors\n\n\n[![Vitality](https://github.com/user-attachments/assets/0981aae2-3e12-4b57-8d2f-c5ae2b3b8b1c)](https://vitalitycrypto.com/)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=jaggedsoft/node-binance-api\u0026type=Timeline)](https://star-history.com/#jaggedsoft/node-binance-api\u0026Timeline)\n\n## Contribution\n- Give us a star :star:\n- Fork and Clone! Awesome\n- Select existing [issues](https://github.com/jaggedsoft/node-binance-api/issues) or create a [new issue](https://github.com/jaggedsoft/node-binance-api/issues/new) and give us a PR with your bugfix or improvement after. We love it ❤️\n\n![Downloads](https://img.shields.io/npm/dt/node-binance-api.svg?style=for-the-badge\u0026maxAge=86400) ![Stars](https://img.shields.io/github/stars/jaggedsoft/node-binance-api.svg?style=for-the-badge\u0026label=Stars) ![Contributors](https://img.shields.io/github/contributors/jaggedsoft/node-binance-api.svg?style=for-the-badge\u0026maxAge=86400)\n[![jaggedsoft on X](https://img.shields.io/twitter/follow/jaggedsoft.svg?style=social)](https://x.com/jaggedsoft)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccxt%2Fnode-binance-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fccxt%2Fnode-binance-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fccxt%2Fnode-binance-api/lists"}