Market
Documentation on interacting with Mexc's Market API functions through the PENDAX Javascript SDK.
Test Connectivity
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
Function Name:
testConnectivitySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function testConnectivitySpot(exchange, options) {
try {
let result = await exchange.testConnectivitySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await testConnectivitySpot(myMexcExchanges);
Check Server Time
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
Function Name:
getServerTimeSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getServerTimeSpot(exchange, options) {
try {
let result = await exchange.getServerTimeSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getServerTimeSpot(myMexcExchanges);
API default symbol
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#api-default-symbol
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);
Exchange Information
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
Function Name:
getExchangeInformationSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getExchangeInformationSpot(exchange, options) {
try {
let result = await exchange.getExchangeInformationSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getExchangeInformationSpot(myMexcExchanges, {symbol: "BTCUSDT"});
Order Book
Please refer to the official Mexc API Docs for the Required parameters.
Function Name:
getOrderBookSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getOrderBookSpot(exchange, options) {
try {
let result = await exchange.getOrderBookSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getOrderBookSpot(myMexcExchanges,
{
symbol: "BTCUSDT"
});
Recent Trades List
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
Function Name:
getRecentTradesListSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getRecentTradesListSpot(exchange, options) {
try {
let result = await exchange.getRecentTradesListSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getRecentTradesListSpot(myMexcExchanges,
{
symbol: "BTCUSDT"
});
Compressed/Aggregate Trades List
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
Function Name:
getAggTradesSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getAggTradesSpot(exchange, options) {
try {
let result = await exchange.getAggTradesSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getAggTradesSpot(myMexcExchanges,
{
symbol: "BTCUSDT"
});
Kline/Candlestick Data
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
Function Name:
getKlinesSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getKlinesSpot(exchange, options) {
try {
let result = await exchange.getKlinesSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getKlinesSpot(myMexcExchanges,
{
symbol: "BTCUSDT",
interval: "15m"
});
Current Average Price
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#current-average-price
Function Name:
getAvgPriceSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getAvgPriceSpot(exchange, options) {
try {
let result = await exchange.getAvgPriceSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getAvgPriceSpot(myMexcExchanges,
{
symbol: "BTCUSDT"
});
24hr Ticker Price Change Statistics
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
Function Name:
get24HrTickerSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function get24HrTickerSpot(exchange, options) {
try {
let result = await exchange.get24HrTickerSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await get24HrTickerSpot(myMexcExchanges);
Symbol Price Ticker
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#symbol-price-ticker
Function Name:
getPriceTickerSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getPriceTickerSpot(exchange, options) {
try {
let result = await exchange.getPriceTickerSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPriceTickerSpot(myMexcExchanges);
Symbol Order Book Ticker
Please refer to the official Mexc API Docs for the Required parameters.
https://mxcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker
Function Name:
getBookTickerSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getBookTickerSpot(exchange, options) {
try {
let result = await exchange.getBookTickerSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getBookTickerSpot(myMexcExchanges);
Last updated