秋田预测市场 · Discord 审计

Python SDK因代币索引跳号导致Info初始化IndexError

2026-06-03 · Hyperliquid · 4 条相关讨论

mambo 2026-06-03 09:51:45

anyone getting this issue with the `Info` initialisation for the python sdk? ``` site-packages\hyperliquid\info.py", line 47, in __init__ base_info = spot_meta["tokens"][base] ~~~~~~~~~~~~~~~~~~~^^^^^^ IndexError: list index out of range ```

anyone getting this issue with the `Info` initialisation for the python sdk? ``` site-packages\hyperliquid\info.py", line 47, in __init__ base_info = spot_meta["tokens"][base] ~~~~~~~~~~~~~~~~~~~^^^^^^ IndexError: list index out of range ```

mambo 2026-06-03 09:53:08

code in the sdk is all the way up here, i have the latest sdk installed

code in the sdk is all the way up here, i have the latest sdk installed

mambo 2026-06-03 09:57:31

have u fixed this error? im getting it on now mainnet as well

have u fixed this error? im getting it on now mainnet as well

mambo 2026-06-03 10:25:26

think theres an error in how the SDK handles spotMeta in the API, not sure if its because of the token list breaking or the universe adding a breaking change, but based on spot_meta['tokens'][base] it looks like its array-numeric-indexed, and theres this entry under universe: { "tokens": [ 479, 0 ], "name": "@367", "index": 367, "isCanonical": false } but there arent 479 entries in the tokens array (looks like 464 atm). looking at tokens it seems they all have an index but its not handled properly perhaps due to delistings e.g. 481 jumps to 512, so the total count is now less and the array-based indexing breaks. could you guys fix the SDK please, thanks! example: { "name": "WBRL", "szDecimals": 2, "weiDecimals": 8, "index": 481, "tokenId": "0xba91b8fcaf3f411aaa2ccd4f96cbad18", "isCanonical": false, "evmContract": null, "fullName": "Wrapped Brazilian Real", "deployerTradingFeeShare": "1.0" }, { "name": "TREAD", "szDecimals": 2, "weiDecimals": 8, "index": 512, "tokenId": "0xc03b5b39372b9daa292adc59a8568263", "isCanonical": false, "evmContract": null, "fullName": null, "deployerTradingFeeShare": "1.0" },

think theres an error in how the SDK handles spotMeta in the API, not sure if its because of the token list breaking or the universe adding a breaking change, but based on spot_meta['tokens'][base] it looks like its array-numeric-indexed, and theres this entry under universe: { "tokens": [ 479, 0 ], "name": "@367", "index": 367, "isCanonical": false } but there arent 479 entries in the tokens array (looks like 464 atm). looking at tokens it seems they all have an index but its not handled properly perhaps due to delistings e.g. 481 jumps to 512, so the total count is now less and the array-based indexing breaks. could you guys fix the SDK please, thanks! example: { "name": "WBRL", "szDecimals": 2, "weiDecimals": 8, "index": 481, "tokenId": "0xba91b8fcaf3f411aaa2ccd4f96cbad18", "isCanonical": false, "evmContract": null, "fullName": "Wrapped Brazilian Real", "deployerTradingFeeShare": "1.0" }, { "name": "TREAD", "szDecimals": 2, "weiDecimals": 8, "index": 512, "tokenId": "0xc03b5b39372b9daa292adc59a8568263", "isCanonical": false, "evmContract": null, "fullName": null, "deployerTradingFeeShare": "1.0" },