mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2026-02-23 14:34:31 +01:00
Rewrite AuthenticatedEventsHandler with _label_array_elements logic. Add support to multiple new events. Fix bug in BfxWebsocketClient.py.
This commit is contained in:
@@ -43,9 +43,9 @@ class BfxWebsocketClient(object):
|
||||
if message["status"] == "OK":
|
||||
self.event_emitter.emit("authenticated", message)
|
||||
else: raise AuthenticationCredentialsError("Cannot authenticate with given API-KEY and API-SECRET.")
|
||||
elif isinstance(message, list) and (chanId := message[0]) and message[1] != HEARTBEAT:
|
||||
elif isinstance(message, list) and ((chanId := message[0]) or True) and message[1] != HEARTBEAT:
|
||||
if chanId == 0:
|
||||
self.handlers["authenticated"].handle(message[1], *message[2:])
|
||||
self.handlers["authenticated"].handle(message[1], message[2])
|
||||
else: self.handlers["public"].handle(self.chanIds[chanId], *message[1:])
|
||||
except websockets.ConnectionClosed:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user