Compendium Trading Tools Documentation
CompendiumPENDAXCompendexOfficial Links
  • ⭐Platform Overview
  • ⚫PENDAX
    • 🌐What is PENDAX?
    • 🖱️PENDAX Capabilities
    • 💾Installing PENDAX modules
    • 💡Using PENDAX SDK
      • 💻Common Functions
      • 💻OKX Functions
        • Trading & Orders
        • Funding
        • Convert
        • Account & Subaccount
        • Grid Trading
        • Market Data
        • Public Data
        • Trading Data
      • 💻Bitget Functions
        • Public (Spot)
        • Market (Spot)
        • Wallet (Spot)
        • Account (Spot)
        • Trade (Spot)
        • Market (Futures)
        • Account (Futures)
        • Trade (Futures)
        • CopyTrade (Futures)
        • Sub Account Interface (Broker)
        • Sub API Interface (Broker)
      • 💻ByBit Functions
        • Market
        • Trading
        • Position
        • Account
        • Asset
        • User
        • Spot Leverage Token
        • Spot Margin Trade (UTA)
        • Spot Margin Trade (Normal)
        • Institutional Lending
      • 💻Mexc Functions
        • Market
        • Sub-Account
        • Spot Account/Trade
        • Wallet
        • ETF
        • Rebate
        • Futures Market
        • Futures Account and Trading
      • 💻Phemex Functions
        • Contract
        • Hedged Contract
        • Spot
        • Margin Trading
        • Transfer
        • Convert
        • Deposit And Withdraw
      • 💻BloFin Functions
        • Websocket
        • Account
        • Affiliate
        • Public Data
        • Trading
        • User
      • 💻BingX Functions
        • Fund Account
        • Wallet Deposits and Withdrawals
        • Sub-Account Managenent
        • Market Data (USDT-M)
        • Account (USDT-M)
        • Trades (USDT-M)
        • Market Data (Coin-M)
        • Trades (Coin-M)
        • Market Data (Spot)
        • Fund Account (Spot)
        • Trades (Spot)
        • CopyTrader
      • ⚠️FTX Functions
    • 📜License Agreement
  • 🟣Compendium App
    • 📈Compendium Trading Tools
    • 🔗Connect An Exchange Account
      • 🗝️OKX.com API Keys
    • 🤖Verified Trading Bots
      • Explore The Marketplace
      • For Algo & Strategy Authors
        • Get Listed & Verified
        • Strategy Monetization
        • Sending Trading Signals
        • Simplified Signal Program
      • For Users & Subscribers
        • Subscribing To Bots
        • Managing A Subscription
    • 💫Copy Trading Groups
      • For Copy Group Leaders
        • Creating A Copy Group
        • Linking Leader Account
        • Important Trading Notes
        • Manage A Copy Group
        • Discord Webhooks Setup
      • For Users & Subscribers
        • Subscribe To Copy Group
        • Link Account To Group
    • 📶Signal Provider Groups
      • For Group Leaders
        • Creating A Signal Group
        • Managing A Signal Group
        • Sending Trading Signals
      • For Users & Subscribers
        • Subscribing To Signal Groups
        • Manage Signal Group Subscription
  • 🔵Compendex Suite
    • 🔮DeFi With Compendex
    • ☀️Solana Integrations
      • Supported Solana Wallets
      • Overview And News
      • Openbook Spot Markets
      • Smart Swap Aggregator
      • NFT Metaverse Markets
      • Solana DeFi Analytics Portal
      • Community Tools List
  • 🪙The CMFI Token Ecosystem
    • 📊Tokenomics Breakdown
    • 🍎Trade Incentive Program
    • 🌊Staking And Liquidity Pools
      • ✨Raydium Liquidity Pools
      • 🐳Orca Liquidity Whirlpools
      • 🐋Orca Liquidity Pools
    • 🐷Compendi-Pigs NFT
  • 👥Community Info
    • ✅Links And Social Pages
    • 🎨Branding Guidelines
