Binance Connector JS
    Preparing search index...
    Index

    Constructors

    Methods

    accountBalance accountInformation bnbTransfer cancelAllCmOpenConditionalOrders cancelAllCmOpenOrders cancelAllUmAlgoOpenOrders cancelAllUmOpenConditionalOrders cancelAllUmOpenOrders cancelCmConditionalOrder cancelCmOrder cancelMarginAccountAllOpenOrdersOnASymbol cancelMarginAccountOcoOrders cancelMarginAccountOrder cancelUmAlgoOrder cancelUmConditionalOrder cancelUmOrder changeAutoRepayFuturesStatus changeCmInitialLeverage changeCmPositionMode changeUmInitialLeverage changeUmPositionMode closeUserDataStream cmAccountTradeList cmNotionalAndLeverageBrackets cmPositionAdlQuantileEstimation fundAutoCollection fundCollectionByAsset futuresTradfiPerpsContract getAutoRepayFuturesStatus getCmAccountDetail getCmCurrentPositionMode getCmIncomeHistory getDownloadIdForUmFuturesOrderHistory getDownloadIdForUmFuturesTradeHistory getDownloadIdForUmFuturesTransactionHistory getMarginBorrowLoanInterestHistory getUmAccountDetail getUmAccountDetailV2 getUmCurrentPositionMode getUmFuturesBnbBurnStatus getUmFuturesOrderDownloadLinkById getUmFuturesTradeDownloadLinkById getUmFuturesTransactionDownloadLinkById getUmIncomeHistory getUserCommissionRateForCm getUserCommissionRateForUm keepaliveUserDataStream marginAccountBorrow marginAccountNewOco marginAccountRepay marginAccountRepayDebt marginAccountTradeList marginMaxBorrow modifyCmOrder modifyUmOrder newCmConditionalOrder newCmOrder newMarginOrder newUmAlgoOrder newUmConditionalOrder newUmOrder portfolioMarginUmTradingQuantitativeRulesIndicators queryAllCmConditionalOrders queryAllCmOrders queryAllCurrentCmOpenConditionalOrders queryAllCurrentCmOpenOrders queryAllCurrentUmOpenAlgoOrders queryAllCurrentUmOpenConditionalOrders queryAllCurrentUmOpenOrders queryAllMarginAccountOrders queryAllUmConditionalOrders queryAllUmOrders queryCmConditionalOrderHistory queryCmModifyOrderHistory queryCmOrder queryCmPositionInformation queryCurrentCmOpenConditionalOrder queryCurrentCmOpenOrder queryCurrentMarginOpenOrder queryCurrentUmOpenAlgoOrder queryCurrentUmOpenConditionalOrder queryCurrentUmOpenOrder queryMarginAccountOrder queryMarginAccountsAllOco queryMarginAccountsOco queryMarginAccountsOpenOco queryMarginLoanRecord queryMarginMaxWithdraw queryMarginRepayRecord queryPortfolioMarginNegativeBalanceInterestHistory queryUmAlgoOrderHistory queryUmConditionalOrderHistory queryUmModifyOrderHistory queryUmOrder queryUmPositionInformation queryUserNegativeBalanceAutoExchangeRecord queryUserRateLimit queryUsersCmForceOrders queryUsersMarginForceOrders queryUsersUmForceOrders repayFuturesNegativeBalance sendRequest sendSignedRequest startUserDataStream testConnectivity toggleBnbBurnOnUmFuturesTrade umAccountTradeList umFuturesAccountConfiguration umFuturesSymbolConfiguration umNotionalAndLeverageBrackets umPositionAdlQuantileEstimation

    Constructors

    Methods

    • Get Margin Borrow/Loan Interest History

      Response in descending order The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness. If startTime and endTime not sent, return records of the last 7 days by default If startTime is sent and endTime is not sent, the records from startTime to the present will be returned; if startTime is more than 30 days ago, the records of the past 30 days will be returned. If startTime is not sent and endTime is sent, the records of the 7 days before endTime is returned. Type in response has 5 enums: PERIODIC interest charged per hour ON_BORROW first interest charged on borrow PERIODIC_CONVERTED interest charged per hour converted into BNB ON_BORROW_CONVERTED first interest charged on borrow converted into BNB PORTFOLIO Portfolio Margin negative balance daily interest

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<GetMarginBorrowLoanInterestHistoryResponse>>

    • Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

      Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent. Both quantity and price must be sent When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is. However the order will be cancelled by the amendment in the following situations: when the order is in partially filled status and the new quantity <= executedQty When the order is GTX and the new price will cause it to be executed immediately

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<ModifyCmOrderResponse>>

    • Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue

      Either orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent. Both quantity and price must be sent When the new quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is. However the order will be cancelled by the amendment in the following situations: when the order is in partially filled status and the new quantity <= executedQty When the order is GTX and the new price will cause it to be executed immediately

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<ModifyUmOrderResponse>>

    • New CM Conditional Order

      Order with type STOP/TAKE_PROFIT, parameter timeInForce can be sent ( default GTC). Condition orders will be triggered when: STOP, STOP_MARKET: BUY: "MARK_PRICE" >= stopPrice SELL: "MARK_PRICE" <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: "MARK_PRICE" <= stopPrice SELL: "MARK_PRICE" >= stopPrice TRAILING_STOP_MARKET: BUY: the lowest mark price after order placed <= activationPrice, and the latest mark price >= the lowest mark price * (1 + callbackRate) SELL: the highest mark price after order placed >= activationPrice, and the latest mark price <= the highest mark price * (1 - callbackRate) 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 mark price. SELL: activationPrice should be larger than latest mark price. 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") <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<NewCmConditionalOrderResponse>>

    • Place new UM conditional order

      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") <= triggerPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= triggerPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= triggerPrice TRAILING_STOP_MARKET: BUY: the lowest price after order placed <= activatePrice, and the latest price >= the lowest price * (1 + callbackRate) SELL: the highest price after order placed >= activatePrice, and the latest price <= the highest price * (1 - callbackRate)

      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.

      selfTradePreventionMode is only effective when timeInForce set to IOC or GTC or GTD.

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<NewUmAlgoOrderResponse>>

    • Place new UM conditional order

      Order with type STOP/TAKE_PROFIT, parameter timeInForce can be sent ( default GTC). Condition orders will be triggered when: STOP, STOP_MARKET: BUY: "MARK_PRICE" >= stopPrice SELL: "MARK_PRICE" <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: "MARK_PRICE" <= stopPrice SELL: "MARK_PRICE" >= stopPrice TRAILING_STOP_MARKET: BUY: the lowest mark price after order placed <= activationPrice, and the latest mark price >= the lowest mark price * (1 + callbackRate) SELL: the highest mark price after order placed >= activationPrice, and the latest mark price <= the highest mark price * (1 - callbackRate) 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 mark price. SELL: activationPrice should be larger than latest mark price. 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") <= stopPrice TAKE_PROFIT, TAKE_PROFIT_MARKET: BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <= stopPrice SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice 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

      Weight: 1

      Parameters

      Returns Promise<RestApiResponse<NewUmConditionalOrderResponse>>

    • 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.