createKernelClientForWalletAccount
Creates a ZeroDev KernelClient instance for a given smart wallet account. The KernelClient allows you to send user operations and interact with the smart account.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
smartWalletAccount | EvmWalletAccount | The smart wallet account to create the KernelClient for |
withSponsorship | boolean (optional) | Whether to use gas sponsorship. Defaults to true |
networkId | string (optional) | The network ID to use. If not provided, uses the active network |
bundlerProvider | ZerodevBundlerProvider (optional) | A custom bundler provider |
bundlerRpc | string (optional) | A custom bundler RPC URL |
paymasterRpc | string (optional) | A custom paymaster RPC URL |
gasTokenAddress | Hex (optional) | Address of an ERC20 token to use for gas payments |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<KernelClient> - A promise that resolves to a ZeroDev KernelClient instance.
Examples
With gas sponsorship (default)
Without gas sponsorship
With custom gas token (ERC20)
With specific network
Related functions
- canSponsorTransaction - Check if a transaction can be sponsored
- estimateTransactionGas - Estimate gas for a transaction
- getSignerForSmartWalletAccount - Get the signer for a smart wallet