verifyEvmSignature()
verifyEvmSignature(
message,signature,options?):Promise<EvmVerifyResult>
Defined in: siwx-evm/src/verify.ts:198
Verifies an eip155 CAIP-122 signature from an EOA or a smart contract wallet.
Tries verifyEip191 first. If it fails and options.publicClient is set, falls back to
verifyEip1271 with the client of the message chain (one on-chain eth_call), which accepts deployed
(EIP-1271) and not yet deployed (ERC-6492) smart contract wallets.
Parameters
message
string
The exact CAIP-122 message string that was signed.
signature
`0x${string}`
The hex-encoded signature returned by the wallet.
options?
EvmVerifyOptions = {}
publicClient (a client or a function of the chain number) enables the contract wallet fallback;
skipExpiration is passed to both checks.
Returns
Promise<EvmVerifyResult>
The first successful result (with method), otherwise the failed result of the last check that ran.
Never throws.
Example
const result = await verifyEvmSignature(rawMessage, '0xdeadbeef...', { publicClient });
if (result.success) console.log('Authenticated via:', result.method);