LUCIT-Systems-and-Development / unicorn-binance-websocket-api

A Python SDK by LUCIT to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a simple, fast, flexible, robust and fully-featured way.
https://unicorn-binance-websocket-api.docs.lucit.tech/
Other
677 stars 166 forks source link

issue with the latest version #362

Closed aleangelin88 closed 7 months ago

aleangelin88 commented 7 months ago

Solution to Issue cannot be found in the documentation or other Issues and also occurs in the latest version of this library.

Version of this library.

unicorn-binance-rest-api 2.0.4 unicorn-binance-websocket-api 2.1.0 unicorn-fy 0.12.2

Hardware?

Local server/workstation

Operating System?

Linux

Python version?

Python3.7

Installed wheel files

No response

Installed packages

unicorn-binance-rest-api      2.0.4
unicorn-binance-websocket-api 2.1.0
unicorn-fy                    0.12.2

Logging output

Retrieving all assets - Success
Getting margin fees - Success
Entering data stream
Exception in thread _create_stream_thread:  stream_id=ee4b6c1fc555-96bc-44ac-26d8-ec44ffd2, time=1699916345.5175567:
Traceback (most recent call last):
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "unicorn_binance_websocket_api\\manager.py", line 584, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager._create_stream_thread
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "unicorn_binance_websocket_api\\sockets.py", line 50, in start_socket
  File "unicorn_binance_websocket_api\\connection.py", line 65, in __aenter__
  File "unicorn_binance_websocket_api\\manager.py", line 1563, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.create_websocket_uri
  File "unicorn_binance_websocket_api\\manager.py", line 2140, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.get_listen_key_from_restclient
  File "unicorn_binance_websocket_api\\restclient.py", line 121, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key
  File "unicorn_binance_websocket_api\\restclient.py", line 128, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key
  File "unicorn_binance_rest_api\\manager.py", line 236, in unicorn_binance_rest_api.manager.BinanceRestApiManager.__init__
  File "lucit_licensing_python\\manager.py", line 39, in lucit_licensing_python.manager.LucitLicensingManager.__init__
TypeError: __init__() got an unexpected keyword argument 'license_ini'
Exception in thread _create_stream_thread:  stream_id=90a00285649f-8550-e619-b706-321ec512, time=1699916347.4478807:
Traceback (most recent call last):
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "unicorn_binance_websocket_api\\manager.py", line 584, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager._create_stream_thread
  File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "unicorn_binance_websocket_api\\sockets.py", line 50, in start_socket
  File "unicorn_binance_websocket_api\\connection.py", line 65, in __aenter__
  File "unicorn_binance_websocket_api\\manager.py", line 1563, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.create_websocket_uri
  File "unicorn_binance_websocket_api\\manager.py", line 2140, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.get_listen_key_from_restclient
  File "unicorn_binance_websocket_api\\restclient.py", line 121, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key
  File "unicorn_binance_websocket_api\\restclient.py", line 128, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key
  File "unicorn_binance_rest_api\\manager.py", line 236, in unicorn_binance_rest_api.manager.BinanceRestApiManager.__init__
  File "lucit_licensing_python\\manager.py", line 39, in lucit_licensing_python.manager.LucitLicensingManager.__init__
TypeError: __init__() got an unexpected keyword argument 'license_ini'

Processing method?

stream_buffer

Used endpoint?

concerns all

Issue

with the latest version, I cant start the data user stream, see logs please

oliver-zehentleitner commented 7 months ago

Thanks for the report! Are you using the lucit_license.ini file or the parameters lucit_api_secret and lucit_license_token?

aleangelin88 commented 7 months ago

yes, this is the code: binance_websocket_api_manager_user_data_spot = BinanceWebSocketApiManager(exchange="binance.com", lucit_api_secret=lucit_api_secret, lucit_license_token=lucit_license_token) #, enable_stream_signal_buffer=True) binance_websocket_api_manager_user_data_spot.create_stream(["arr"], ["!userData"], api_key=API_key_general, api_secret=secret_key_general)

aleangelin88 commented 7 months ago

after doing pip install lucit-licensing-python --upgrade

this is what I get now: Retrieving all assets - Success Getting margin fees - Success Entering data stream Please provide the api secret and license token of your lucit license! Read this article for more information: https://medium.lucit.tech/87b0088124a8 LUCIT License Manager is shutting down! Exception in thread _create_stream_thread: stream_id=a754be85e63f-9477-42bb-b2da-4a0dfb27, time=1699919312.6578934: Traceback (most recent call last): File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "unicorn_binance_websocket_api\manager.py", line 584, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager._create_stream_thread File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "unicorn_binance_websocket_api\sockets.py", line 50, in start_socket File "unicorn_binance_websocket_api\connection.py", line 65, in aenter File "unicorn_binance_websocket_api\manager.py", line 1563, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.create_websocket_uri File "unicorn_binance_websocket_api\manager.py", line 2140, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.get_listen_key_from_restclient File "unicorn_binance_websocket_api\restclient.py", line 121, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key File "unicorn_binance_websocket_api\restclient.py", line 128, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key File "unicorn_binance_rest_api\manager.py", line 236, in unicorn_binance_rest_api.manager.BinanceRestApiManager.init File "lucit_licensing_python\manager.py", line 131, in lucit_licensing_python.manager.LucitLicensingManager.init lucit_licensing_python.exceptions.NoValidatedLucitLicense: Please provide the api secret and license token of your lucit license! Read this article for more information: https://medium.lucit.tech/87b0088124a8 Please provide the api secret and license token of your lucit license! Read this article for more information: https://medium.lucit.tech/87b0088124a8 LUCIT License Manager is shutting down! Exception in thread _create_stream_thread: stream_id=1a79c9871de8-e1eb-4425-dcf8-bfc453df, time=1699919314.9028356: Traceback (most recent call last): File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run self._target(self._args, **self._kwargs) File "unicorn_binance_websocket_api\manager.py", line 584, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager._create_stream_thread File "C:\Users\Ale\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "unicorn_binance_websocket_api\sockets.py", line 50, in start_socket File "unicorn_binance_websocket_api\connection.py", line 65, in aenter File "unicorn_binance_websocket_api\manager.py", line 1563, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.create_websocket_uri File "unicorn_binance_websocket_api\manager.py", line 2140, in unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.get_listen_key_from_restclient File "unicorn_binance_websocket_api\restclient.py", line 121, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key File "unicorn_binance_websocket_api\restclient.py", line 128, in unicorn_binance_websocket_api.restclient.BinanceWebSocketApiRestclient.get_listen_key File "unicorn_binance_rest_api\manager.py", line 236, in unicorn_binance_rest_api.manager.BinanceRestApiManager.init File "lucit_licensing_python\manager.py", line 131, in lucit_licensing_python.manager.LucitLicensingManager.init lucit_licensing_python.exceptions.NoValidatedLucitLicense: Please provide the api secret and license token of your lucit license! Read this article for more information: https://medium.lucit.tech/87b0088124a8

oliver-zehentleitner commented 7 months ago

This error is from the rest manager. I will update it in a few hours. In the mean time as a workaround using the license.ini file should fix it for you.

oliver-zehentleitner commented 7 months ago

I updated the full stack:

pip install unicorn-binance-websocket-api —upgrade
pip install unicorn-binance-rest-api —upgrade
pip install lucit-licensing-python —upgrade
pip install unicorn-fy —upgrade
oliver-zehentleitner commented 7 months ago

can we close this?

aleangelin88 commented 7 months ago

it works now, thank you