You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below.
The id used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth.
In the response, if the result received is null this means the request sent was a success.**
Unsubscribe to a stream
Request
{
"method": "UNSUBSCRIBE",
"params":
[
"btcusdt@depth"
],
"id": 312
}
Does your library have such an implementation? (I did not find it), if not, can you add it? Because as I understand it, if, for example, I call subscribeAggregateTrades 20 times for different coins, then I will open 20 connections, and the limit for binance seems to be 5
but I would like to be able to add and remove coins in an already open connection (for example, listen to 100 coins, then add 2 more, or remove 5)
thank you in advance
The text was updated successfully, but these errors were encountered:
Not supported right now in the current implementation. Originally this wasn't possible with binance until they added this later on.
I do want to add support for it though, exactly for the same reasons/concerns you've mentioned as well. In fact, the other exchanges I have SDKs for work this way too - open one connection and subscribe to events after connecting. Should be viable to adapt the way I have this working for my other SDKs, but need to evaluate the cleanest way to do this - I'm somewhat tempted to add a second websocket client (v2) dedicated to working a newer way, instead of expanding the ever growing ws client. Not sure yet though...
https://binance-docs.github.io/apidocs/spot/en/#websocket-market-streams
Binance has this option:
**Live Subscribing/Unsubscribing to streams
The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below.
The id used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth.
In the response, if the result received is null this means the request sent was a success.**
Subscribe to a stream
Request
{
"method": "SUBSCRIBE",
"params":
[
"btcusdt@aggTrade",
"btcusdt@depth"
],
"id": 1
}
Unsubscribe to a stream
Request
{
"method": "UNSUBSCRIBE",
"params":
[
"btcusdt@depth"
],
"id": 312
}
Does your library have such an implementation? (I did not find it), if not, can you add it? Because as I understand it, if, for example, I call subscribeAggregateTrades 20 times for different coins, then I will open 20 connections, and the limit for binance seems to be 5
but I would like to be able to add and remove coins in an already open connection (for example, listen to 100 coins, then add 2 more, or remove 5)
thank you in advance
The text was updated successfully, but these errors were encountered: