-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Tested with this example from README.md.
I got this after 20 secs:
{
e: "eventStreamTerminated",
E: 1762030622639,
}import { Spot, SpotWebsocketAPI } from '@binance/spot';
const configurationWebsocketAPI = {
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
};
const client = new Spot({ configurationWebsocketAPI });
client.websocketAPI
.connect()
.then((connection) => connection.sessionLogon().then(() => connection))
.then((connection) => connection.userDataStreamSubscribe())
.then(({ stream }) => {
stream.on('message', (data) => {
switch (data.e) {
case 'balanceUpdate':
console.log('balance update stream', data);
break;
case 'outboundAccountPosition':
console.log('outbound account position stream', data);
break;
// …handle other variants…
default:
console.log('unknown stream', data);
break;
}
});
})
.catch((err) => console.error(err));Metadata
Metadata
Assignees
Labels
No labels