Binance Connector JS
    Preparing search index...

    TradeApi - interface TradeApi

    interface TradeApiInterface {
        createSpecialKey(
            requestParameters: CreateSpecialKeyRequest,
        ): Promise<RestApiResponse<CreateSpecialKeyResponse>>;
        deleteSpecialKey(
            requestParameters?: DeleteSpecialKeyRequest,
        ): Promise<RestApiResponse<void>>;
        editIpForSpecialKey(
            requestParameters: EditIpForSpecialKeyRequest,
        ): Promise<RestApiResponse<void>>;
        getForceLiquidationRecord(
            requestParameters?: GetForceLiquidationRecordRequest,
        ): Promise<RestApiResponse<GetForceLiquidationRecordResponse>>;
        getSmallLiabilityExchangeCoinList(
            requestParameters?: GetSmallLiabilityExchangeCoinListRequest,
        ): Promise<RestApiResponse<GetSmallLiabilityExchangeCoinListResponse>>;
        getSmallLiabilityExchangeHistory(
            requestParameters: GetSmallLiabilityExchangeHistoryRequest,
        ): Promise<RestApiResponse<GetSmallLiabilityExchangeHistoryResponse>>;
        marginAccountCancelAllOpenOrdersOnASymbol(
            requestParameters: MarginAccountCancelAllOpenOrdersOnASymbolRequest,
        ): Promise<
            RestApiResponse<MarginAccountCancelAllOpenOrdersOnASymbolResponse>,
        >;
        marginAccountCancelOco(
            requestParameters: MarginAccountCancelOcoRequest,
        ): Promise<RestApiResponse<MarginAccountCancelOcoResponse>>;
        marginAccountCancelOrder(
            requestParameters: MarginAccountCancelOrderRequest,
        ): Promise<RestApiResponse<MarginAccountCancelOrderResponse>>;
        marginAccountNewOco(
            requestParameters: MarginTradingRestAPI.MarginAccountNewOcoRequest,
        ): Promise<
            RestApiResponse<MarginTradingRestAPI.MarginAccountNewOcoResponse>,
        >;
        marginAccountNewOrder(
            requestParameters: MarginAccountNewOrderRequest,
        ): Promise<RestApiResponse<MarginAccountNewOrderResponse>>;
        marginAccountNewOto(
            requestParameters: MarginAccountNewOtoRequest,
        ): Promise<RestApiResponse<MarginAccountNewOtoResponse>>;
        marginAccountNewOtoco(
            requestParameters: MarginAccountNewOtocoRequest,
        ): Promise<RestApiResponse<MarginAccountNewOtocoResponse>>;
        marginManualLiquidation(
            requestParameters: MarginManualLiquidationRequest,
        ): Promise<RestApiResponse<MarginManualLiquidationResponse>>;
        queryCurrentMarginOrderCountUsage(
            requestParameters?: QueryCurrentMarginOrderCountUsageRequest,
        ): Promise<RestApiResponse<QueryCurrentMarginOrderCountUsageResponse>>;
        queryMarginAccountsAllOco(
            requestParameters?: MarginTradingRestAPI.QueryMarginAccountsAllOcoRequest,
        ): Promise<
            RestApiResponse<MarginTradingRestAPI.QueryMarginAccountsAllOcoResponse>,
        >;
        queryMarginAccountsAllOrders(
            requestParameters: QueryMarginAccountsAllOrdersRequest,
        ): Promise<RestApiResponse<QueryMarginAccountsAllOrdersResponse>>;
        queryMarginAccountsOco(
            requestParameters?: MarginTradingRestAPI.QueryMarginAccountsOcoRequest,
        ): Promise<
            RestApiResponse<MarginTradingRestAPI.QueryMarginAccountsOcoResponse>,
        >;
        queryMarginAccountsOpenOco(
            requestParameters?: MarginTradingRestAPI.QueryMarginAccountsOpenOcoRequest,
        ): Promise<
            RestApiResponse<
                MarginTradingRestAPI.QueryMarginAccountsOpenOcoResponse,
            >,
        >;
        queryMarginAccountsOpenOrders(
            requestParameters?: QueryMarginAccountsOpenOrdersRequest,
        ): Promise<RestApiResponse<QueryMarginAccountsOpenOrdersResponse>>;
        queryMarginAccountsOrder(
            requestParameters: QueryMarginAccountsOrderRequest,
        ): Promise<RestApiResponse<QueryMarginAccountsOrderResponse>>;
        queryMarginAccountsTradeList(
            requestParameters: QueryMarginAccountsTradeListRequest,
        ): Promise<RestApiResponse<QueryMarginAccountsTradeListResponse>>;
        querySpecialKey(
            requestParameters?: QuerySpecialKeyRequest,
        ): Promise<RestApiResponse<QuerySpecialKeyResponse>>;
        querySpecialKeyList(
            requestParameters?: QuerySpecialKeyListRequest,
        ): Promise<RestApiResponse<QuerySpecialKeyListResponse>>;
        smallLiabilityExchange(
            requestParameters: SmallLiabilityExchangeRequest,
        ): Promise<RestApiResponse<void>>;
    }

    Implemented by

    Index

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

      TradeApiInterface

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

      TradeApiInterface

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

      TradeApiInterface

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

      TradeApiInterface