Wallet
Documentation on interacting with Mexc's Wallet API functions through the PENDAX Javascript SDK.
Query the currency information
Function Name:
getCurrencyInformationSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getCurrencyInformationSpot(exchange, options) {
try {
let result = await exchange.getCurrencyInformationSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getCurrencyInformationSpot(myMexcExchanges);
Withdraw
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function withdrawSpot(exchange, options) {
try {
let result = await exchange.withdrawSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await withdrawSpot(myMexcExchanges,
{
coin: "EOS",
address: "zzqqqqqqqqqq",
amount: "10"
);
Cancel withdraw
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function cancelWithdrawSpot(exchange, options) {
try {
let result = await exchange.cancelWithdrawSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelWithdrawSpot(myMexcExchanges,
{
id: "ca7bd51895134fb5bd749f1cf875b8af"
);
Deposit History(supporting network)
Function Name:
getDepositHistorySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getDepositHistorySpot(exchange, options) {
try {
let result = await exchange.getDepositHistorySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getDepositHistorySpot(myMexcExchanges);
Withdraw History (supporting network)
Function Name:
getWithdrawHistorySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getWithdrawHistorySpot(exchange, options) {
try {
let result = await exchange.getWithdrawHistorySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getWithdrawHistorySpot(myMexcExchanges);
Generate deposit address (supporting network)
Function Name:
generateDepositAddressSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function generateDepositAddressSpot(exchange, options) {
try {
let result = await exchange.generateDepositAddressSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await generateDepositAddressSpot(myMexcExchanges,
{
coin: "USDT",
network: "TRC20"
});
Deposit Address (supporting network)
Function Name:
getDepositAddressSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getDepositAddressSpot(exchange, options) {
try {
let result = await exchange.getDepositAddressSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getDepositAddressSpot(myMexcExchanges,
{
coin: "USDT"
});
Withdraw Address (supporting network)
Function Name:
getWithdrawAddressSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getWithdrawAddressSpot(exchange, options) {
try {
let result = await exchange.getWithdrawAddressSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getWithdrawAddressSpot(myMexcExchanges);
User Universal Transfer
Function Name:
userUniversalTransferSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function userUniversalTransferSpot(exchange, options) {
try {
let result = await exchange.userUniversalTransferSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await userUniversalTransferSpot(myMexcExchanges,
{
fromAccountType: "SPOT",
toAccountType: "FUTURES",
asset: "USDT",
amount: "10"
});
Query User Universal Transfer History
Function Name:
getUniversalTransferHistorySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getUniversalTransferHistorySpot(exchange, options) {
try {
let result = await exchange.getUniversalTransferHistorySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getUniversalTransferHistorySpot(myMexcExchanges,
{
toAccount: "mikwdn443ksnsadasd",
fromAccountType: "SPOT",
toAccountType: "SPOT"
});
Query User Universal Transfer History (by tranId)
Function Name:
getUniversalTransferHistoryTranIdSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getUniversalTransferHistoryTranIdSpot(exchange, options) {
try {
let result = await exchange.getUniversalTransferHistoryTranIdSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getUniversalTransferHistoryTranIdSpot(myMexcExchanges,
{
tranId: "fedfdd5d23f94582a117a67118323db9"
});
Get Assets That Can Be Converted Into MX
Function Name:
getMxConvertableAssetsSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getMxConvertableAssetsSpot(exchange, options) {
try {
let result = await exchange.getMxConvertableAssetsSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getMxConvertableAssetsSpot(myMexcExchanges);
Dust Transfer
This function is currently under construction and may fail or give unexpected behavior
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function dustTransferSpot(exchange, options) {
try {
let result = await exchange.dustTransferSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
DustLog
This function is currently under construction and may fail or give unexpected behavior
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getDustLogSpot(exchange, options) {
try {
let result = await exchange.getDustLogSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getDustLogSpot(myMexcExchanges);