Trades (Coin-M)

Trade order

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Trade+order

Function Name:

placeTradeOrderCM()

Usage:

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

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

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

let result = await placeTradeOrderCM(myBingxExchange, {
	symbol: "<string>",
	type: "<string>",
	side: "<string>"
});

Query Trade Commission Rate

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Trade+Commission+Rate

Function Name:

getComissionRateCM()

Usage:

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

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

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

let result = await getComissionRateCM(myBingxExchange);

Query Leverage

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Leverage

Function Name:

getLeverageCM()

Usage:

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

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

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

let result = await getLeverageCM(myBingxExchange);

Modify Leverage

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Modify+Leverage

Function Name:

modifyLeverageCM()

Usage:

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

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

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

let result = await modifyLeverageCM(myBingxExchange);

Cancel all orders

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel+all+orders

Function Name:

cancelAllOrdersCM()

Usage:

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

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

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

let result = await cancelAllOrdersCM(myBingxExchange);

Close all positions in bulk

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Close+all+positions+in+bulk

Function Name:

closeAllPositionsInBulkCM()

Usage:

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

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

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

let result = await closeAllPositionsInBulkCM(myBingxExchange);

Query warehouse

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+warehouse

Function Name:

getWarehouseCM()

Usage:

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

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

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

let result = await getWarehouseCM(myBingxExchange);

Query Account Assets

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Account+Assets

Function Name:

getAccountAssetsCM()

Usage:

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

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

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

let result = await getAccountAssetsCM(myBingxExchange);

Query force orders

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+force+orders

Function Name:

getForceOrdersCM()

Usage:

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

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

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

let result = await getForceOrdersCM(myBingxExchange);

Query Order Trade Detail

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Order+Trade+Detail

Function Name:

getOrderTradeDetailCM()

Usage:

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

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

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

let result = await getOrderTradeDetailCM(myBingxExchange);

Cancel an Order

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel+an+Order

Function Name:

cancelOrderCM()

Usage:

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

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

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

let result = await cancelOrderCM(myBingxExchange, {
	symbol: "<string>"
});

Query all current pending orders

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+all+current+pending+orders

Function Name:

getPendingOrdersCM()

Usage:

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

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

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

let result = await getPendingOrdersCM(myBingxExchange);

Query Order

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Order

Function Name:

getOrderCM()

Usage:

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

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

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

let result = await getOrderCM(myBingxExchange, {
	symbol: "<string>"
});

" Users History Orders "

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's+History+Orders

Function Name:

getUsersHistoryOrdersCM()

Usage:

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

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

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

let result = await getUsersHistoryOrdersCM(myBingxExchange, {
	limit: "<int>"
});

Query Margin Type

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query+Margin+Type

Function Name:

getMarginTypeCM()

Usage:

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

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

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

let result = await getMarginTypeCM(myBingxExchange, {
	symbol: "<string>"
});

Set Margin Type

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Set+Margin+Type

Function Name:

setMarginTypeCM()

Usage:

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

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

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

let result = await setMarginTypeCM(myBingxExchange, {
	symbol: "<string>",
	marginType: "<string>"
});

Adjust Isolated Margin

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

https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Adjust+Isolated+Margin

Function Name:

adjustIsolatedMarginCM()

Usage:

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

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

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

let result = await adjustIsolatedMarginCM(myBingxExchange, {
	symbol: "<string>",
	amount: "<float64>",
	type: "<int>",
	positionSide: "<string>"
});

Last updated