|
50 | 50 | ) |
51 | 51 | WebData2Subscription = TypedDict("WebData2Subscription", {"type": Literal["webData2"], "user": str}) |
52 | 52 | ActiveAssetCtxSubscription = TypedDict("ActiveAssetCtxSubscription", {"type": Literal["activeAssetCtx"], "coin": str}) |
| 53 | +ActiveAssetDataSubscription = TypedDict( |
| 54 | + "ActiveAssetDataSubscription", {"type": Literal["activeAssetData"], "user": str, "coin": str} |
| 55 | +) |
53 | 56 | # If adding new subscription types that contain coin's don't forget to handle automatically rewrite name to coin in info.subscribe |
54 | 57 | Subscription = Union[ |
55 | 58 | AllMidsSubscription, |
|
64 | 67 | UserNonFundingLedgerUpdatesSubscription, |
65 | 68 | WebData2Subscription, |
66 | 69 | ActiveAssetCtxSubscription, |
| 70 | + ActiveAssetDataSubscription, |
67 | 71 | ] |
68 | 72 |
|
69 | 73 | AllMidsData = TypedDict("AllMidsData", {"mids": Dict[str, str]}) |
|
75 | 79 | BboMsg = TypedDict("BboMsg", {"channel": Literal["bbo"], "data": BboData}) |
76 | 80 | PongMsg = TypedDict("PongMsg", {"channel": Literal["pong"]}) |
77 | 81 | Trade = TypedDict("Trade", {"coin": str, "side": Side, "px": str, "sz": int, "hash": str, "time": int}) |
| 82 | +Leverage = TypedDict( |
| 83 | + "Leverage", |
| 84 | + { |
| 85 | + "type": Union[Literal["cross"], Literal["isolated"]], |
| 86 | + "value": int, |
| 87 | + "rawUsd": Optional[str], |
| 88 | + }, |
| 89 | +) |
78 | 90 | TradesMsg = TypedDict("TradesMsg", {"channel": Literal["trades"], "data": List[Trade]}) |
79 | 91 | PerpAssetCtx = TypedDict( |
80 | 92 | "PerpAssetCtx", |
|
97 | 109 | ActiveSpotAssetCtxMsg = TypedDict( |
98 | 110 | "ActiveSpotAssetCtxMsg", {"channel": Literal["activeSpotAssetCtx"], "data": ActiveSpotAssetCtx} |
99 | 111 | ) |
| 112 | +ActiveAssetData = TypedDict( |
| 113 | + "ActiveAssetData", |
| 114 | + { |
| 115 | + "user": str, |
| 116 | + "coin": str, |
| 117 | + "leverage": Leverage, |
| 118 | + "maxTradeSzs": List[str], |
| 119 | + "availableToTrade": List[str], |
| 120 | + "markPx": str, |
| 121 | + }, |
| 122 | +) |
| 123 | +ActiveAssetDataMsg = TypedDict("ActiveAssetDataMsg", {"channel": Literal["activeAssetData"], "data": ActiveAssetData}) |
100 | 124 | Fill = TypedDict( |
101 | 125 | "Fill", |
102 | 126 | { |
|
0 commit comments