Comments (7)
from binance.
Woops you saw my comment quite fast.
I deleted it a moment later seeing I was a bit off from your problem.
from binance.
from binance.
It looks to me like you'll have to fork the repo and make a change.
Extend the WebSocket .close
so it can close the setInterval
.
Something like:
onUserData(binanceRest, eventHandler, interval = 60000) {
return binanceRest.startUserDataStream()
.then((response) => {
let intervalId = setInterval(() => {
binanceRest.keepAliveUserDataStream(response);
}, interval);
this._setupWebSocket(eventHandler, response.listenKey)
.then(ws => {
ws.close2 = ws.close;
ws.close = () => {
clearInterval(intervalId)
ws.close2()
}
return ws
});
});
}
from binance.
from binance.
If you PR a fix the clear the interval, I'll get it reviewed. I guess the logic would need to clear the interval if:
- keep alive returned an error, or
- the socket was manually closed
from binance.
Could potentially use the code from this for a quick change for 1.x zoeyg/binance@aa7d0c4
from binance.
Related Issues (20)
- Some Events are not firing HOT 2
- misleading name for `force` parameter of `closeAll()` method
- [question] How to return the data received by websocket to the front-end project HOT 1
- missing changelog HOT 5
- Unecesarry ping when WebSocket is not ready
- Add missing simple-earn endpoints HOT 1
- Missing API endpoint for Query Commission Rates (USER_DATA) HOT 2
- run example ws-public-spot-orderbook.ts failed HOT 9
- Nextjs - can't resolve 'socks-proxy-agent' HOT 3
- getting "Unknown order sent" error every time I call cancelOrder HOT 4
- kucoin-api-node HOT 3
- Incorrect Type Definition for WsMessage24hrTickerFormatted HOT 2
- TypeError: Cannot create property 'newClientOrderId' on string 'BTCUSDT' HOT 1
- input params for subscribeDiffBookDepth() are not right HOT 5
- browser ping issue HOT 4
- Binance could not find order during closing request, but executed it 4 hours later HOT 4
- Error: read ECONNRESET HOT 3
- Custom URL or Endpoint HOT 5
- Request: REST Endpoints for SOR Trades HOT 1
- Cannot connect/subscribe to SpotUserDataStream on Testnet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance.