Files
bitfinex-api-py/bfxapi/websocket/subscriptions.py
2023-10-09 04:57:17 +02:00

35 lines
753 B
Python

from typing import \
Union, Literal, TypedDict
Subscription = Union["Ticker", "Trades", "Book", "Candles", "Status"]
Channel = Literal["ticker", "trades", "book", "candles", "status"]
class Ticker(TypedDict):
channel: Literal["ticker"]
sub_id: str
symbol: str
class Trades(TypedDict):
channel: Literal["trades"]
sub_id: str
symbol: str
class Book(TypedDict):
channel: Literal["book"]
sub_id: str
symbol: str
prec: Literal["R0", "P0", "P1", "P2", "P3", "P4"]
freq: Literal["F0", "F1"]
len: Literal["1", "25", "100", "250"]
class Candles(TypedDict):
channel: Literal["candles"]
sub_id: str
key: str
class Status(TypedDict):
channel: Literal["status"]
sub_id: str
key: str