bitfinex-sockets
v0.2.1
Published
node library for bitfinex
Downloads
2
Maintainers
Readme
Bitfinex Socket
Installation
npm install bitfinex-sockets
Usage
Public Client
const {PublicSocket} = require('bitfinex-sockets')
const pubSocket = new PublicSocket()
Ticker
pubSocket.subscribeToTicker('tBTCUSD')
Trades
pubSocket.subscribeToTrades('tBTCUSD')
Books
pubSocket.subscribeToBooks('tBTCUSD')
pubSocket.subscribeToBooks('tBTCUSD', {prec: 'P1', freq: 'F1', len: 100})
Raw Books
pubSocket.subscribeToRawBooks('tBTCUSD')
pubSocket.subscribeToRawBooks('tBTCUSD', {len: 1})
Candles
pubSocket.subscribeToCandles('tBTCUSD' , '1m')
Status
pubSocket.subscribeToStatus({key: 'deriv:tBTCF0:USTF0'})
pubSocket.subscribeToStatus({key: 'liq:global'})
SetOnOpenCallback
pubSocket.setOnOpenCallback()
SetOnMessageCallback
pubSocket.setOnMessageCallback()
SetOnCloseCallback
pubSocket.setOnCloseCallback()
Close
pubSocket.close()