Binance Connector JS
    Preparing search index...

    TradeApi - interface TradeApi

    interface TradeApiInterface {
        accountTradeList(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.AccountTradeListRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.AccountTradeListResponse,
            >,
        >;
        allOrders(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.AllOrdersRequest,
        ): Promise<
            RestApiResponse<DerivativesTradingCoinFuturesRestAPI.AllOrdersResponse>,
        >;
        autoCancelAllOpenOrders(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.AutoCancelAllOpenOrdersRequest,
        ): Promise<RestApiResponse<void>>;
        cancelAllOpenOrders(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.CancelAllOpenOrdersRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.CancelAllOpenOrdersResponse,
            >,
        >;
        cancelMultipleOrders(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.CancelMultipleOrdersRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.CancelMultipleOrdersResponse,
            >,
        >;
        cancelOrder(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.CancelOrderRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.CancelOrderResponse,
            >,
        >;
        changeInitialLeverage(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ChangeInitialLeverageRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ChangeInitialLeverageResponse,
            >,
        >;
        changeMarginType(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ChangeMarginTypeRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ChangeMarginTypeResponse,
            >,
        >;
        changePositionMode(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ChangePositionModeRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ChangePositionModeResponse,
            >,
        >;
        currentAllOpenOrders(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.CurrentAllOpenOrdersRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.CurrentAllOpenOrdersResponse,
            >,
        >;
        getOrderModifyHistory(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.GetOrderModifyHistoryRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.GetOrderModifyHistoryResponse,
            >,
        >;
        getPositionMarginChangeHistory(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.GetPositionMarginChangeHistoryRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.GetPositionMarginChangeHistoryResponse,
            >,
        >;
        modifyIsolatedPositionMargin(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ModifyIsolatedPositionMarginRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ModifyIsolatedPositionMarginResponse,
            >,
        >;
        modifyMultipleOrders(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ModifyMultipleOrdersRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ModifyMultipleOrdersResponse,
            >,
        >;
        modifyOrder(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.ModifyOrderRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.ModifyOrderResponse,
            >,
        >;
        newOrder(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.NewOrderRequest,
        ): Promise<
            RestApiResponse<DerivativesTradingCoinFuturesRestAPI.NewOrderResponse>,
        >;
        positionAdlQuantileEstimation(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.PositionAdlQuantileEstimationRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.PositionAdlQuantileEstimationResponse,
            >,
        >;
        positionInformation(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.PositionInformationRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.PositionInformationResponse,
            >,
        >;
        queryCurrentOpenOrder(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.QueryCurrentOpenOrderRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.QueryCurrentOpenOrderResponse,
            >,
        >;
        queryOrder(
            requestParameters: DerivativesTradingCoinFuturesRestAPI.QueryOrderRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.QueryOrderResponse,
            >,
        >;
        usersForceOrders(
            requestParameters?: DerivativesTradingCoinFuturesRestAPI.UsersForceOrdersRequest,
        ): Promise<
            RestApiResponse<
                DerivativesTradingCoinFuturesRestAPI.UsersForceOrdersResponse,
            >,
        >;
    }

    Implemented by

    Index

    Methods

    • Cancel all open orders of the specified symbol at the end of the specified countdown. This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. The system will check all countdowns approximately every 10 milliseconds, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.

      Example usage: Call this endpoint at 30s intervals with an countdownTime of 120000 (120s). If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled. If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.

      Weight: 10

      Parameters

      Returns Promise<RestApiResponse<void>>

      TradeApiInterface

    • Send in a new order.

      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 /dapi/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 TRAILING_STOP_MARKET: BUY: the lowest price after order placed <= activationPrice, and the latest price >= the lowest price * (1 + callbackRate) SELL: the highest price after order placed >= activationPrice, 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: 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 parameter 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.

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

      Parameters

      Returns Promise<RestApiResponse<DerivativesTradingCoinFuturesRestAPI.NewOrderResponse>>

      TradeApiInterface