mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-23 16:54:20 +01:00
Rename bfxapi/websocket/errors.py to exceptions.py. Add Errors enumeration inside BfxWebsocketClient.py and bfxapi/websocket/__init__.py.
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import json, asyncio, hmac, hashlib, time, uuid, websockets
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from pyee.asyncio import AsyncIOEventEmitter
|
||||
|
||||
from .handlers import Channels, PublicChannelsHandler, AuthenticatedChannelsHandler
|
||||
|
||||
from .errors import ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion
|
||||
from .exceptions import ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion
|
||||
|
||||
HEARTBEAT = "hb"
|
||||
|
||||
@@ -191,4 +193,21 @@ class _BfxWebsocketBucket(object):
|
||||
|
||||
@_require_websocket_connection
|
||||
async def close(self, code=1000, reason=str()):
|
||||
await self.websocket.close(code=code, reason=reason)
|
||||
await self.websocket.close(code=code, reason=reason)
|
||||
|
||||
class Errors(int, Enum):
|
||||
ERR_UNK = 10000
|
||||
ERR_GENERIC = 10001
|
||||
ERR_CONCURRENCY = 10008
|
||||
ERR_PARAMS = 10020
|
||||
ERR_CONF_FAIL = 10050
|
||||
ERR_AUTH_FAIL = 10100
|
||||
ERR_AUTH_PAYLOAD = 10111
|
||||
ERR_AUTH_SIG = 10112
|
||||
ERR_AUTH_HMAC = 10113
|
||||
ERR_AUTH_NONCE = 10114
|
||||
ERR_UNAUTH_FAIL = 10200
|
||||
ERR_SUB_FAIL = 10300
|
||||
ERR_SUB_MULTI = 10301
|
||||
ERR_UNSUB_FAIL = 10400
|
||||
ERR_READY = 11000
|
||||
@@ -1,3 +1,3 @@
|
||||
from .BfxWebsocketClient import BfxWebsocketClient
|
||||
from .BfxWebsocketClient import BfxWebsocketClient, Errors
|
||||
from .handlers import Channels
|
||||
from .errors import BfxWebsocketException, ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion
|
||||
from .exceptions import BfxWebsocketException, ConnectionNotOpen, TooManySubscriptions, WebsocketAuthenticationRequired, InvalidAuthenticationCredentials, EventNotSupported, OutdatedClientVersion
|
||||
@@ -2,7 +2,7 @@ from enum import Enum
|
||||
|
||||
from . import serializers
|
||||
|
||||
from .errors import BfxWebsocketException
|
||||
from .exceptions import BfxWebsocketException
|
||||
|
||||
def _get_sub_dictionary(dictionary, keys):
|
||||
return { key: dictionary[key] for key in dictionary if key in keys }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from .errors import BfxWebsocketException
|
||||
from .exceptions import BfxWebsocketException
|
||||
|
||||
class _Serializer(object):
|
||||
def __init__(self, name, labels):
|
||||
|
||||
Reference in New Issue
Block a user