mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
35 lines
753 B
Python
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
|