Improve and rewrite bfxapi.websocket.subscriptions.

This commit is contained in:
Davide Casale
2023-05-19 15:37:03 +02:00
parent 8d0df0f3c2
commit 59a0dca66e

View File

@@ -1,16 +1,18 @@
from typing import TypedDict, Union, Literal, Optional
__all__ = [
"Subscription",
"Ticker",
"Trades",
"Book",
"Candles",
"Status"
_Channel = Literal[
"ticker",
"trades",
"book",
"candles",
"status"
]
_Header = TypedDict("_Header", { "event": Literal["subscribed"], "channel": str, "chanId": int })
_Header = TypedDict("_Header", {
"event": Literal["subscribed"],
"channel": _Channel,
"chanId": int
})
Subscription = Union[_Header, "Ticker", "Trades", "Book", "Candles", "Status"]