diff --git a/bfxapi/websocket/_client/bfx_websocket_bucket.py b/bfxapi/websocket/_client/bfx_websocket_bucket.py index 7e2ada1..2fb1670 100644 --- a/bfxapi/websocket/_client/bfx_websocket_bucket.py +++ b/bfxapi/websocket/_client/bfx_websocket_bucket.py @@ -64,9 +64,6 @@ class BfxWebSocketBucket(Connection): chan_id = cast(int, message["chan_id"]) del self.__subscriptions[chan_id] - elif message["event"] == "error": - self.__event_emitter.emit("wss-error", \ - message["code"], message["msg"]) if isinstance(message, list): if (chan_id := cast(int, message[0])) and \ diff --git a/bfxapi/websocket/_client/bfx_websocket_client.py b/bfxapi/websocket/_client/bfx_websocket_client.py index dff5ec6..1250b85 100644 --- a/bfxapi/websocket/_client/bfx_websocket_client.py +++ b/bfxapi/websocket/_client/bfx_websocket_client.py @@ -240,9 +240,6 @@ class BfxWebSocketClient(Connection): self.__event_emitter.emit("authenticated", message) self._authentication = True - elif message["event"] == "error": - self.__event_emitter.emit("wss-error", \ - message["code"], message["msg"]) if isinstance(message, list) and \ message[0] == 0 and message[1] != Connection._HEARTBEAT: diff --git a/bfxapi/websocket/_event_emitter/bfx_event_emitter.py b/bfxapi/websocket/_event_emitter/bfx_event_emitter.py index 79a7959..31ee983 100644 --- a/bfxapi/websocket/_event_emitter/bfx_event_emitter.py +++ b/bfxapi/websocket/_event_emitter/bfx_event_emitter.py @@ -21,20 +21,19 @@ _ONCE_PER_SUBSCRIPTION = [ ] _COMMON = [ - "error", "wss-error", "disconnected", - "t_ticker_update", "f_ticker_update", "t_trade_execution", - "t_trade_execution_update", "f_trade_execution", "f_trade_execution_update", - "t_book_update", "f_book_update", "t_raw_book_update", - "f_raw_book_update", "candles_update", "derivatives_status_update", - "liquidation_feed_update", "order_new", "order_update", - "order_cancel", "position_new", "position_update", - "position_close", "funding_offer_new", "funding_offer_update", - "funding_offer_cancel", "funding_credit_new", "funding_credit_update", - "funding_credit_close", "funding_loan_new", "funding_loan_update", - "funding_loan_close", "trade_execution", "trade_execution_update", - "wallet_update", "notification", "on-req-notification", - "ou-req-notification", "oc-req-notification", "fon-req-notification", - "foc-req-notification" + "error", "disconnected", "t_ticker_update", + "f_ticker_update", "t_trade_execution", "t_trade_execution_update", + "f_trade_execution", "f_trade_execution_update", "t_book_update", + "f_book_update", "t_raw_book_update", "f_raw_book_update", + "candles_update", "derivatives_status_update", "liquidation_feed_update", + "order_new", "order_update", "order_cancel", + "position_new", "position_update", "position_close", + "funding_offer_new", "funding_offer_update", "funding_offer_cancel", + "funding_credit_new", "funding_credit_update", "funding_credit_close", + "funding_loan_new", "funding_loan_update", "funding_loan_close", + "trade_execution", "trade_execution_update", "wallet_update", + "notification", "on-req-notification", "ou-req-notification", + "oc-req-notification", "fon-req-notification", "foc-req-notification" ] class BfxEventEmitter(AsyncIOEventEmitter): diff --git a/examples/websocket/auth/submit_order.py b/examples/websocket/auth/submit_order.py index 0c2d03b..a65935a 100644 --- a/examples/websocket/auth/submit_order.py +++ b/examples/websocket/auth/submit_order.py @@ -12,10 +12,6 @@ bfx = Client( api_secret=os.getenv("BFX_API_SECRET") ) -@bfx.wss.on("wss-error") -def on_wss_error(code: Error, msg: str): - print(code, msg) - @bfx.wss.on("authenticated") async def on_authenticated(event): print(f"Authentication: {event}") diff --git a/examples/websocket/auth/wallets.py b/examples/websocket/auth/wallets.py index 057ad29..a8d40ed 100644 --- a/examples/websocket/auth/wallets.py +++ b/examples/websocket/auth/wallets.py @@ -14,10 +14,6 @@ bfx = Client( filters=["wallet"] ) -@bfx.wss.on("wss-error") -def on_wss_error(code: Error, msg: str): - print(code, msg) - @bfx.wss.on("wallet_snapshot") def on_wallet_snapshot(wallets: List[Wallet]): for wallet in wallets: diff --git a/examples/websocket/public/derivatives_status.py b/examples/websocket/public/derivatives_status.py index d55c492..982d3cb 100644 --- a/examples/websocket/public/derivatives_status.py +++ b/examples/websocket/public/derivatives_status.py @@ -12,10 +12,6 @@ bfx = Client(wss_host=PUB_WSS_HOST) def on_derivatives_status_update(subscription: Status, data: DerivativesStatus): print(f"{subscription}:", data) -@bfx.wss.on("wss-error") -def on_wss_error(code: Error, msg: str): - print(code, msg) - @bfx.wss.on("open") async def on_open(): await bfx.wss.subscribe(Channel.STATUS, key="deriv:tBTCF0:USTF0") diff --git a/examples/websocket/public/order_book.py b/examples/websocket/public/order_book.py index 497e787..5201ed8 100644 --- a/examples/websocket/public/order_book.py +++ b/examples/websocket/public/order_book.py @@ -70,10 +70,6 @@ order_book = OrderBook(symbols=SYMBOLS) bfx = Client(wss_host=PUB_WSS_HOST) -@bfx.wss.on("wss-error") -def on_wss_error(code: Error, msg: str): - print(code, msg) - @bfx.wss.on("open") async def on_open(): for symbol in SYMBOLS: diff --git a/examples/websocket/public/raw_order_book.py b/examples/websocket/public/raw_order_book.py index a08d9bb..dedd291 100644 --- a/examples/websocket/public/raw_order_book.py +++ b/examples/websocket/public/raw_order_book.py @@ -70,10 +70,6 @@ raw_order_book = RawOrderBook(symbols=SYMBOLS) bfx = Client(wss_host=PUB_WSS_HOST) -@bfx.wss.on("wss-error") -def on_wss_error(code: Error, msg: str): - print(code, msg) - @bfx.wss.on("open") async def on_open(): for symbol in SYMBOLS: diff --git a/examples/websocket/public/trades.py b/examples/websocket/public/trades.py index e079904..79dc71e 100644 --- a/examples/websocket/public/trades.py +++ b/examples/websocket/public/trades.py @@ -16,10 +16,6 @@ def on_candles_update(_sub: Candles, candle: Candle): def on_t_trade_execution(_sub: 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.on("open") async def on_open(): await bfx.wss.subscribe(Channel.CANDLES, key="trade:1m:tBTCUSD")