Powered by GitBook
On this page
  • User API default symbol
  • New Order
  • Test New Order
  • Cancel Order
  • Cancel all Open Orders on a Symbol
  • Query Order
  • Current Open Orders
  • All Orders
  • Account Information
  • Account Trade List
  • Enable MX Deduct
  • Query MX Deduct Status
  1. PENDAX
  2. Using PENDAX SDK
  3. Mexc Functions

Spot Account/Trade

Documentation on interacting with Mexc's Spot Account/Trade API functions through the PENDAX Javascript SDK.

PreviousSub-AccountNextWallet

Last updated 1 year ago

User API default symbol

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

Function Name:

getSelfSymbolsSpot()

Usage:

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

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

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

let result = await getSelfSymbolsSpot(myMexcExchanges);

New Order

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

Function Name:

newOrderSpot()

Usage:

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

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

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

let result = await newOrderSpot(myMexcExchanges,
         {
              symbol: "MXUSDT",
              side: "BUY",
              type: "MARKET",
              quoteOrderQty: "8"
         });

Test New Order

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

Function Name:

testNewOrderSpot()

Usage:

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

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

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

let result = await testNewOrderSpot(myMexcExchanges,
         {
             symbol: "BTCUSDT",
             side: "BUY",
             type: "LIMIT",
             price: "20000",
             quantity: "0.0002"
         });

Cancel Order

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

Function Name:

cancelOrderSpot()

Usage:

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

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

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

let result = await cancelOrderSpot(myMexcExchanges,
         {
             symbol: "MXUSDT",
             orderId: "65f257f2b17f491393980f6e1a5a8331"
         });

Cancel all Open Orders on a Symbol

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

Function Name:

cancelOpenOrdersSpot()

Usage:

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

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

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

let result = await cancelOpenOrdersSpot(myMexcExchanges,
         {
             symbol: "MXUSDT"
         });

Query Order

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

Function Name:

getOrderSpot()

Usage:

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

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

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

let result = await getOrderSpot(myMexcExchanges,
         {
             symbol: "MXUSDT",
             orderId: "65f257f2b17f491393980f6e1a5a8331"
         });

Current Open Orders

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

Function Name:

getOpenOrdersSpot()

Usage:

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

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

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

let result = await getOpenOrdersSpot(myMexcExchanges,
         {
             symbol: "MXUSDT"
         });

All Orders

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

Function Name:

getAllOrdersSpot()

Usage:

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

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

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

let result = await getAllOrdersSpot(myMexcExchanges,
         {
             symbol: "MXUSDT"
         });

Account Information

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

Function Name:

getSpotAccountInfo()

Usage:

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

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

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

let result = await getSpotAccountInfo(myMexcExchanges);

Account Trade List

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

Function Name:

getAccountTradeListSpot()

Usage:

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

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

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

let result = await getAccountTradeListSpot(myMexcExchanges, {symbol: "MXUSDT"});

Enable MX Deduct

This function is currently under construction and may fail or give unexpected behavior

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

Function Name:

enableMxDeduct()

Usage:

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

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

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

let result = await enableMxDeduct(myMexcExchanges, {mxDeductEnable: "true"});

Query MX Deduct Status

This function is currently under construction and may fail or give unexpected behavior

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

Function Name:

getMxDeductStatus()

Usage:

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

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

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

let result = await getMxDeductStatus(myMexcExchanges);

⚫
💡
💻
https://mxcdevelop.github.io/apidocs/spot_v3_en/#user-api-default-symbol
https://mxcdevelop.github.io/apidocs/spot_v3_en/#test-new-order
https://mxcdevelop.github.io/apidocs/spot_v3_en/#new-order
https://mxcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
https://mxcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-order
https://mxcdevelop.github.io/apidocs/spot_v3_en/#current-open-orders
https://mxcdevelop.github.io/apidocs/spot_v3_en/#all-orders
https://mxcdevelop.github.io/apidocs/spot_v3_en/#account-information
https://mxcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
https://mxcdevelop.github.io/apidocs/spot_v3_en/#enable-mx-deduct
https://mxcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status