Skip to content

fix: bump eth-account minimum version to >=0.13.5 #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vinayyak
Copy link

@vinayyak vinayyak commented Jun 4, 2025

Summary

The Hyperliquid client expects LocalAccount.sign_typed_data (EIP-712) to exist, but older eth-account releases (e.g. 0.10.x) do not expose that method. As a result, calls to sign_l1_action fail with:

AttributeError: 'LocalAccount' object has no attribute 'sign_typed_data'

Where the error occured:

  File "/app/.venv/lib/python3.12/site-packages/hyperliquid/utils/signing.py", line 216, in sign_l1_action
    return sign_inner(wallet, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/hyperliquid/utils/signing.py", line 395, in sign_inner
    signed = wallet.sign_typed_data(full_message=data)
             ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LocalAccount' object has no attribute 'sign_typed_data'

Bump the minimum eth-account version so that EIP-712 signing is guaranteed to work.

Changes

In pyproject.toml, replaced:

- eth-account = ">=0.10.0,<0.14.0"
+ eth-account = ">=0.13.5,<0.14.0"

Rationale

Versions of eth-account prior to 0.13.5 lack the LocalAccount.sign_typed_data method. Hyperliquid’s sign_l1_action calls wallet.sign_typed_data(...) under the hood, so we must require a release that implements EIP-712 “typed data” signing. Pinning eth-account >=0.13.5 ensures compatibility without breaking other dependencies.

Testing

Opened a Python REPL (using the locked environment):

  1. Then verified if older version contains the sign_typed_data method, which is did not:
>>> from eth_account import Account
>>> acct = Account.create()
>>> hasattr(acct, "sign_typed_data")
False
>>> dir(acct)
['__abstractmethods__', '__bytes__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_abc_impl', '_address', '_key_obj', '_private_key', '_publicapi', 'address', 'encrypt', 'key', 'signHash', 'signTransaction', 'sign_message', 'sign_transaction']
  1. Checked against the Latest Client Version after updating

  2. Re-tried and confirmed that it now contained the method:

>>> from eth_account import Account
>>> acct = Account.create()
>>> hasattr(acct, "sign_typed_data")
True

Please let me know if any modifications are needed.

@traderben
Copy link
Contributor

traderben commented Jun 10, 2025

You need to also update poetry.lock when updating dependencies. See the errors in the failing CI run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants