ServerActions.verifySignature
Viem Action for verifying a signature against an account. Uses wallet_verifySignature
under the hood.
Usage
example.ts
import { ServerActions } from 'porto/viem'
import { client } from './config'
const isValid = await ServerActions.verifySignature(client, {
address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
digest: '0x...',
signature: '0x...',
})
Parameters
address
- Type:
Address.Address
Account address to verify the signature against.
chain
- Type:
Chain | undefined
Chain to verify on. Defaults to client.chain
.
digest
- Type:
Hex.Hex
Digest that was signed.
signature
- Type:
Hex.Hex
The signature to verify.