mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Fix small bug in examples/websocket/ticker.py demo.
This commit is contained in:
@@ -96,8 +96,8 @@ class BfxWebsocketClient(object):
|
||||
if await asyncio.gather(*[on_open_event.wait() for on_open_event in self.on_open_events]):
|
||||
self.event_emitter.emit("open")
|
||||
|
||||
if self.credentials != None:
|
||||
await self.__authenticate(**self.credentials)
|
||||
if credentials and credentials["API_KEY"] and credentials["API_SECRET"]:
|
||||
await self.__authenticate(**credentials)
|
||||
|
||||
async for message in websocket:
|
||||
message = json.loads(message)
|
||||
|
||||
@@ -10,7 +10,7 @@ bfx = Client(WSS_HOST=Constants.PUB_WSS_HOST)
|
||||
|
||||
@bfx.wss.on("t_ticker_update")
|
||||
def on_t_ticker_update(subscription: subscriptions.Ticker, data: TradingPairTicker):
|
||||
print(f"Subscription with channel ID: {subscription['chanId']}")
|
||||
print(f"Subscription with subId: {subscription['subId']}")
|
||||
|
||||
print(f"Data: {data}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user