Place order
Function Name:
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
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
Function Name:
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
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
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
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
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
Function Name:
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
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
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
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
Function Name:
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