signEip7702Authorization
Signs an EIP-7702 authorization for ZeroDev kernel delegation. This function creates a signed authorization that allows a wallet to delegate its execution to the ZeroDev kernel contract. The signed authorization can then be passed tocreateKernelClientForWalletAccount via the eip7702Auth parameter. This is useful for singleUse MFA flows where you need to separate the authorization signing step from the transaction step.
Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
smartWalletAccount | EvmWalletAccount | The EVM smart wallet account to sign the authorization for |
networkId | string (optional) | The network ID to use for signing. If not provided, uses the wallet’s active network |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<SignAuthorizationReturnType> - A promise that resolves to the signed EIP-7702 authorization.
Examples
Basic usage
With specific network
With singleUse MFA flow
This pattern is useful when you need to sign the authorization during an MFA step, then use it later for the transaction:Related functions
- createKernelClientForWalletAccount - Create a ZeroDev Kernel client
- getSignerForSmartWalletAccount - Get the signer for a smart wallet