mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-23 00:34:22 +01:00
Remove BfxWebsocketClient::once. Replace all occurrences with BfxWebsocketClient::on. Add BfxWebsocketClient::ONCE_EVENTS class variable.
This commit is contained in:
@@ -16,7 +16,7 @@ def on_derivatives_status_update(subscription: subscriptions.Status, data: Deriv
|
||||
def on_wss_error(code: Error, msg: str):
|
||||
print(code, msg)
|
||||
|
||||
@bfx.wss.once("open")
|
||||
@bfx.wss.on("open")
|
||||
async def on_open():
|
||||
await bfx.wss.subscribe(Channel.STATUS, key="deriv:tBTCF0:USTF0")
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ def on_t_ticker_update(subscription: subscriptions.Ticker, data: TradingPairTick
|
||||
|
||||
print(f"Data: {data}")
|
||||
|
||||
@bfx.wss.once("open")
|
||||
@bfx.wss.on("open")
|
||||
async def on_open():
|
||||
await bfx.wss.subscribe(Channel.TICKER, symbol="tBTCUSD")
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ def on_t_trade_executed(_sub: subscriptions.Trades, trade: TradingPairTrade):
|
||||
def on_wss_error(code: Error, msg: str):
|
||||
print(code, msg)
|
||||
|
||||
@bfx.wss.once("open")
|
||||
@bfx.wss.on("open")
|
||||
async def on_open():
|
||||
await bfx.wss.subscribe(Channel.CANDLES, key="trade:1m:tBTCUSD")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user