Skip to content

fix: Is signatureChainId intentionally hardcoded to 0x66eee in sign_user_signed_action?#267

Open
KyaClaw wants to merge 1 commit intohyperliquid-dex:masterfrom
kyaky:fix/issue-254
Open

fix: Is signatureChainId intentionally hardcoded to 0x66eee in sign_user_signed_action?#267
KyaClaw wants to merge 1 commit intohyperliquid-dex:masterfrom
kyaky:fix/issue-254

Conversation

@KyaClaw
Copy link

@KyaClaw KyaClaw commented Mar 2, 2026

Summary

Fix the hardcoded testnet chain ID 0x66eee (Arbitrum Sepolia) in sign_user_signed_action. The comment stated that signatureChainId can be any chain, but the code forced a testnet chain ID, causing potential wallet UX confusion for mainnet users.

Changes

  • In hyperliquid/utils/signing.py: default signatureChainId to 0xa4b1 (Arbitrum One) for mainnet, 0x66eee for testnet, only if not already set by the caller.
  • In hyperliquid/exchange.py: compute signatureChainId dynamically based on is_mainnet in the multi_sig method.
  • The fix preserves backward compatibility: existing callers that set signatureChainId in the action dict will have it respected.

Testing

  • Existing unit tests pass.
  • Manual verification shows correct chain IDs for mainnet/testnet defaults and custom chain IDs are preserved.

Fixes #254

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.

1 participant