Skip to content

crxb/cb-binance-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Promise based Typescript Binance client for nodejs/javascript. Not all endpoints and socket subscriptions are implemented yet. Do not use in production yet.

Examples

Subscribe to user data stream
import {Binance} from 'cb-binance-lib';

let client = new Binance('API_KEY', 'API_SECRET');

client.userDataStream.subscribe((data) => {
    console.log(data);
});
Create new order
import {Binance} from 'cb-binance-lib';

let client = new Binance('API_KEY', 'API_SECRET');

let orderResult = await client.order.create({
    symbol: 'ETHUSDT',
    side: 'BUY',
    quantity: '0.001',
    type: 'LIMIT',
    price: '1600',
    timeInForce: 'GTC',
    newClientOrderId: 'cb-test',
});
Query Open Orders
import {Binance} from 'cb-binance-lib';

let client = new Binance('API_KEY', 'API_SECRET');

let openOrders = await client.order.queryOpens();
Cancel Order
import {Binance} from 'cb-binance-lib';

let client = new Binance('API_KEY', 'API_SECRET');

let cancelResult = await client.order.cancel({
    symbol: 'ETHUSDT',
    origClientOrderId: 'cb-test',
});

TODO

  • Websocket reconnection mechanism should be implemented.
  • Client should be seperated by Futures/Spot operations.
  • Error handling (throwing errors) should be improved.
  • Documentation needs to be improved.
  • First release will be published after this items are done.

About

Promise based Binance client in Typescript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •