Add bfxapi/enums.py file. Split enumerations in bfxapi/rest/enums.py and bfxapi/websocket/enums.py. Rename enumeration classes to use singular name identifiers.

This commit is contained in:
Davide Casale
2022-12-22 18:42:55 +01:00
parent 4f63f4068e
commit 454a7542ed
6 changed files with 55 additions and 54 deletions

View File

@@ -5,7 +5,7 @@ from typing import List
from bfxapi import Client, Constants
from bfxapi.websocket import BfxWebsocketClient
from bfxapi.websocket.enums import Channels, Errors
from bfxapi.websocket.enums import Channels, Error
from bfxapi.websocket.typings import Subscriptions, TradingPairRawBook
class RawOrderBook(object):
@@ -39,7 +39,7 @@ raw_order_book = RawOrderBook(symbols=SYMBOLS)
bfx = Client(WSS_HOST=Constants.PUB_WSS_HOST)
@bfx.wss.on("wss-error")
def on_wss_error(code: Errors, msg: str):
def on_wss_error(code: Error, msg: str):
print(code, msg)
@bfx.wss.on("open")