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
685 stars 165 forks source link

TypeError: process_stream_data() got an unexpected keyword argument 'stream_buffer_name' #128

Closed nikky78 closed 3 years ago

nikky78 commented 3 years ago

Hi,

I tried to make the exemple with BinanceWebSocketApiProcessStreams works like below:

binance_websocket_api_manager = BinanceWebSocketApiManager(BinanceWebSocketApiProcessStreams.process_stream_data)

trade_stream_id = binance_websocket_api_manager.create_stream({'trade'}, {'bnbbtc', 'ethbtc', 'btcusdt'})

but get the error:


Exception in thread Thread-11:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
    self.run()
  File "C:\ProgramData\Anaconda3\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\unicorn_binance_websocket_api\unicorn_binance_websocket_api_manager.py", line 415, in _create_stream_thread
    loop.run_until_complete(socket.start_socket())
  File "C:\ProgramData\Anaconda3\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\ProgramData\Anaconda3\lib\site-packages\unicorn_binance_websocket_api\unicorn_binance_websocket_api_socket.py", line 149, in start_socket
    self.manager.process_stream_data(received_stream_data,
TypeError: process_stream_data() got an unexpected keyword argument 'stream_buffer_name'
oliver-zehentleitner commented 3 years ago

Thank you! I fixed it! https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/commit/b80c9b651c8df5d5138206c4c05229829ffae683

oliver-zehentleitner commented 3 years ago

Maybe you want to know that the use of the stream_buffer is better than using process_stream_data: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/issues/88#issuecomment-656330049

nikky78 commented 3 years ago

Thanks for the heads-up!