Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_handleTradeMessage (msg, chanData) {
const eventName = msg[1] === 'te' ? 'trade-entry' : 'trades'
let payload = getMessagePayload(msg)
if (!Array.isArray(payload[0])) {
payload = [payload]
}
const data = this._transform ? PublicTrade.unserialize(payload) : payload
const internalMessage = [chanData.chanId, eventName, data]
internalMessage.filterOverride = [chanData.symbol]
this._propagateMessageToListeners(internalMessage, chanData, false)
this.emit('trades', chanData.pair, data)
}