0.0.1-security • Published 2 years ago

binance-connector-node v0.0.1-security

Weekly downloads
87
License
-
Repository
-
Last release
2 years ago

Binance connector in Nodejs

Another thin library that working as connector to Binance Public API.

Installation

npm install binance-conector-node

How to use

const { Spot } = require('binance-connector-node')

const apiKey = ''
const apiSecret = ''
const client = new Spot(apiKey, apiSecret)
client.account().then(response => console.log(response.data))

client.time().then(response => console.log(response.data))

# todo place order

Testnet

The spot testnet is available. In order to test on testnet:

// provide the testnet base url
const client = new Spot(apiKey, apiSecret, { baseURL: 'https://testnet.binance.vision'})

More examples are available from examples folder

Websocket

const bunyan = require('bunyan')
const { Spot } = require('binance-connector-node')
const logger = bunyan.createLogger({
  name: 'binance connector',
  stream: process.stdout,
  level: 'debug' // set to debug to display info for development/testing
})

const client = new Spot('', '', {
  logger // logger is optional,
  wsURL: 'wss://testnet.binance.vision' // optional, for testnet only. By default on production
})

const callbacks = {
  open: () => console.log('open'),
  close: () => console.log('closed'),
  message: function (data) {
    console.log(data)
  }
}
client.aggTradeWS('bnbusdt', callbacks)


// support combined stream, e.g.
client.combinedStreams(['btcusdt@miniTicker', 'ethusdt@tikcer'], callbacks)

Test

npm install

npm run test

License

MIT

0.1.1

2 years ago

0.0.1-security

2 years ago

0.0.6

2 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago