11from hyperliquid .api import API
2- from hyperliquid .utils .types import Any , Callable , Meta , SpotMeta , SpotMetaAndAssetCtxs , Optional , Subscription , cast , Cloid
2+ from hyperliquid .utils .types import (
3+ Any ,
4+ Callable ,
5+ Meta ,
6+ SpotMeta ,
7+ SpotMetaAndAssetCtxs ,
8+ Optional ,
9+ Subscription ,
10+ cast ,
11+ Cloid ,
12+ )
313from hyperliquid .websocket_manager import WebsocketManager
414
515
@@ -171,36 +181,36 @@ def meta(self) -> Meta:
171181 }
172182 """
173183 return cast (Meta , self .post ("/info" , {"type" : "meta" }))
174-
175- def metaAndAssetCtxs (self ) -> Any :
184+
185+ def meta_and_asset_ctxs (self ) -> Any :
176186 """Retrieve exchange MetaAndAssetCtxs
177-
187+
178188 POST /info
179-
189+
180190 Returns:
181191 [
182192 {
183193 universe: [
184194 {
185- 'maxLeverage': int,
186195 'name': str,
187- 'onlyIsolated': bool,
188196 'szDecimals': int
197+ 'maxLeverage': int,
198+ 'onlyIsolated': bool,
189199 },
190200 ...
191201 ]
192202 },
193203 [
194204 {
195- "dayNtlVlm": str ,
196- "funding": str ,
197- "impactPxs": [str, str] ,
198- "markPx": str ,
199- "midPx": str ,
200- "openInterest": str ,
201- "oraclePx": str ,
202- "premium": str ,
203- "prevDayPx": str
205+ "dayNtlVlm": float string ,
206+ "funding": float string ,
207+ "impactPxs": Optional([float string, float string]) ,
208+ "markPx": Optional(float string) ,
209+ "midPx": Optional(float string) ,
210+ "openInterest": float string ,
211+ "oraclePx": float string ,
212+ "premium": Optional(float string) ,
213+ "prevDayPx": float string
204214 },
205215 ...
206216 ]
@@ -216,13 +226,13 @@ def spot_meta(self) -> SpotMeta:
216226 {
217227 universe: [
218228 {
219- tokens: [int, int],
229+ tokens: [int, int]
220230 name: str,
221231 index: int,
222232 isCanonical: bool
223233 },
224234 ...
225- ]
235+ ],
226236 tokens: [
227237 {
228238 name: str,
@@ -233,42 +243,45 @@ def spot_meta(self) -> SpotMeta:
233243 isCanonical: bool
234244 },
235245 ...
236- ],
246+ ]
237247 }
238248 """
239249 return cast (SpotMeta , self .post ("/info" , {"type" : "spotMeta" }))
240-
250+
241251 def spot_meta_and_asset_ctxs (self ) -> SpotMetaAndAssetCtxs :
242252 """Retrieve exchange spot asset contexts
243-
244253 POST /info
245-
246254 Returns:
247255 [
248256 {
249257 universe: [
250258 {
251- name: str,
252259 tokens: [int, int]
253- }
260+ name: str,
261+ index: int,
262+ isCanonical: bool
263+ },
254264 ...
255265 ],
256266 tokens: [
257267 {
258268 name: str,
259269 szDecimals: int,
260- weiDecimals int
270+ weiDecimals: int,
271+ index: int,
272+ tokenId: str,
273+ isCanonical: bool
261274 },
262275 ...
263276 ]
264277 },
265278 [
266279 {
267- dayNtlVlm: float,
268- markPx: float,
269- midPx: float,
270- prevDayPx: float,
271- circulatingSupply: float,
280+ dayNtlVlm: float string ,
281+ markPx: float string ,
282+ midPx: Optional( float string) ,
283+ prevDayPx: float string ,
284+ circulatingSupply: float string ,
272285 coin: str
273286 }
274287 ...
0 commit comments