Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@binance/connector

binance10.9kMIT3.6.1

This is a lightweight library that works as a connector to the Binance public API.

Binance, API

readme

Binance connector in Nodejs

npm version Node version Standard-Js License: MIT

This is a lightweight library that works as a connector to Binance public API. It’s designed to be simple, clean, and easy to use with minimal dependencies.

  • Supported APIs:
    • /api/*
    • /sapi/*
    • Spot Websocket Market Stream
    • Spot User Data Stream
    • Spot Websocket API
  • Inclusion of test cases and examples
  • Customizable base URL
  • Support request timeout and HTTP proxy (since v2)
  • Response metadata can be displayed
  • Customizable Logger

Installation

npm install @binance/connector

Documentation

https://binance.github.io/binance-connector-node/

RESTful APIs

const { Spot } = require('@binance/connector')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret)

// Get account information
client.account().then(response => client.logger.log(response.data))

// Place a new order
client.newOrder('BNBUSDT', 'BUY', 'LIMIT', {
  price: '350',
  quantity: 1,
  timeInForce: 'GTC'
}).then(response => client.logger.log(response.data))
  .catch(error => client.logger.error(error))

Please find examples folder to check for more endpoints.

Key Pair Based Authentication

const { Spot, PrivateKeyAlgo } = require('@binance/connector')

const apiKey = ''
const apiSecret = '' // has no effect when RSA private key is provided

// load private key
const privateKey = fs.readFileSync('/Users/john/ssl/private_key_encrypted.pem')
const privateKeyPassphrase = 'password'
const privateKeyAlgo = PrivateKeyAlgo.RSA // for RSA key
const privateKeyAlgo = PrivateKeyAlgo.ED25519 // for Ed25519 key

const client = new Spot(apiKey, apiSecret, {
  privateKey,
  privateKeyPassphrase, // only used for encrypted key
  privateKeyAlgo
})

// Get account information
client.account().then(response => client.logger.log(response.data))

Testnet

While /sapi/* endpoints don't have testnet environment yet, /api/* endpoints can be tested in Spot Testnet. You can use it by changing the base URL:

// provide the testnet base url
const client = new Spot(apiKey, apiSecret, { baseURL: 'https://testnet.binance.vision'})

Base URL

If base_url is not provided, it defaults to api.binance.com.

It's recommended to pass in the base_url parameter, even in production as Binance provides alternative URLs in case of performance issues:

  • https://api1.binance.com
  • https://api2.binance.com
  • https://api3.binance.com

Optional Parameters

Optional parameters are encapsulated to a single object as the last function parameter.

const { Spot } = require('@binance/connector')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret)

client.account({ recvWindow: 2000 }).then(response => client.logger.log(response.data))

Time Unit

The API supports different time units for timestamp values. By default, timestamp values are provided in milliseconds. You can specify the time unit in the request parameters:

const { Spot, TimeUnit } = require('@binance/connector')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret)

// Using milliseconds (default)
client.exchangeInfo({ timeUnit: TimeUnit.MILLISECOND }).then(response => client.logger.log(response.data))

// Using microseconds 
client.exchangeInfo({ timeUnit: TimeUnit.MICROSECOND }).then(response => client.logger.log(response.data))

Timeout

It's easy to set timeout in milliseconds in request. If the request take longer than timeout, the request will be aborted. If it's not set, there will be no timeout.

const { Spot } = require('@binance/connector')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret, { timeout: 1000 })

client.account()
  .then(response => client.logger.log(response.data))
  .catch(error => client.logger.error(error.message))

Proxy

The axios package is used as the http client in this library. A proxy settings is passed into axios directly, the details can be found at here:

const { Spot } = require('@binance/connector')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret,
  {
    proxy: {
      protocol: 'https',
      host: '127.0.0.1',
      port: 9000,
      auth: {
        username: 'proxy_user',
        password: 'password'
      }
    }
  }
)

You may have a HTTP proxy, that can bring the problem that you need to make a HTTPS connection through the HTTP proxy. You can do that by build a HTTPS-over-HTTP tunnel by npm package tunnel, and then pass the turnnel agent to httpsAgent in axios.

const tunnel = require('tunnel')

const agent = tunnel.httpsOverHttp({
  proxy: {
    host: "127.0.0.1",
    port: 3128
  }
})

const client = new Spot(null, null,
  {
    baseURL: "https://api.binance.com",
    httpsAgent: agent
  }
)

client.time()
  .then(response => client.logger.log(response.data))
  .catch(error => client.logger.error(error))

This comment provides more details.

Response Metadata

The Binance API server provides weight usages in the headers of each response. This information can be fetched from headers property. x-mbx-used-weight and x-mbx-used-weight-1m show the total weight consumed within 1 minute.

// client initialization is skipped

client.exchangeInfo().then(response => client.logger.log(response.headers['x-mbx-used-weight-1m']))

Custom Logger Integration

const Spot = require('@binance/connector')
const fs = require('fs')
const { Console } = require('console')

// make sure the logs/ folder is created beforehand
const output = fs.createWriteStream('./logs/stdout.log')
const errorOutput = fs.createWriteStream('./logs/stderr.log')

const logger = new Console({ stdout: output, stderr: errorOutput })
const client = new Spot('', '', {logger: logger})

client.exchangeInfo().then(response => client.logger.log(response.data))
// check the output file

The default logger defined in the package is Node.js Console class. Its output is sent to process.stdout and process.stderr, same as the global console.

Error

There are 2 types of error that may be returned from the API server and the user has to handle it properly:

  • Client error

    • This is thrown when server returns 4XX, it's an issue from client side.
    • The following properties may be helpful to resolve the issue:
      • Response header - Please refer to Response Metadata section for more details.
      • HTTP status code
      • Error code - Server's error code, e.g. -1102
      • Error message - Server's error message, e.g. Unknown order sent.
      • Request config - Configuration send to the server, which can include URL, request method and headers.
    // client initialization is skipped
    client.exchangeInfo({ symbol: 'invalidSymbol' })
      .then(response => client.logger.log(response.data))
      .catch(err => {
        client.logger.error(err.response.headers) // full response header
        client.logger.error(err.response.status) // HTTP status code 400
        client.logger.error(err.response.data) // includes both error code and message
        client.logger.error(err.response.config) // includes request's config
      })
    
  • Server error

    • This is thrown when server returns 5XX, it's an issue from server side.

Websocket

Websocket Stream

const { WebsocketStream } = require('@binance/connector')
const logger = new Console({ stdout: process.stdout, stderr: process.stderr })

// define callbacks for different events
const callbacks = {
  open: () => logger.debug('Connected with Websocket server'),
  close: () => logger.debug('Disconnected with Websocket server'),
  message: data => logger.info(data)
}

// initialize websocket stream with microseconds as the preferred time unit
const websocketStreamClient = new WebsocketStream({ logger, callbacks, timeUnit: TimeUnit.MICROSECOND })
// subscribe ticker stream
websocketStreamClient.ticker('bnbusdt')
// close websocket stream
setTimeout(() => websocketStreamClient.disconnect(), 6000)

Unsubscribe Websocket Stream

// unsubscribe websocket stream
websocketStreamClient.unsubscribe('bnbusdt@kline_1m')

WebSocket API

const { WebsocketAPI, TimeUnit } = require('@binance/connector')
const logger = new Console({ stdout: process.stdout, stderr: process.stderr })

// callbacks for different events
const callbacks = {
  open: (client) => {
    logger.debug('Connected with Websocket server')
    // send message to get orderbook info after connection open
    client.orderbook('BTCUSDT')
    client.orderbook('BNBUSDT', { limit: 10 })
  },
  close: () => logger.debug('Disconnected with Websocket server'),
  message: data => logger.info(data)
}

// initialize WebsocketAPI client with microseconds as the preferred time unit
const websocketAPIClient = new WebsocketAPI(null, null, { logger, callbacks, timeUnit: TimeUnit.MICROSECOND })

// disconnect the connection
setTimeout(() => websocketAPIClient.disconnect(), 20000)

More websocket examples are available in the examples folder

Auto Reconnect

If there is a close event not initiated by the user, the reconnection mechanism will be triggered in 5 secs.

Ping Server

It is possible to ping server from client, and expect to receive a PONG message.

websocketStreamClient.pingServer()

Custom Logger Integration

The default logger defined in the package is Node.js Console class. Its output is sent to process.stdout and process.stderr, same as the global console.

Note that when the connection is initialized, the console outputs a list of callbacks in the form of listen to event: <event_name>.

Test

npm install

npm run test

Limitation

Futures and Vanilla Options APIs are not supported:

  • /fapi/*
  • /dapi/*
  • /vapi/*
  • Associated Websocket Market and User Data Streams

License

MIT

changelog

Changelog

3.6.1 - 2025-01-08

Changed

  • Updated documentation links.

3.6.0 - 2024-12-19

Added

  • A new optional parameter timeUnit can be used to select the time unit. Available options are MILLISECOND, MICROSECOND, millisecond and microsecond.

Changed

  • Use signed requests for the following endpoints:
    • POST /sapi/v1/lending/auto-invest/plan/edit-status
    • GET /sapi/v1/lending/auto-invest/plan/list
    • GET /sapi/v1/lending/auto-invest/plan/id
    • GET /sapi/v1/lending/auto-invest/history/list

3.5.0 - 2024-10-02

Added

  • Add GiftCard endpoint:
    • POST /sapi/v1/giftcard/buyCode to create a dual-token gift card

Changed

  • Updated dependencies
  • Updated endpoint /sapi/v1/sub-account/subAccountApi/ipRestriction to /sapi/v2/sub-account/subAccountApi/ipRestriction

Removed

  • Deprecated Margin endpoints:

    • POST /sapi/v1/margin/transfer
    • POST /sapi/v1/margin/isolated/transfer
    • POST /sapi/v1/margin/loan
    • POST /sapi/v1/margin/repay
    • GET /sapi/v1/margin/isolated/transfer
    • GET /sapi/v1/margin/asset
    • GET /sapi/v1/margin/pair
    • GET /sapi/v1/margin/isolated/pair
    • GET /sapi/v1/margin/loan
    • GET /sapi/v1/margin/repay
    • GET /sapi/v1/margin/dribblet
    • GET /sapi/v1/margin/dust
    • POST /sapi/v1/margin/dust
  • Deprecated Sub-Account endpoints:

    • POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList
  • Deprecated Futures endpoints:

    • POST /sapi/v1/futures/transfer
    • GET /sapi/v1/futures/transfer
  • BLVT endpoints:

    • GET /sapi/v1/blvt/tokenInfo
    • POST /sapi/v1/blvt/subscribe
    • GET /sapi/v1/blvt/subscribe/record
    • POST /sapi/v1/blvt/redeem
    • GET /sapi/v1/blvt/redeem/record

3.4.1 - 2024-08-19

Updated

  • Updated dependencies
  • Upgraded deprecated spot endpoint POST /api/v3/order/oco to POST /api/v3/orderList/oco
  • Upgraded deprecated Websocket API endpoint orderList.place to orderList.place.oco

3.4.0 - 2024-06-19

Changed

  • Updated dependencies
  • Resolved multiple websocket stream request issue

3.3.0 - 2024-04-04

Added

  • Add Simple Earn endpoints:
    • GET /sapi/v1/simple-earn/flexible/list to query available Simple Earn flexible product list
    • GET /sapi/v1/simple-earn/locked/list to query available Simple Earn locked product list
    • POST /sapi/v1/simple-earn/flexible/subscribe to subscribe to a flexible product
    • POST /sapi/v1/simple-earn/locked/subscribe to subscribe to a locked product
    • POST /sapi/v1/simple-earn/flexible/redeem to redeem a flexible product
    • POST /sapi/v1/simple-earn/locked/redeem to redeem a locked product
    • GET /sapi/v1/simple-earn/flexible/position to get a flexible product position
    • GET /sapi/v1/simple-earn/locked/position to get a locked product position
    • GET /sapi/v1/simple-earn/account to get a simple account balances
    • GET /sapi/v1/simple-earn/flexible/history/subscriptionRecord to get flexible subscription records
    • GET /sapi/v1/simple-earn/locked/history/subscriptionRecord to get locked subscription records
    • GET /sapi/v1/simple-earn/flexible/history/redemptionRecord to retrieve flexible redemption records
    • GET /sapi/v1/simple-earn/locked/history/redemptionRecord to retrieve locked redemption records
    • GET /sapi/v1/simple-earn/flexible/history/rewardsRecord to get flexible rewards history
    • GET /sapi/v1/simple-earn/locked/history/rewardsRecord to get locked rewards history
    • POST /sapi/v1/simple-earn/flexible/setAutoSubscribe to set an auto-subscription to a flexible product
    • POST /sapi/v1/simple-earn/locked/setAutoSubscribe to set an auto-subscription to a locked product
    • GET /sapi/v1/simple-earn/flexible/personalLeftQuota to get flexible personal left quota
    • GET /sapi/v1/simple-earn/locked/personalLeftQuota to get locked personal left quota
    • GET /sapi/v1/simple-earn/flexible/subscriptionPreview to get flexible subscription preview
    • GET /sapi/v1/simple-earn/locked/subscriptionPreview to get locked subscription previews
    • GET /sapi/v1/simple-earn/flexible/history/rateHistory to get a rate history
    • GET /sapi/v1/simple-earn/flexible/history/collateralRecord to get collateral records

Changed

  • Update dependencies

3.2.0 - 2024-01-23

Changed

  • Updated follow-redirects dependency

Removed

  • Deprecated Savings endpoints:

    • GET /sapi/v1/lending/daily/product/list
    • GET /sapi/v1/lending/daily/userLeftQuota
    • POST /sapi/v1/lending/daily/purchase
    • GET /sapi/v1/lending/daily/userRedemptionQuota
    • POST /sapi/v1/lending/daily/redeem
    • GET /sapi/v1/lending/daily/token/position
    • GET /sapi/v1/lending/project/list
    • POST /sapi/v1/lending/customizedFixed/purchase
    • GET /sapi/v1/lending/union/account
    • GET /sapi/v1/lending/union/purchaseRecord
    • GET /sapi/v1/lending/union/redemptionRecord
    • GET /sapi/v1/lending/union/interestHistory
    • GET /sapi/v1/lending/project/position/list
  • Deprecated Staking endpoints:

    • GET /sapi/v1/staking/productList
    • POST /sapi/v1/staking/purchase
    • POST /sapi/v1/staking/redeem
    • GET /sapi/v1/staking/position
    • GET /sapi/v1/staking/stakingRecord
    • POST /sapi/v1/staking/setAutoStaking
    • GET /sapi/v1/staking/personalLeftQuota
  • Deprecated BSwap endpoints:

    • GET /sapi/v1/bswap/pools
    • GET /sapi/v1/bswap/liquidity
    • POST /sapi/v1/bswap/liquidityAdd
    • POST /sapi/v1/bswap/liquidityRemove
    • GET /sapi/v1/bswap/liquidityOps
    • GET /sapi/v1/bswap/quote
    • POST /sapi/v1/bswap/swap
    • GET /sapi/v1/bswap/swap
    • GET /sapi/v1/bswap/poolConfigure
    • GET /sapi/v1/bswap/addLiquidityPreview
    • GET /sapi/v1/bswap/removeLiquidityPreview
    • GET /sapi/v1/bswap/unclaimedRewards
    • POST /sapi/v1/bswap/claimRewards
    • GET /sapi/v1/bswap/claimedHistory

3.1.0 - 2023-12-18

Added

  • Add Auto Invest endpoints:
    • GET /sapi/v1/margin/available-inventory Query margin available inventory
    • POST /sapi/v1/margin/manual-liquidation Margin manual liquidation

Changed

  • Update dependencies

Removed

  • GET /sapi/v1/futures/loan/borrow/history
  • GET /sapi/v1/futures/loan/repay/history
  • GET /sapi/v2/futures/loan/wallet
  • GET /sapi/v1/futures/loan/adjustCollateral/history
  • GET /sapi/v1/futures/loan/liquidationHistory
  • GET /sapi/v1/futures/loan/interestHistory

3.0.0 - 2023-10-20

Changed

  • Update README #142
  • Minor changes #143
  • Update package
  • Update Nodejs versions in pipeline

3.0.0-rc.2 - 2023-05-03

Added

  • Support Ed25519 key signature

v3.0.0-rc1 - 2023-04-20

Added

  • Add Spot Websocket API

Updated

  • Redesign the Websocket Stream and rename stream methods
  • Upgrade dependencies

v2.0.1 - 2023-02-22

Updated

  • Fixed WebSocket onClose event issue

v2.0.0 - 2023-01-31

Updated

  • Pump dependencies version

v2.0.0-rc.4 - 2022-11-22

Added

  • Support RSA key signature.

v2.0.0-rc.3 - 2022-10-12

Added

  • New endpoint
    • GET /api/v3/uiKlines

Changed

  • Add new optional parameter type to GET /api/v3/ticker and GET /api/v3/ticker/24hr

v2.0.0-rc.2 - 2022-10-04

Changed

  • Delete endpoints for Futures Cross Collateral
    • POST /sapi/v1/futures/loan/borrow
    • POST /sapi/v1/futures/loan/repay
    • GET /sapi/v2/futures/loan/configs
    • GET /sapi/v2/futures/loan/calcAdjustLevel
    • GET /sapi/v1/futures/loan/calcMaxAdjustAmount
    • GET /sapi/v2/futures/loan/calcMaxAdjustAmount
    • POST /sapi/v2/futures/loan/adjustCollateral
    • GET /sapi/v1/futures/loan/collateralRepayLimit
    • GET /sapi/v1/futures/loan/collateralRepay
    • POST /sapi/v1/futures/loan/collateralRepay
    • GET /sapi/v1/futures/loan/collateralRepayResult
  • Fixing asset in the endpoints that should not be mandatory #107
    • GET /sapi/v1/lending/daily/token/position
    • GET /sapi/v1/lending/project/position/list

v2.0.0-rc.1 - 2022-08-29

  • Support timeout
  • Support proxy
  • Support httpsAgent
  • Enable strict mode
  • Improve Websocket
    • Add pingServer method

v.1.13.0 - 2022-08-12

Added

  • New endpoint for Portfolio Margin:
    • GET /sapi/v1/portfolio/pmLoan to query Portfolio Margin Bankruptcy Loan Record.
    • POST /sapi/v1/portfolio/repay to repay Portfolio Margin Bankruptcy Loan.
    • GET /sapi/v1/portfolio/collateralRate to get Portfolio Margin Collateral Rate.

Changed

  • Changed endpoints for Trade:
    • POST /api/v3/order/test New optional fields strategyId and strategyType.
    • POST /api/v3/order New optional fields strategyId and strategyType.
    • POST /api/v3/order/cancelReplace New optional fields strategyId and strategyType.
    • POST /api/v3/order/oco New optional fields limitStrategyId, limitStrategyType, stopStrategyId and stopStrategyType.

v.1.12.0 - 2022-07-19

Added

  • New endpoint for Margin:

    • POST /sapi/v3/asset/getUserAsset to get user assets.
  • New endpoint for Wallet:

    • GET /sapi/v1/margin/dribblet to query the historical information of user's margin account small-value asset conversion BNB.

v.1.11.0 - 2022-07-04

Added

  • <symbol>@ticker_<window-size> Individual symbol rolling window ticker streams.
  • !ticker_<window-size>@arr All market rolling window ticker streams
  • GET /api/v3/ticker for rolling window price change statistics based on windowSize provided.
  • POST /api/v3/order/cancelReplace to cancel an existing order and place a new order on the same symbol.

Changed

  • GET /sapi/v1/fiat/orders: Weight changes from IP(1) to UID(90000)
  • GET /sapi/v1/pay/transactions: Param names changed: startTimestamp -> startTime; endTimestamp -> endTime.

Fixed

  • Updated jest from ^26.0.1 to ^28.1.2 to resolve jsdom security issue GHSA-f4c9-cqv8-9v98.

v.1.10.0 - 2022-05-23

Added

  • GET /sapi/v1/giftcard/cryptography/rsa-public-key to fetch RSA public key.
  • GET /sapi/v1/staking/productList to get Staking product list
  • POST /sapi/v1/staking/purchase to stake product
  • POST /sapi/v1/staking/redeem to redeem product
  • GET /sapi/v1/staking/position to get Staking product holding position
  • GET /sapi/v1/staking/stakingRecord to inquiry Staking history records
  • POST /sapi/v1/staking/setAutoStaking to set Auto Staking function
  • GET /sapi/v1/staking/personalLeftQuota to inquiry Staking left quota

Changed

  • POST /sapi/v1/giftcard/redeemCode: new optional parameter externalUid. Each external unique ID represents a unique user on the partner platform. The function helps you to identify the redemption behavior of different users.
  • GET /api/v3/ticker/24hr, GET /api/v3/ticker/price and GET /api/v3/ticker/bookTicker new optional parameter symbols.

v.1.9.2 - 2022-05-05

Added

  • GET /sapi/v1/managed-subaccount/accountSnapshot to support investor master account query asset snapshot of managed sub-account.
  • GET /sapi/v1/margin/rateLimit/order to display the user's current margin order count usage for all intervals.
  • GET /sapi/v1/portfolio/account to support query portfolio margin account info.

Changed

  • POST /sapi/v1/bswap/liquidityAdd - New optional parameter type
  • POST /sapi/v1/sub-account/universalTransfer - New transfer types MARGIN,ISOLATED_MARGIN and parameter symbol
  • GET /api/v3/depth - The limit value can be outside of the previous values (i.e. 5, 10, 20, 50, 100, 500, 1000, 5000). The limit still cannot exceed 5000.
  • POST /api/v3/order, POST /api/v3/order/test and /api/v3/order/oco - New optional parameter trailingDelta

v1.8.0 - 2022-02-24

Added

  • POST /sapi/v1/giftcard/createCode to create a code for Binance Gift Card
  • POST /sapi/v1/giftcard/redeemCode to redeem a code for Binance Gift Card
  • GET /sapi/v1/giftcard/verify to verify a code for Binance Gift Card
  • POST /sapi/v1/asset/dust-btc to get assets that can be converted into BNB

Fixed

  • npm audit upgrades

v1.7.0 - 2022-01-13

Added

  • GET /sapi/v1/mining/payment/uid to get Mining account earning
  • GET /sapi/v1/bswap/unclaimedRewards to get unclaimed rewards record
  • POST /sapi/v1/bswap/claimRewards to claim swap rewards or liquidity rewards
  • GET /sapi/v1/bswap/claimedHistory to get history of claimed rewards
  • POST /sapi/v1/sub-account/universalTransfer to transfer spot and futures asset between master account and sub accounts
  • GET /sapi/v1/sub-account/universalTransfer to search transfer records
  • GET /sapi/v2/sub-account/futures/account to get detail on sub-account's USDT margined futures account and COIN margined futures account
  • GET /sapi/v2/sub-account/futures/accountSummary to get summary of sub-account's USDT margined futures account and COIN margined futures account
  • GET /sapi/v2/sub-account/futures/positionRisk to get position risk of sub-account's USDT margined futures account and COIN margined futures account

v1.6.0 - 2021-12-07

Added

  • GET /api/v3/rateLimit/order to get the current order count usage for all intervals
  • GET /sapi/v1/loan/income to support user query crypto loans history
  • POST /sapi/v1/sub-account/subAccountApi/ipRestriction to support master account enable and disable IP restriction for a sub-account API Key
  • POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList to support master account add IP list for a sub-account API Key
  • GET /sapi/v1/sub-account/subAccountApi/ipRestriction to support master account query IP restriction for a sub-account API Key
  • DELETE /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList to support master account delete IP list for a sub-account API Key
  • GET /sapi/v1/pay/transactions to support user query Pay trade history
  • GET /sapi/v1/convert/tradeFlow to support user query convert trade history records
  • GET /sapi/v1/rebate/taxQuery to support user query spot rebate history records
  • GET /sapi/v1/margin/crossMarginData to get cross margin fee data collection
  • GET /sapi/v1/margin/isolatedMarginData to get isolated margin fee data collection
  • GET /sapi/v1/margin/isolatedMarginTier to get isolated margin tier data collection
  • GET /sapi/v1/nft/history/transactions to get NFT transaction history
  • GET /sapi/v1/nft/history/deposit to get NFT deposit history
  • GET /sapi/v1/nft/history/withdraw to get NFT withdraw history
  • GET /sapi/v1/nft/user/getAsset to get NFT asset

Fixed

  • npm audit upgrades

v1.5.0 - 2021-10-01

Added

  • GET /sapi/v1/bswap/poolConfigure to get pool configure
  • GET /sapi/v1/bswap/addLiquidityPreview to get add liquidity preview
  • GET /sapi/v1/margin/isolated/accountLimit to get remove liquidity preview
  • Axios version upgrade to 0.21.4

v1.4.0 - 2021-09-14

Added

  • GET /sapi/v1/capital/withdraw/history has a new optional field withdrawOrderId
  • DELETE /sapi/v1/margin/isolated/account to disable isolated margin account for a specific symbol
  • POST /sapi/v1/margin/isolated/account to enable isolated margin account for a specific symbol
  • GET /sapi/v1/margin/isolated/accountLimit to query enabled isolated margin account limit

v1.3.1 - 2021-09-02

Fix

  • Fix on websocket close event detection logic

v1.3.0 - 2021-08-31

Added

  • POST /sapi/v1/asset/transfer and GET /sapi/v1/asset/transfer optional fields fromSymbol, toSymbol
  • POST /sapi/v1/margin/order/oco create a margin account OCO order
  • DELETE /sapi/v1/margin/orderList cancel a margin account OCO order
  • GET /sapi/v1/margin/orderList query OCO orders under a margin account
  • GET /sapi/v1/margin/allOrderList query all OCO orders under a margin account
  • GET /sapi/v1/margin/openOrderList query open OCO orders under a margin account

v1.2.0 - 2021-08-20

Added

  • GET /sapi/v1/c2c/orderMatch/listUserOrderHistory to query user C2C trade history
  • GET api/v3/myTrades has a new optional field orderId

v1.1.0 - 2021-08-12

Added

  • GET /sapi/v1/fiat/orders to query user fiat deposit and withdraw history
  • GET /sapi/v1/fiat/payments to query user fiat payments history

v1.0.0 - 2021-07-27

Added

  • First release, please find details from README.md