Minimal EIP-712 typed-data encoder for the custom DEX signing modules
(Bourse.Signing.Hyperliquid).
Implements canonical EIP-712 encoding for the atomic-field message types
Hyperliquid uses (Agent, HyperliquidTransaction:*). The
result is the EIP-712 digest preimage 0x1901 ‖ domainSeparator ‖ hashStruct,
as defined by EIP-712.
Scope
Only atomic field types are supported (string, bytes, bytes32,
address, bool, uint*, int*). Struct-typed fields (nested custom types)
raise — none of the supported Hyperliquid message types use them, so a nested
type is a programming error rather than a silent wrong signature.
The EIP712Domain type is rendered in ethers' canonical field order
(name, version, chainId, verifyingContract, salt), including only the
fields present in the supplied domain.
Summary
Functions
Computes the 32-byte EIP-712 domain separator for domain.
Encodes typed data into the EIP-712 digest preimage
0x1901 ‖ domainSeparator ‖ hashStruct(primaryType, message).
Computes hashStruct(primaryType) = keccak256(typeHash ‖ encodeData).
Types
Functions
Computes the 32-byte EIP-712 domain separator for domain.
Encodes typed data into the EIP-712 digest preimage
0x1901 ‖ domainSeparator ‖ hashStruct(primaryType, message).
Computes hashStruct(primaryType) = keccak256(typeHash ‖ encodeData).