Closed zyklone92 closed 4 years ago
I just realized that this functionality is already implemented, so this should actually be a bug report, sorry.
I also tested a slightly different version ("miniTicker" instead of "!miniTicker") and am receiving a different Error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Python38-32\lib\site-packages\unicorn_fy\unicorn_fy.py", line 288, in binance_websocket
for item in stream_data['items']:
KeyError: 'items'
This is the code I used:
from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager
from unicorn_fy.unicorn_fy import UnicornFy
binance_websocket_api_manager = BinanceWebSocketApiManager(exchange="binance.com")
binance_websocket_api_manager.create_stream(['miniTicker'], ['btcusdt', 'bnbbtc', 'ethbtc'])
while True:
oldest_stream_data_from_stream_buffer = binance_websocket_api_manager.pop_stream_data_from_stream_buffer()
if oldest_stream_data_from_stream_buffer:
unicorn_fied_stream_data = UnicornFy.binance_com_websocket(oldest_stream_data_from_stream_buffer)
print(unicorn_fied_stream_data)
I installed both modules via pip: unicorn-binance-websocket-api 1.12.0 unicorn-fy 0.3.4
Tested on Windows 10, with Python 3.8 and pip 20.1
Best regards, Stefan
Hi Stefan!
I know, there is some quirks inside the latest version. I am pretty sure it worked in the beginning and got broken through modifications.
I think you can try it with an older version like this one: https://github.com/oliver-zehentleitner/unicorn_fy/tree/cf21fb2c80bf2eee2c3c7d8071284367b8f964e7/unicorn_fy
I will need a while to make a clean fix for this, because i have to finish some things in the websocket lib, after that i will pick up unicorn-fy again.
Best regards, Oliver
I was not able to test it as much as i want, but I think its stable again: https://pypi.org/project/unicorn-fy/
Hi Oliver,
I updated unicorn-fy and tested both the miniTicker and the miniTicker for all markets (!miniTicker) and they both seem to be working correctly.
Thank you for fixing this so quickly.
Best regards, Stefan
Your welcome! Best regards!
Hello,
I am using unicorn_fy in combination with the unicorn_binance_websocket_api and am trying to get data via mini ticker subscriptions (https://binance-docs.github.io/apidocs/spot/en/#individual-symbol-mini-ticker-stream).
However, when subscribing to a mini ticker, unicorn_fy is not able to process the stream output and throws an exception:
Here is the code I used:
It would be great, if support for mini tickers could be added.
Thanks in advance and best regards, Stefan
Edit: Corrected shown error and used code (they were not complete / reflecting the correct version used)