Signature Caller Policy
The signature caller policy specifies a list of addresses that are allowed to validate messages signed by the signer.
This is useful when you want the signer to sign messages for a set of particular protocols only. For example, if you want to create a signer that can only sign USDC permits, then you can use this policy to ensure that only the USDC contract can validate its messages.
API
import { toSignatureCallerPolicy } from "@zerodev/permissions/policies"
const signaturePolicy = toSignatureCallerPolicy({
allowedCallers: [address1, address2]
})
const validator = toPermissionValidator(publicClient, {
entryPoint,
kernelVersion,
signer: someSigner,
policies: [
signaturePolicy,
// ...other policies
],
})
allowedCallers
is a list of addresses that are allowed to validate messages signed by the signer.