GET Futures Account Balance
Function Name:
getFuturesAccountBalance()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getFuturesAccountBalance(exchange, options) {
try {
let result = await exchange.getFuturesAccountBalance(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getFuturesAccountBalance(myBlofinExchange,
});
GET Positions
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getPositions(exchange, options) {
try {
let result = await exchange.getPositions(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getPositions(myBlofinExchange,
});
GET Margin Mode
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getMarginMode(exchange, options) {
try {
let result = await exchange.getMarginMode(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getMarginMode(myBlofinExchange,
});
GET Multiple Leverage
Function Name:
getMultipleLeverage()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getMultipleLeverage(exchange, options) {
try {
let result = await exchange.getMultipleLeverage(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getMultipleLeverage(myBlofinExchange,
});
Set Leverage
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function setLeverage(exchange, options) {
try {
let result = await exchange.setLeverage(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await setLeverage(myBlofinExchange,
});
Place Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function placeOrder(exchange, options) {
try {
let result = await exchange.placeOrder(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeOrder(myBlofinExchange, {
instId: "<String>",
marginMode: "<String>",
side: "<String>",
orderType: "<String>",
price: "<String>",
size: "<String>"
});
Place Multiple Orders
Function Name:
placeMultipleOrders()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function placeMultipleOrders(exchange, options) {
try {
let result = await exchange.placeMultipleOrders(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeMultipleOrders(myBlofinExchange,
});
Place TPSL Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function placeTPSLOrder(exchange, options) {
try {
let result = await exchange.placeTPSLOrder(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await placeTPSLOrder(myBlofinExchange, {
instId: "<String>",
marginMode: "<String>",
positionSide: "<String>",
side: "<String>",
tpTriggerPrice: "<String>"
});
Cancel Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function cancelOrder(exchange, options) {
try {
let result = await exchange.cancelOrder(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelOrder(myBlofinExchange,
});
Cancel Multiple Orders
Function Name:
cancelMultipleOrders()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function cancelMultipleOrders(exchange, options) {
try {
let result = await exchange.cancelMultipleOrders(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelMultipleOrders(myBlofinExchange,
});
Cancel TPSL Order
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function cancelTPSLOrder(exchange, options) {
try {
let result = await exchange.cancelTPSLOrder(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await cancelTPSLOrder(myBlofinExchange,
});
GET Active Orders
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getActiveOrders(exchange, options) {
try {
let result = await exchange.getActiveOrders(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getActiveOrders(myBlofinExchange,
});
GET Active TPSL Orders
Function Name:
getActiveTPSLOrders()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getActiveTPSLOrders(exchange, options) {
try {
let result = await exchange.getActiveTPSLOrders(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getActiveTPSLOrders(myBlofinExchange,
});
Close Positions
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function closePositions(exchange, options) {
try {
let result = await exchange.closePositions(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await closePositions(myBlofinExchange, {
instId: "<String>",
marginMode: "<String>"
});
GET TPSL Order History
Function Name:
getTPSLOrderHistory()
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getTPSLOrderHistory(exchange, options) {
try {
let result = await exchange.getTPSLOrderHistory(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getTPSLOrderHistory(myBlofinExchange,
});
GET Trade History
Function Name:
Usage:
import { createExchange } from "./exchanges/exchange.js";
let myBlofinExchange = createExchange({
exchange: "blofin",
authenticate: "true",
key: "myKey",
secret: "mySecret",
passphrase: "myPassphrase",
label: "blofin"
});
async function getTradeHistory(exchange, options) {
try {
let result = await exchange.getTradeHistory(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
let result = await getTradeHistory(myBlofinExchange,
});
Last updated