|
37 | 37 | SpotMetaAndAssetCtxs = Tuple[SpotMeta, List[SpotAssetCtx]] |
38 | 38 |
|
39 | 39 | AllMidsSubscription = TypedDict("AllMidsSubscription", {"type": Literal["allMids"]}) |
| 40 | +BboSubscription = TypedDict("BboSubscription", {"type": Literal["bbo"], "coin": str}) |
40 | 41 | L2BookSubscription = TypedDict("L2BookSubscription", {"type": Literal["l2Book"], "coin": str}) |
41 | 42 | TradesSubscription = TypedDict("TradesSubscription", {"type": Literal["trades"], "coin": str}) |
42 | 43 | UserEventsSubscription = TypedDict("UserEventsSubscription", {"type": Literal["userEvents"], "user": str}) |
|
51 | 52 | # If adding new subscription types that contain coin's don't forget to handle automatically rewrite name to coin in info.subscribe |
52 | 53 | Subscription = Union[ |
53 | 54 | AllMidsSubscription, |
| 55 | + BboSubscription, |
54 | 56 | L2BookSubscription, |
55 | 57 | TradesSubscription, |
56 | 58 | UserEventsSubscription, |
|
65 | 67 | AllMidsData = TypedDict("AllMidsData", {"mids": Dict[str, str]}) |
66 | 68 | AllMidsMsg = TypedDict("AllMidsMsg", {"channel": Literal["allMids"], "data": AllMidsData}) |
67 | 69 | L2Level = TypedDict("L2Level", {"px": str, "sz": str, "n": int}) |
| 70 | +BboData = TypedDict("BboData", {"coin": str, "time": int, "bbo": Tuple[Optional[L2Level], Optional[L2Level]]}) |
| 71 | +BboMsg = TypedDict("BboMsg", {"channel": Literal["bbo"], "data": BboData}) |
68 | 72 | L2BookData = TypedDict("L2BookData", {"coin": str, "levels": Tuple[List[L2Level], List[L2Level]], "time": int}) |
69 | 73 | L2BookMsg = TypedDict("L2BookMsg", {"channel": Literal["l2Book"], "data": L2BookData}) |
70 | 74 | PongMsg = TypedDict("PongMsg", {"channel": Literal["pong"]}) |
|
108 | 112 | }, |
109 | 113 | total=False, |
110 | 114 | ) |
111 | | -WsMsg = Union[AllMidsMsg, L2BookMsg, TradesMsg, UserEventsMsg, PongMsg, UserFillsMsg, OtherWsMsg] |
| 115 | +WsMsg = Union[AllMidsMsg, BboMsg, L2BookMsg, TradesMsg, UserEventsMsg, PongMsg, UserFillsMsg, OtherWsMsg] |
112 | 116 |
|
113 | 117 | # b is the public address of the builder, f is the amount of the fee in tenths of basis points. e.g. 10 means 1 basis point |
114 | 118 | BuilderInfo = TypedDict("BuilderInfo", {"b": str, "f": int}) |
|
0 commit comments