Sign and Verify Messages
Sign and verify EVM messages and EIP-712 typed data.
This guide explains how to sign and verify messages with WalletAccountEvm7702Gasless.
Sign a Message
const signature = await account.sign('Hello, EIP-7702')
console.log(signature)sign(message) delegates to the wrapped EVM account.
Verify a Message
const isValid = await account.verify('Hello, EIP-7702', signature)
console.log('Valid:', isValid)verify(message, signature) is available on both owned and read-only accounts.
Sign EIP-712 Typed Data
const signature = await account.signTypedData({
domain: {
name: 'Example App',
version: '1',
chainId: 1,
verifyingContract: '0x0000000000000000000000000000000000000000'
},
types: {
Transfer: [
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint256' }
]
},
message: {
to: '0x742C4265F5Ba4F8E0842e2b9EfE66302F7a13B6F',
amount: '1000000'
}
})Verify EIP-712 Typed Data
const isValid = await account.verifyTypedData({
domain: {
name: 'Example App',
version: '1',
chainId: 1,
verifyingContract: '0x0000000000000000000000000000000000000000'
},
types: {
Transfer: [
{ name: 'to', type: 'address' },
{ name: 'amount', type: 'uint256' }
]
},
message: {
to: '0x742C4265F5Ba4F8E0842e2b9EfE66302F7a13B6F',
amount: '1000000'
}
}, signature)Read-only accounts can verify signatures but cannot sign.