cnfuyu / python-binance-api

A Python 2/3 client for the Binance REST and WebSocket APIs
https://www.binance.com/restapipub.html
MIT License
34 stars 14 forks source link

"missing 1 required positional argument 'message'" when opening a websocket for aggTrades #4

Open B00mGit opened 5 years ago

B00mGit commented 5 years ago

Hi, I'm getting the above error when using the following code:

from binance.client import BinanceRESTAPI, BinanceWebSocketAPI

#rest_client = BinanceRESTAPI(api_key, secret_key)
ws_client = BinanceWebSocketAPI(
    "-----------MY-API-KEY-----------------")

def on_print(trade):
    print(trade.symbol, trade.price, trade.qty)

ws_client.aggregate_trade("ETHBTC", callback=on_print)

Full output:

ERROR:websocket:error from callback <bound method WebSocket._on_message of <binance.request.WebSocket object at 0x35b671
0>>: _on_message() missing 1 required positional argument: 'message'
oliver-zehentleitner commented 5 years ago

I fixed that issue, please pull it.

oliver-zehentleitner commented 5 years ago

Till this gets merged, here is a download to a fixed version: https://github.com/unicorn-data-analysis/python-binance-api/releases/tag/release_1.1.1

oliver-zehentleitner commented 5 years ago

Since we did not found a websocket implementation that satisfied our needs, we wrote a new python websocket api implementation for binance: https://github.com/unicorn-data-analysis/unicorn-binance-websocket-api