Binance Connector JS
    Preparing search index...
    Index

    Constructors

    Methods

    acceptTheOfferedQuote accountInformationV2 accountInformationV3 accountTradeList adlRisk allOrders assetIndex autoCancelAllOpenOrders basis cancelAlgoOrder cancelAllAlgoOpenOrders cancelAllOpenOrders cancelMultipleOrders cancelOrder changeInitialLeverage changeMarginType changeMultiAssetsMode changePositionMode checkServerTime classicPortfolioMarginAccountInformation closeUserDataStream compositeIndexSymbolInformation compressedAggregateTradesList continuousContractKlineCandlestickData currentAllAlgoOpenOrders currentAllOpenOrders exchangeInformation futuresAccountBalanceV2 futuresAccountBalanceV3 futuresAccountConfiguration futuresTradfiPerpsContract futuresTradingQuantitativeRulesIndicators getBnbBurnStatus getCurrentMultiAssetsMode getCurrentPositionMode getDownloadIdForFuturesOrderHistory getDownloadIdForFuturesTradeHistory getDownloadIdForFuturesTransactionHistory getFundingRateHistory getFundingRateInfo getFuturesOrderHistoryDownloadLinkById getFuturesTradeDownloadLinkById getFuturesTransactionHistoryDownloadLinkById getIncomeHistory getOrderModifyHistory getPositionMarginChangeHistory indexPriceKlineCandlestickData keepaliveUserDataStream klineCandlestickData listAllConvertPairs longShortRatio markPrice markPriceKlineCandlestickData modifyIsolatedPositionMargin modifyMultipleOrders modifyOrder newAlgoOrder newOrder notionalAndLeverageBrackets oldTradesLookup openInterest openInterestStatistics orderBook orderStatus placeMultipleOrders positionAdlQuantileEstimation positionInformationV2 positionInformationV3 premiumIndexKlineData quarterlyContractSettlementPrice queryAlgoOrder queryAllAlgoOrders queryCurrentOpenOrder queryIndexPriceConstituents queryInsuranceFundBalanceSnapshot queryOrder queryUserRateLimit recentTradesList rpiOrderBook sendQuoteRequest sendRequest sendSignedRequest startUserDataStream symbolConfiguration symbolOrderBookTicker symbolPriceTicker symbolPriceTickerV2 takerBuySellVolume testConnectivity testOrder ticker24hrPriceChangeStatistics toggleBnbBurnOnFuturesTrade topTraderLongShortRatioAccounts topTraderLongShortRatioPositions tradingSchedule userCommissionRate usersForceOrders

    Constructors

    Methods

    • Send in a new algo (conditional) order. Use this endpoint to place TP/SL (Take Profit / Stop Loss) and trailing stop orders on USD-M Futures. Supported order types under algoType=CONDITIONAL are STOP_MARKET, TAKE_PROFIT_MARKET, STOP, TAKE_PROFIT, and TRAILING_STOP_MARKET.

      Weight: 1 on 10s order rate limit(X-MBX-ORDER-COUNT-10S); 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M); 0 on IP rate limit(x-mbx-used-weight-1m)

      Security Type: TRADE

      Notes:

      • Algo order with type STOP, parameter timeInForce can be sent (default GTC).
      • Algo order with type TAKE_PROFIT, parameter timeInForce can be sent ( default GTC).
      • Condition orders will be triggered when:
      • If parameterpriceProtectis sent as true:
      • when price reaches the triggerPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
      • "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo
      • STOP, STOP_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
      • TAKE_PROFIT, TAKE_PROFIT_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice
      • TRAILING_STOP_MARKET:
      • BUY: the lowest price after order placed = the lowest price * (1 + callbackRate)
      • SELL: the highest price after order placed >= activatePrice, and the latest price
      • For TRAILING_STOP_MARKET, if you got such error code. > {"code": -2021, "msg": "Order would immediately trigger."} > means that the parameters you send do not meet the following requirements:
      • BUY: activatePrice should be smaller than latest price.
      • SELL: activatePrice should be larger than latest price.
      • STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:
      • Follow the same rules for condition orders.
      • If triggered,close all current long position( if SELL) or current short position( if BUY).
      • Cannot be used with quantity paremeter
      • Cannot be used with reduceOnly parameter
      • In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side
      • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.

      Parameters

      Returns Promise<
          RestApiResponse<
              DerivativesTradingUsdsFuturesRestAPI.NewAlgoOrderResponse,
          >,
      >

    • Generic function to send a request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.

    • Generic function to send a signed request.

      Type Parameters

      • T

      Parameters

      • endpoint: string

        The API endpoint to call.

      • method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH"

        HTTP method to use (GET, POST, DELETE, etc.).

      • queryParams: Record<string, unknown> = {}

        Query parameters for the request.

      • bodyParams: Record<string, unknown> = {}

        Body parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.

    • Testing order request, this order will not be submitted to matching engine

      Security Type: TRADE

      Notes: Additional mandatory parameters based on type:

      Type Additional mandatory parameters
      LIMIT timeInForce, quantity, price
      MARKET quantity
      STOP/TAKE_PROFIT quantity, price, stopPrice
      STOP_MARKET/TAKE_PROFIT_MARKET stopPrice
      TRAILING_STOP_MARKET callbackRate
      • Order with type STOP, parameter timeInForce can be sent ( default GTC).
      • Order with type TAKE_PROFIT, parameter timeInForce can be sent (default GTC).
      • Condition orders will be triggered when:
      • If parameterpriceProtectis sent as true:
      • when price reaches the stopPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
      • "triggerProtect" of a symbol can be got from GET /fapi/v1/exchangeInfo
      • STOP, STOP_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
      • TAKE_PROFIT, TAKE_PROFIT_MARKET:
      • BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
      • SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
      • TRAILING_STOP_MARKET:
      • BUY: the lowest price after order placed ``= the lowest price * (1 + callbackRate)
      • SELL: the highest price after order placed >= activationPrice, and the latest price
      • For TRAILING_STOP_MARKET, if you got such error code. > {"code": -2021, "msg": "Order would immediately trigger."} > means that the parameters you send do not meet the following requirements:
      • BUY: activationPrice should be smaller than latest price.
      • SELL: activationPrice should be larger than latest price.
      • If newOrderRespType is sent as RESULT :
      • MARKET order: the final FILLED result of the order will be return directly.
      • LIMIT order with special timeInForce: the final status result of the order(FILLED or EXPIRED) will be returned directly.
      • STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:
      • Follow the same rules for condition orders.
      • If triggered,close all current long position( if SELL) or current short position( if BUY).
      • Cannot be used with quantity paremeter
      • Cannot be used with reduceOnly parameter
      • In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side
      • selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.
      • In extreme market conditions, timeInForce GTD order auto cancel time might be delayed comparing to goodTillDate

      Parameters

      Returns Promise<RestApiResponse<TestOrderResponse>>

    • Trading session schedules for the underlying assets of TradFi Perps are provided for a one-week period forward and one-week period backward starting from the day prior to the query time, covering the U.S. equity market, Korean equity market, Hong Kong equity market, and the commodity market.

      Session types per market:

      • U.S. equity market: "PRE_MARKET", "REGULAR", "AFTER_MARKET", "OVERNIGHT", "NO_TRADING".
      • Commodity market: "REGULAR", "NO_TRADING".
      • Korean equity market: "REGULAR", "NO_TRADING".
      • Hong Kong equity market: "REGULAR", "NO_TRADING".

      Weight(IP): 5

      Returns Promise<RestApiResponse<TradingScheduleResponse>>