Sub-Account
Documentation on interacting with Mexc's Sub-Account API functions through the PENDAX Javascript SDK.
Create a Sub-account(For Master Account)
Function Name:
createSubAccountSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function createSubAccountSpot(exchange, options) {
try {
let result = await exchange.createSubAccountSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await createSubAccountSpot(myMexcExchanges,
{
subAccount: "mikwdn443ksnsadasd",
note: "1"
});
Query Sub-account List (For Master Account)
Function Name:
getSubaccountListSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getSubaccountListSpot(exchange, options) {
try {
let result = await exchange.getSubaccountListSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getSubaccountListSpot(myMexcExchanges);
Create an APIKey for a sub-account (For Master Account)
Function Name:
createSubaccountApiKeySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function createSubaccountApiKeySpot(exchange, options) {
try {
let result = await exchange.createSubaccountApiKeySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await createSubaccountApiKeySpot(myMexcExchanges,
{
subAccount: "mikwdn443ksnsadasd",
note: "meat",
permissions: "SPOT_ACCOUNT_READ"
});
Query the APIKey of a sub-account (For Master Account)
Function Name:
getSubaccountApiKeySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function getSubaccountApiKeySpot(exchange, options) {
try {
let result = await exchange.getSubaccountApiKeySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getSubaccountApiKeySpot(myMexcExchanges,
{
subAccount: "yourSubAccountName"
});
Delete the APIKey of a sub-account (For Master Account)
Function Name:
deleteSubaccountApiKeySpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function deleteSubaccountApiKeySpot(exchange, options) {
try {
let result = await exchange.deleteSubaccountApiKeySpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await deleteSubaccountApiKeySpot(myMexcExchanges,
{
subAccount: "22nj5499sn2nv",
apiKey: "nfl4nfl34nrt3lku4nrl3in4"
});
Universal Transfer (For Master Account)
Function Name:
universalTransferSpot()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myMexcExchanges = createExchange({
exchange: "mexc",
authenticate: "true",
key: "myKey",
secret: "mySecret",
label: "mexc"
});
async function universalTransferSpot(exchange, options) {
try {
let result = await exchange.universalTransferSpot(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await universalTransferSpot(myMexcExchanges,
{
toAccount: "ddddw3g",
fromAccountType: "SPOT",
toAccountType: "SPOT",
asset: "USDT",
amount: "10"
});
Query Universal Transfer History (For Master Account)
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: "22df3tg4yh45y",
fromAccountType: "SPOT",
toAccountType: "SPOT"
});