Overview
Utilities for working with ERC-4337 UserOperations on EntryPoint v0.7, including submission to bundlers and hash computation.Functions
submitKernelUserOperationV07
Submits a UserOperation for a Kernel smart account to an ERC-4337 bundler. Handles gas estimation, nonce management, signature generation, and automatic retries.The ERC-4337 bundler RPC endpoint URL
The chain RPC endpoint URL for state queries
The EOA owner address that will sign the UserOperation
The Kernel smart account address sending the UserOperation
The chain ID for the network
The encoded call data for the Kernel account to execute
JSON-RPC request function
(method: string, params?: unknown[] | object) => Promise<unknown>Optional callback for status updates during submission process
The UserOperation hash returned by the bundler upon successful submission
- Verifies Kernel wallet deployment on-chain
- Reads current nonce from EntryPoint
- Fetches gas prices from bundler or falls back to chain RPC
- Estimates gas limits with 50% safety buffer
- Signs UserOperation hash via
personal_signoreth_sign - Automatic retry on nonce conflicts or gas price requirements
- Provides detailed status callbacks throughout the process
getUserOperationHashV07
Computes the ERC-4337 UserOperation hash for EntryPoint v0.7.The UserOperation struct to hash
The EntryPoint contract address
The chain ID for the network
The UserOperation hash that must be signed by the account owner
Type Definitions
UserOperationV07
ERC-4337 UserOperation struct for EntryPoint v0.7.The smart account address sending the UserOperation
The nonce from EntryPoint.getNonce(sender, key)
The data to pass to the sender account’s execution function
Gas limit for the execution call
Gas limit for verification step
Gas to compensate bundler for pre-verification execution and calldata
Maximum fee per gas (EIP-1559)
Maximum priority fee per gas (EIP-1559)
Signature over the UserOperation hash
Account factory address (for undeployed accounts)
Data to pass to factory for account creation
Paymaster address (for sponsored transactions)
Data to pass to paymaster
Gas limit for paymaster verification
Gas limit for paymaster post-operation
RpcRequest
encodeEntryPointGetNonce
Encodes calldata for the EntryPointgetNonce() function.
The smart account address to query nonce for
The nonce key (used for parallel execution paths)
Encoded calldata for EntryPoint.getNonce(address,uint192)
decodeEntryPointGetNonce
Decodes the result of an EntryPointgetNonce() call.
The raw result from eth_call
The current nonce value