Trading
Last updated
Last updated
Please refer to the official BloFin API Docs for the Required parameters.
getFuturesAccountBalance()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getPositions()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getMarginMode()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getMultipleLeverage()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
setLeverage()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
placeOrder()
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>"
});
Please refer to the official BloFin API Docs for the Required parameters.
placeMultipleOrders()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
placeTPSLOrder()
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>"
});
Please refer to the official BloFin API Docs for the Required parameters.
cancelOrder()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
cancelMultipleOrders()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
cancelTPSLOrder()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getActiveOrders()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getActiveTPSLOrders()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
closePositions()
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>"
});
Please refer to the official BloFin API Docs for the Required parameters.
getTPSLOrderHistory()
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,
});
Please refer to the official BloFin API Docs for the Required parameters.
getTradeHistory()
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,
});