diff --git a/bfxapi/websocket/client/bfx_websocket_client.py b/bfxapi/websocket/client/bfx_websocket_client.py index 7fb2661..d90230f 100644 --- a/bfxapi/websocket/client/bfx_websocket_client.py +++ b/bfxapi/websocket/client/bfx_websocket_client.py @@ -11,7 +11,7 @@ from pyee.asyncio import AsyncIOEventEmitter from .bfx_websocket_bucket import _HEARTBEAT, F, _require_websocket_connection, BfxWebsocketBucket from .bfx_websocket_inputs import BfxWebsocketInputs -from ..handlers import PublicChannelsHandler, AuthenticatedChannelsHandler +from ..handlers import PublicChannelsHandler, AuthenticatedEventsHandler from ..exceptions import WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, \ ZeroConnectionsError, ReconnectionTimeoutError, OutdatedClientVersion @@ -60,7 +60,7 @@ class BfxWebsocketClient: EVENTS = [ *ONCE_EVENTS, "subscribed", "wss-error", *PublicChannelsHandler.EVENTS, - *AuthenticatedChannelsHandler.EVENTS + *AuthenticatedEventsHandler.EVENTS ] def __init__(self, host, credentials, *, wss_timeout = 60 * 15, log_filename = None, log_level = "INFO"): @@ -70,7 +70,7 @@ class BfxWebsocketClient: self.event_emitter = AsyncIOEventEmitter() - self.handler = AuthenticatedChannelsHandler(event_emitter=self.event_emitter) + self.handler = AuthenticatedEventsHandler(event_emitter=self.event_emitter) self.inputs = BfxWebsocketInputs(handle_websocket_input=self.__handle_websocket_input) diff --git a/bfxapi/websocket/handlers/__init__.py b/bfxapi/websocket/handlers/__init__.py index d55ea1e..98dadbb 100644 --- a/bfxapi/websocket/handlers/__init__.py +++ b/bfxapi/websocket/handlers/__init__.py @@ -1,2 +1,2 @@ from .public_channels_handler import PublicChannelsHandler -from .authenticated_channels_handler import AuthenticatedChannelsHandler +from .authenticated_events_handler import AuthenticatedEventsHandler diff --git a/bfxapi/websocket/handlers/authenticated_channels_handler.py b/bfxapi/websocket/handlers/authenticated_events_handler.py similarity index 93% rename from bfxapi/websocket/handlers/authenticated_channels_handler.py rename to bfxapi/websocket/handlers/authenticated_events_handler.py index 221217e..6fd42c4 100644 --- a/bfxapi/websocket/handlers/authenticated_channels_handler.py +++ b/bfxapi/websocket/handlers/authenticated_events_handler.py @@ -4,7 +4,7 @@ from .. serializers import _Notification from .. exceptions import HandlerNotFound -class AuthenticatedChannelsHandler: +class AuthenticatedEventsHandler: __abbreviations = { "os": "order_snapshot", "on": "order_new", "ou": "order_update", "oc": "order_cancel", "ps": "position_snapshot", "pn": "position_new", @@ -43,9 +43,9 @@ class AuthenticatedChannelsHandler: if abbrevation == "n": return self.__notification(stream) - for abbrevations, serializer in AuthenticatedChannelsHandler.__serializers.items(): + for abbrevations, serializer in AuthenticatedEventsHandler.__serializers.items(): if abbrevation in abbrevations: - event = AuthenticatedChannelsHandler.__abbreviations[abbrevation] + event = AuthenticatedEventsHandler.__abbreviations[abbrevation] if all(isinstance(substream, list) for substream in stream): return self.event_emitter.emit(event, [ serializer.parse(*substream) for substream in stream ])