Futures Account and Trading

Documentation on interacting with Mexc's Futures Account and Trading API functions through the PENDAX Javascript SDK.

Get all informations of user's asset

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset

Function Name:

getUserAssetInfoFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getUserAssetInfoFutures(exchange, options) {
    try {
        let result = await exchange.getUserAssetInfoFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUserAssetInfoFutures(myMexcExchanges);

Get the user's single currency asset information

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-single-currency-asset-information

Function Name:

getUserSingleCurrencyAssetInfoFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getUserSingleCurrencyAssetInfoFutures(exchange, options) {
    try {
        let result = await exchange.getUserSingleCurrencyAssetInfoFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUserSingleCurrencyAssetInfoFutures(myMexcExchanges, 
         {
             currency: "USDT"
         });

Get the user's asset transfer records

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records

Function Name:

getUserAssetTransferRecordsFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getUserAssetTransferRecordsFutures(exchange, options) {
    try {
        let result = await exchange.getUserAssetTransferRecordsFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUserAssetTransferRecordsFutures(myMexcExchanges, 
         {
             page_size: "10",
             currency: "USDT"
         });

Get the user’s history position information

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information

Function Name:

getHistoryPositionInformationFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getHistoryPositionInformationFutures(exchange, options) {
    try {
        let result = await exchange.getHistoryPositionInformationFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getHistoryPositionInformationFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT"
         });

Get the user's current holding position

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-holding-position

Function Name:

getCurrentHoldingPositionFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getCurrentHoldingPositionFutures(exchange, options) {
    try {
        let result = await exchange.getCurrentHoldingPositionFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getCurrentHoldingPositionFutures(myMexcExchanges);

Get details of user‘s funding rate

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate

Function Name:

getUserFundingRateDetails()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getUserFundingRateDetails(exchange, options) {
    try {
        let result = await exchange.getUserFundingRateDetails(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUserFundingRateDetails(myMexcExchanges);

Get the user's current pending order

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-pending-order

Function Name:

getUserCurrentPendingOrderFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getUserCurrentPendingOrderFutures(exchange, options) {
    try {
        let result = await exchange.getUserCurrentPendingOrderFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUserCurrentPendingOrderFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT"
         });

Get all of the user's historical orders

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders

Function Name:

getAllUserHistoricalOrdersFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getAllUserHistoricalOrdersFutures(exchange, options) {
    try {
        let result = await exchange.getAllUserHistoricalOrdersFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAllUserHistoricalOrdersFutures(myMexcExchanges);

Query the order based on the external number

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-external-number

Function Name:

getOrderByExternalNumberFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getOrderByExternalNumberFutures(exchange, options) {
    try {
        let result = await exchange.getOrderByExternalNumberFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderByExternalNumberFutures(myMexcExchanges,
         {
             symbol: "ETH_USDT",
             external_oid: "_m_f95eb99b061d4eef8f64a04e9ac4dad3"
         });

Query the order based on the order number

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number

Function Name:

getOrderByOrderNumberFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getOrderByOrderNumberFutures(exchange, options) {
    try {
        let result = await exchange.getOrderByOrderNumberFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderByOrderNumberFutures(myMexcExchanges,
         {
             order_id: "102015012431820288"
         });

Get order transaction details based on the order ID

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-order-transaction-details-based-on-the-order-id

Function Name:

getOrderTransactionDetailsByOIDFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getOrderTransactionDetailsByOIDFutures(exchange, options) {
    try {
        let result = await exchange.getOrderTransactionDetailsByOIDFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderTransactionDetailsByOIDFutures(myMexcExchanges,
         {
             order_id: "102015012431820288"
         });

Get all transaction details of the user’s order

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order

Function Name:

getAllTranscationDetailsUserOrderFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getAllTranscationDetailsUserOrderFutures(exchange, options) {
    try {
        let result = await exchange.getAllTranscationDetailsUserOrderFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAllTranscationDetailsUserOrderFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Gets the trigger order list

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list

Function Name:

getTriggerOrderListFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getTriggerOrderListFutures(exchange, options) {
    try {
        let result = await exchange.getTriggerOrderListFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getTriggerOrderListFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get the Stop-Limit order list

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-stop-limit-order-list

Function Name:

getStopLimitOrderListFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getStopLimitOrderListFutures(exchange, options) {
    try {
        let result = await exchange.getStopLimitOrderListFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getStopLimitOrderListFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get risk limits

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-risk-limits

Function Name:

getRiskLimitsFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getRiskLimitsFutures(exchange, options) {
    try {
        let result = await exchange.getRiskLimitsFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getRiskLimitsFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Increase or decrease margin

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin

Function Name:

changeMarginFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function changeMarginFutures(exchange, options) {
    try {
        let result = await exchange.changeMarginFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await changeMarginFutures(myMexcExchanges,
         {
             positionId: "134321",
             amount: "1",
             type: "ADD"
         });

Get leverage

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-leverage

Function Name:

getLeverageFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getLeverageFutures(exchange, options) {
    try {
        let result = await exchange.getLeverageFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getLeverageFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get position mode

Please refer to the official Mexc API Docs for the Required parameters.

https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode

Function Name:

getPositionModeFutures()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myMexcExchanges  = createExchange({
      exchange: "mexc",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "mexc"
  });

async function getPositionModeFutures(exchange, options) {
    try {
        let result = await exchange.getPositionModeFutures(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getPositionModeFutures(myMexcExchanges);

Last updated