mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-19 14:54:21 +01:00
Rewrite reconnection system with numerous fixes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import TypedDict, Union, Optional
|
||||
from typing import TypedDict, Union, Literal, Optional
|
||||
|
||||
__all__ = [
|
||||
"Subscription",
|
||||
@@ -10,22 +10,22 @@ __all__ = [
|
||||
"Status"
|
||||
]
|
||||
|
||||
_Header = TypedDict("_Header", { "event": str, "channel": str, "subId": str })
|
||||
_Header = TypedDict("_Header", { "event": Literal["subscribed"], "channel": str, "chanId": int })
|
||||
|
||||
Subscription = Union["Ticker", "Trades", "Book", "Candles", "Status"]
|
||||
|
||||
class Ticker(TypedDict):
|
||||
chanId: int; symbol: str
|
||||
subId: str; symbol: str
|
||||
pair: Optional[str]
|
||||
currency: Optional[str]
|
||||
|
||||
class Trades(TypedDict):
|
||||
chanId: int; symbol: str
|
||||
subId: str; symbol: str
|
||||
pair: Optional[str]
|
||||
currency: Optional[str]
|
||||
|
||||
class Book(TypedDict):
|
||||
chanId: int
|
||||
subId: str
|
||||
symbol: str
|
||||
prec: str
|
||||
freq: str
|
||||
@@ -33,9 +33,9 @@ class Book(TypedDict):
|
||||
pair: str
|
||||
|
||||
class Candles(TypedDict):
|
||||
chanId: int
|
||||
subId: str
|
||||
key: str
|
||||
|
||||
class Status(TypedDict):
|
||||
chanId: int
|
||||
subId: str
|
||||
key: str
|
||||
Reference in New Issue
Block a user