Issue type
Brief description
The handlers registered for public funding trades with onTrades are not called when fte/ftu messages are received.
This is because the fte/ftu messages are not properly handled and the messages don't propagate to listener registered with onTrades method.
Steps to reproduce
const ws = new WSv2()
ws.on('open', async () => {
ws.onTrades({ symbol: 'fUSD' }, (trades) => {
console.log('recv trades: %j', trades)
})
ws.subscribeTrades('fUSD')
})
await ws.open()
Additional Notes:
Possible bug fix:
Change
|
const eventName = msg[1][0] === 'f' |
|
? msg[1] // Funding trades are passed to fte/ftu handlers |
|
: msg[1] === 'te' |
|
? 'trade-entry' |
|
: 'trades' |
with
const eventName = msg[1] === 'te' || msg[1] === 'fte'
? 'trade-entry'
: 'trades'
Issue type
Brief description
The handlers registered for public funding trades with
onTradesare not called when fte/ftu messages are received.This is because the fte/ftu messages are not properly handled and the messages don't propagate to listener registered with
onTradesmethod.Steps to reproduce
Additional Notes:
Possible bug fix:
Change
bitfinex-api-node/lib/transports/ws2.js
Lines 967 to 971 in fabfc1c
with