Trades (Spot)

Place order

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

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

Function Name:

placeOrderSpot()

Usage:

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

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

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

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

Place multiple orders

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Place+multiple+orders

Function Name:

placeBatchOrderSpot()

Usage:

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

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

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

let result = await placeBatchOrderSpot(myBingxExchange);

Cancel Order

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

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

Function Name:

cancelOrderSpot()

Usage:

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

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

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(myBingxExchange, {
	symbol: "<string>"
});

Cancel multiple orders

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

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

Function Name:

batchCancelOrderSpot()

Usage:

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

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

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

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

Cancel all Open Orders on a Symbol

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel+all+Open+Orders+on+a+Symbol

Function Name:

cancelAllSymbolOrdersSpot()

Usage:

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

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

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

let result = await cancelAllSymbolOrdersSpot(myBingxExchange);

Cancel an Existing Order and Send a New Orde

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel+an+Existing+Order+and+Send+a+New+Orde

Function Name:

cancelOrderAndPlaceOrderSpot()

Usage:

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

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

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

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

Query Order details

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

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

Function Name:

getOrderDetailsSpot()

Usage:

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

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

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

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

Current Open Orders

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Current+Open+Orders

Function Name:

getOpenOrdersSpot()

Usage:

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

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

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(myBingxExchange);

Query Order history

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

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

Function Name:

getOrderHistorySpot()

Usage:

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

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

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

let result = await getOrderHistorySpot(myBingxExchange);

Query transaction details

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query+transaction+details

Function Name:

getTransactionDetailsSpot()

Usage:

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

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

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

let result = await getTransactionDetailsSpot(myBingxExchange, {
	orderId: "<long>"
});

Query Trading Commission Rate

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

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

Function Name:

getTradingCommissionRateSpot()

Usage:

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

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

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

let result = await getTradingCommissionRateSpot(myBingxExchange);

Cancel All After

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

https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel+All+After

Function Name:

cancelAllAfterSpot()

Usage:

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

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

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

let result = await cancelAllAfterSpot(myBingxExchange);

Last updated