Skip to content

Commit 8eadff5

Browse files
committed
Add WsBbo
1 parent 719c002 commit 8eadff5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

hyperliquid/utils/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
SpotMetaAndAssetCtxs = Tuple[SpotMeta, List[SpotAssetCtx]]
3838

3939
AllMidsSubscription = TypedDict("AllMidsSubscription", {"type": Literal["allMids"]})
40+
BboSubscription = TypedDict("BboSubscription", {"type": Literal["bbo"], "coin": str})
4041
L2BookSubscription = TypedDict("L2BookSubscription", {"type": Literal["l2Book"], "coin": str})
4142
TradesSubscription = TypedDict("TradesSubscription", {"type": Literal["trades"], "coin": str})
4243
UserEventsSubscription = TypedDict("UserEventsSubscription", {"type": Literal["userEvents"], "user": str})
@@ -51,6 +52,7 @@
5152
# If adding new subscription types that contain coin's don't forget to handle automatically rewrite name to coin in info.subscribe
5253
Subscription = Union[
5354
AllMidsSubscription,
55+
BboSubscription,
5456
L2BookSubscription,
5557
TradesSubscription,
5658
UserEventsSubscription,
@@ -65,6 +67,7 @@
6567
AllMidsData = TypedDict("AllMidsData", {"mids": Dict[str, str]})
6668
AllMidsMsg = TypedDict("AllMidsMsg", {"channel": Literal["allMids"], "data": AllMidsData})
6769
L2Level = TypedDict("L2Level", {"px": str, "sz": str, "n": int})
70+
BboData = TypedDict("BboData", {"coin": str, "time": int, "bbo": Tuple[Optional[L2Level], Optional[L2Level]]})
6871
L2BookData = TypedDict("L2BookData", {"coin": str, "levels": Tuple[List[L2Level]], "time": int})
6972
L2BookMsg = TypedDict("L2BookMsg", {"channel": Literal["l2Book"], "data": L2BookData})
7073
PongMsg = TypedDict("PongMsg", {"channel": Literal["pong"]})

0 commit comments

Comments
 (0)