Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*** IMPORTANT TO KNOW: Changes in release 1.10.0 *** #38

Closed
oliver-zehentleitner opened this issue Feb 13, 2020 · 2 comments
Closed

*** IMPORTANT TO KNOW: Changes in release 1.10.0 *** #38

oliver-zehentleitner opened this issue Feb 13, 2020 · 2 comments
Assignees

Comments

@oliver-zehentleitner
Copy link
Member

oliver-zehentleitner commented Feb 13, 2020

Hello!

In the releases 1.10.0 i added subscriptions through websocket.send() which enables the lib to subscribe on demand: https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#live-subscribingunsubscribing-to-streams

In all versions of this lib <= 1.9.x the subscriptions got handled within create_stream() via the URI on websocket.connect(), to change markets or channels it was necessary to use replace_stream(). Now its possible to subscribe and unsubscribe on demand via subscribe_to_stream() and unsubscribe_from_stream().

A very nice benefit is, we can bypass the 8004 char limit in the URI for subscriptions which makes is_websocket_length_valid() obsolete and makes also the request #19 (virtual stream interface) unnecessary!

Beginning with 1.10.0 is_websocket_length_valid() will always return True!

The most important part now

As a result of this changes the endpoints are answering with a new message that looks like:

{"result":null,"id":1}
{"result":null,"id":2}
{"result":null,"id":3}
{"result":null,"id":4}

Its possible that this is crashing your script ...

Have fun!

Best regards,
Oliver

Edit 2020-04-28:
There is a new limit of 1024 subscriptions per stream: #45 (comment)

@oliver-zehentleitner oliver-zehentleitner added the question Further information is requested label Feb 13, 2020
@oliver-zehentleitner oliver-zehentleitner self-assigned this Feb 13, 2020
@oliver-zehentleitner oliver-zehentleitner removed the question Further information is requested label Feb 13, 2020
@oliver-zehentleitner oliver-zehentleitner changed the title *** IMPORTANT TO KNOW *** Changes in release 1.10.0 *** IMPORTANT TO KNOW: Changes in release 1.10.0 *** Feb 23, 2020
@officialnico
Copy link

hey man i keep getting this error {"result":null,"id":1} and so on. i saw you mentioned it but im not sure how to fix it?

@oliver-zehentleitner
Copy link
Member Author

oliver-zehentleitner commented May 24, 2020

its NOT an error!

Please read here: https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md#live-subscribingunsubscribing-to-streams

In the response, if the result received is null this means the request sent was a success for non-query requests (e.g. Subscribing/Unsubscribing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants