Closed davivc closed 3 years ago
I am very tired and cant get the big picture in my head today...
Maybe this is related to the changes binance announced some time ago: https://github.com/oliver-zehentleitner/unicorn-fy/issues/17
I very appreciate that you fix this and contribute it via a PR, i will create a new package then asap.
Best regards!
Its released: https://github.com/oliver-zehentleitner/unicorn-fy/releases/tag/0.9.0 https://pypi.org/project/unicorn-fy/0.9.0/
Thanks for your support! Best regards, Oliver
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
Operating System? (include version)
Exact Python Version?
Pip Version?
Description of your issue
unicorn-binance-websocket-api crashes when I use the output=UnicornFy on my user stream and I make a manual trade on my Binance account. My guess is that the key 'balanceUpdate' does not exist in UnicornFy.
This error occurs both in margin (cross and isolated) and spot account stream data.
I've created the isolated margin stream with the output=UnicornFy
This is part of the DEBUG output after I've sent 1USDT to my BTCUSDT Isolated-Margin (this error also happens in the spot account when I trade manually.
I think this is the part of the UnicornFy code that misses the balanceUpdate key and throws the error down in the code:
Since the 'balanceUpdate' is not on this if-else chain the stream_data follows as it is, the code down below can't find the key 'data' and raises the error killing the WebSocket.
I did a local test tinkering with this and worked, however, I did by processing the JSON after the buffer output and not using the output param in create_stream. I'll fork the code, fix this and will do a pull request.