mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Add config to enable checksums in BfxWebSocketBucket.
This commit is contained in:
@@ -14,6 +14,8 @@ if TYPE_CHECKING:
|
||||
from websockets.client import WebSocketClientProtocol
|
||||
from pyee import EventEmitter
|
||||
|
||||
_CHECKSUM_FLAG_VALUE = 131_072
|
||||
|
||||
class BfxWebSocketBucket(Connection):
|
||||
VERSION = 2
|
||||
|
||||
@@ -45,6 +47,8 @@ class BfxWebSocketBucket(Connection):
|
||||
|
||||
await self.__recover_state()
|
||||
|
||||
await self.__set_conf(flags=_CHECKSUM_FLAG_VALUE)
|
||||
|
||||
async with self.__condition:
|
||||
self.__condition.notify(1)
|
||||
|
||||
@@ -84,6 +88,10 @@ class BfxWebSocketBucket(Connection):
|
||||
|
||||
self.__subscriptions.clear()
|
||||
|
||||
async def __set_conf(self, flags: int) -> None:
|
||||
await self._websocket.send(json.dumps( \
|
||||
{ "event": "conf", "flags": flags }))
|
||||
|
||||
@Connection.require_websocket_connection
|
||||
async def subscribe(self,
|
||||
channel: str,
|
||||
|
||||
Reference in New Issue
Block a user