@ergatejs/binance
v1.5.1
Published
Node.js SDK for Binace
Downloads
58
Readme
Binance
Node.js SDK for Binance.
Usage
$ yarn add @ergatejs/binance
example
// index.ts
import Binance from '@ergatejs/binance';
const run = async () => {
const symbol = 'btcusdt';
const interval = '15m';
// init
const futures = new Binance({
apiKey: process.env.apiKey,
apiSecret: process.env.apiSecret,
});
// rest:market
const { data } = await this.futures.klines(symbol, interval, 500);
console.log(data);
// websocket:market
futures.subcribeKline(symbol, interval, k => {
try {
console.log(k)
} catch (error) {
console.log('error', error);
}
});
// user_stream
// subcribeUserData(e => {
// consoel.log(e);
// });
};
run();
Api
Futures Api
https://binance-docs.github.io/apidocs/futures/en/
REST Api
common
- ping
- time
- exchangeInfo
market
- depth
- trades
- trades
- historicalTrades
- aggTrades
- klines
trade
- createOrder
- createBatchOrders
- deleteOrder
- deleteBatchOrders
- deleteAllOrders
user_data
- getOpenOrders
- getAllOrders
- getBalance
- getAccount
- getUserTrades
user_stream
- createListenKey
- updateListenKey
- deleteListenKey
Websocket Api
market
- subcribeKline
user_stream
- subcribeUserData