ZeroDev Presets
ECDSA Validator
To set up a Kernel account using ECDSA for validation (mimicking EOAs):
import { createEcdsaKernelAccountClient } from "@zerodev/presets/zerodev"
import { polygonMumbai } from "viem/chains"
const kernelClient = await createEcdsaKernelAccountClient({
// required
chain: polygonMumbai,
projectId: ZERODEV_PROJECT_ID,
signer: SIGNER,
// optional
provider: "PIMLICO", // defaults to a recommended provider
index: BigInt(1), // defaults to 0
paymaster: 'SPONSOR', // defaults to SPONSOR
})
chain
is a Viem chain objectprojectId
is a ZeroDev project ID from the ZeroDev dashboard.signer
is a Viem account.- (optional)
provider
can be any provider that ZeroDev supports. - (optional)
index
can be any positive integer. Different indexes will yield different accounts. - (optional)
paymaster
can be:'NONE'
: not using any paymaster (the user pays their own gas).'SPONSOR'
(default): sponsor gas for users according to gas policies.- A ERC20 token address: use the specified ERC20 token as gas tokens. See the ERC20 gas token docs for details.
is a boolean flag that determines whether ZeroDev will use the sponsoring paymaster.