node-binance-api
node-binance-api copied to clipboard
How to terminate futureUserData | Stop the keep alive setTimeout?
let wsEndpoint = null;
client.userFutureData(null,null,
data => {
console.log('data', data);
},
endpoint => {
wsEndpoint = endpoint
}
)
setTimeout(() => {
client.futuresTerminate(wsEndpoint)
}, 3000)
But it's still running because of the setTimeout(). I want to be able to stop it fully after terminating the websocket. Also, if the websocket is not yet terminated... then keep the keepalive open... how to achieve this?