binance-api-node
binance-api-node copied to clipboard
How to handle ws.user stream data
Currently the following code
const clean = await _client.ws.user(async (msg) => {
console.log(msg);
});
gives two sets of json which is invalid and cannot be parsed. I just need the first Object with eventType: 'executionReport'
{
eventType: 'executionReport',
eventTime: 1646079392293,
symbol: 'XRPUSDT'
....
}
{
balances: [ .... ],
eventTime: 1646079392293,
eventType: 'outboundAccountPosition',
lastAccountUpdate: 1646079392293
}