-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #496 from f3rno/master
v2.0.9
- Loading branch information
Showing
6 changed files
with
142 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
|
||
process.env.DEBUG = '*' | ||
|
||
const debug = require('debug')('bfx:examples:liquidations') | ||
const bfx = require('../bfx') | ||
const ws = bfx.ws(2, { transform: true }) | ||
|
||
ws.on('open', () => { | ||
debug('open') | ||
ws.subscribeStatus('liq:global') | ||
}) | ||
|
||
ws.onStatus({ key: 'liq:global' }, (data) => { | ||
console.log(data) | ||
}) | ||
|
||
ws.open() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@f3rno @prdn
In some cases
ws
may not be open and it will throw an error there, faced this issue locally.I think that the line should check if the socket is open first: