Skip to main content

index/functions/eip712DomainFor.md

eip712DomainFor(chainId): EIP712DomainValue

Builds the EIP-712 domain from the wallet's LIVE eth_chainId result: a wallet hashes whatever domain it is handed, and MetaMask refuses a chainId that differs from its active network, so a hardcoded 1 breaks every wallet that is not on Mainnet. The backend recovers the signer from the domain the payload carries (live-proven for chain ids 1, 56 and 11155111), so following the wallet is correct on every network.

Parameters​

ParameterTypeDescription
chainIdunknownThe raw eth_chainId result: a 0x hex string (the JSON-RPC form) or an integer.

Returns​

EIP712DomainValue

Throws​

GalaSDKError (INVALID_CHAIN_ID) when the wallet answers with anything else.