async-hyperliquid 0.4.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: async-hyperliquid
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Async Hyperliquid client using aiohttp
5
5
  Keywords: dex,hyperliquid,async,aiohttp,trading,cryptocurrency,defi
6
6
  Author: Yuki
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "async-hyperliquid"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "Async Hyperliquid client using aiohttp"
5
5
  authors = [{ name = "Yuki", email = "yuqi.lyle@gmail.com" }]
6
6
  readme = "README.md"
@@ -57,6 +57,7 @@ dev = [
57
57
  "pre-commit>=4.1.0",
58
58
  "python-dotenv>=1.0.1",
59
59
  "hyperliquid-python-sdk>=0.19.0",
60
+ "ty>=0.0.22",
60
61
  ]
61
62
 
62
63
  [project.urls]
@@ -168,6 +168,7 @@ class AsyncHyperliquid(AsyncAPI):
168
168
  self.asset_sz_decimals[asset] = info["szDecimals"]
169
169
 
170
170
  def _init_spot_meta(self, meta: SpotMeta) -> None:
171
+ total_tokens = len(meta["tokens"])
171
172
  for info in meta["universe"]:
172
173
  asset = info["index"] + SPOT_OFFSET
173
174
  asset_name = info["name"]
@@ -177,6 +178,10 @@ class AsyncHyperliquid(AsyncAPI):
177
178
  self.coin_names[asset_name] = asset_name
178
179
  # For token pairs
179
180
  base, quote = info["tokens"]
181
+ if base >= total_tokens or quote >= total_tokens:
182
+ print("Unreconized token index for: ", info)
183
+ continue
184
+
180
185
  base_info = meta["tokens"][base]
181
186
  base_name = base_info["name"]
182
187
  quote_name = meta["tokens"][quote]["name"]
@@ -69,7 +69,7 @@ class InfoAPI(AsyncAPI):
69
69
  start_time: int | None = None,
70
70
  end_time: int | None = None,
71
71
  ) -> UserFills:
72
- payload = {
72
+ payload: dict[str, Any] = {
73
73
  "type": "userFillsByTime" if start_time else "userFills",
74
74
  "user": address,
75
75
  "aggregateByTime": aggregated,
@@ -153,7 +153,7 @@ class EncodedOrder(TypedDict):
153
153
 
154
154
  class OrderBuilder(TypedDict):
155
155
  b: str # builder address
156
- f: float
156
+ f: int
157
157
 
158
158
 
159
159
  class OrderAction(TypedDict):