Fix small bug in examples/websocket/ticker.py demo.

This commit is contained in:
Davide Casale
2023-02-17 04:04:50 +01:00
parent 4d0fa49e22
commit 9eb2c73407
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -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}")