Apply pylint's linting rules to examples/websocket/public/*.py.

This commit is contained in:
Davide Casale
2023-03-08 21:36:25 +01:00
parent 834a664034
commit d04ebb96d5
5 changed files with 23 additions and 23 deletions

View File

@@ -9,21 +9,21 @@ from bfxapi.websocket import subscriptions
bfx = Client(wss_host=PUB_WSS_HOST)
@bfx.wss.on("candles_update")
def on_candles_update(subscription: subscriptions.Candles, candle: Candle):
print(f"New candle: {candle}")
def on_candles_update(_sub: subscriptions.Candles, candle: Candle):
print(f"New candle: {candle}")
@bfx.wss.on("t_trade_executed")
def on_t_trade_executed(subscription: subscriptions.Trades, trade: TradingPairTrade):
print(f"New trade: {trade}")
def on_t_trade_executed(_sub: subscriptions.Trades, trade: TradingPairTrade):
print(f"New trade: {trade}")
@bfx.wss.on("wss-error")
def on_wss_error(code: Error, msg: str):
print(code, msg)
@bfx.wss.once("open")
async def open():
async def on_open():
await bfx.wss.subscribe(Channel.CANDLES, key="trade:1m:tBTCUSD")
await bfx.wss.subscribe(Channel.TRADES, symbol="tBTCUSD")
bfx.wss.run()
bfx.wss.run()