Binance Connector JS
    Preparing search index...
    Index

    Constructors

    Methods

    adjustCrossMarginMaxLeverage closeIsolatedMarginUserDataStream closeMarginUserDataStream closeUserDataStream createSpecialKey crossMarginCollateralRatio deleteSpecialKey disableIsolatedMarginAccount editIpForSpecialKey enableIsolatedMarginAccount getAllCrossMarginPairs getAllIsolatedMarginSymbol getAllMarginAssets getBnbBurnStatus getCrossMarginTransferHistory getDelistSchedule getForceLiquidationRecord getFutureHourlyInterestRate getInterestHistory getListSchedule getSmallLiabilityExchangeCoinList getSmallLiabilityExchangeHistory getSummaryOfMarginAccount keepaliveIsolatedMarginUserDataStream keepaliveMarginUserDataStream keepaliveUserDataStream marginAccountBorrowRepay marginAccountCancelAllOpenOrdersOnASymbol marginAccountCancelOco marginAccountCancelOrder marginAccountNewOco marginAccountNewOrder marginAccountNewOto marginAccountNewOtoco marginManualLiquidation queryBorrowRepayRecordsInMarginAccount queryCrossIsolatedMarginCapitalFlow queryCrossMarginAccountDetails queryCrossMarginFeeData queryCurrentMarginOrderCountUsage queryEnabledIsolatedMarginAccountLimit queryIsolatedMarginAccountInfo queryIsolatedMarginFeeData queryIsolatedMarginTierData queryLiabilityCoinLeverageBracketInCrossMarginProMode queryMarginAccountsAllOco queryMarginAccountsAllOrders queryMarginAccountsOco queryMarginAccountsOpenOco queryMarginAccountsOpenOrders queryMarginAccountsOrder queryMarginAccountsTradeList queryMarginAvailableInventory queryMarginInterestRateHistory queryMarginPriceindex queryMaxBorrow queryMaxTransferOutAmount querySpecialKey querySpecialKeyList sendRequest sendSignedRequest smallLiabilityExchange startIsolatedMarginUserDataStream startMarginUserDataStream startUserDataStream

    Constructors

    Methods

    • **Binance Margin offers low-latency trading through a special key, available exclusively to users with VIP level 4 or higher. **

      If you are VIP level 3 or below, please contact your VIP manager for eligibility criterias.*

      We support several types of API keys:

      Ed25519 (recommended) HMAC RSA

      We recommend to use Ed25519 API keys as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .

      Read REST API or WebSocket API documentation to learn how to use different API keys

      You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.

      Weight: 1(UID)

      Parameters

      Returns Promise<RestApiResponse<CreateSpecialKeyResponse>>

    • This only applies to Special Key for Low Latency Trading.

      If apiKey is given, apiName will be ignored. If apiName is given with no apiKey, all apikeys with given apiName will be deleted.

      You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.

      Weight: 1(UID)

      Parameters

      Returns Promise<RestApiResponse<void>>

    • Get Interest History

      Response in descending order If isolatedSymbol is not sent, crossed margin data will be returned The max interval between startTime and endTime is 30 days. It is a MUST to ensure data correctness. If startTimeand endTime not sent, return records of the last 7 days by default. If startTime is sent and endTime is not sent, return records of [max(startTime, now-30d), now]. If startTime is not sent and endTime is sent, return records of [endTime-7, endTime] type in response has 4 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 interest charged daily on the portfolio margin negative balance

      Weight: 1(IP)

      Parameters

      Returns Promise<RestApiResponse<GetInterestHistoryResponse>>

    • Post a new OTO order for margin account:

      • An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
      • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
      • The second order is called the pending order. It can be any order type except for MARKET orders using parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled.
      • If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
      • When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to query the status of the pending order again to see its updated status.
      • OTOs add 2 orders to the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.

      autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution Depending on the pendingType or workingType, some optional parameters will become mandatory:

      Weight: 6(UID)

      Parameters

      Returns Promise<RestApiResponse<MarginAccountNewOtoResponse>>

    • Post a new OTOCO order for margin account:

      • An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
      • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
      • The behavior of the working order is the same as the OTO.
      • OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
      • The rules of the pending above and pending below follow the same rules as the Order List OCO.
      • OTOCOs add 3 orders against the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter, and MAX_NUM_ORDERS filter.

      autoRepayAtCancel is suggested to set as “FALSE” to keep liability unrepaid under high frequent new order/cancel order execution Depending on the pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory:

      Weight: 6(UID)

      Parameters

      Returns Promise<RestApiResponse<MarginAccountNewOtocoResponse>>

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

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

        Query 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.).

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

        Query parameters for the request.

      Returns Promise<RestApiResponse<T>>

      A promise resolving to the response data object.