@tigerbrokers/mqtt-pipe
v2.1.3
Published
@tigerbrokers/mqtt-pipe =========
Downloads
8
Readme
@tigerbrokers/mqtt-pipe
TigerTrade 长连接库,封装连接层。
Usage
import TigerPipe from 'tiger-pipe'
const pipe = new TigerPipe({
test: true,
clientId: 'web2018xxxxxxx'
})
pipe.connect('uuid', 'token')
pipe.disconnect()
API
Attributes
- mqtt
- connected
- reconnecting
Methods
- connect(username, password)
- disconnect(force, cb)
- subscribe(topic)
- unsubscribe(topic)
- on(topic|event, cb)
- off(topic|event, cb)
- subscribeQuote (symbol, type = 'simple') {
- subscribeAsset () {
- subscribeOrder (symbol = '+') {
- subscribePosition (symbol = '+') {
## Events
- connect
- reconnect
- error
- message
- offline
- close
- packetsend
- packetreceive
Test
npm test
Build
npm run build