Creates a new EVMGasEstimator instance
The SupportedChain to estimate gas for
The RPC client for making blockchain requests
Map of EntryPointVersion to their contract instances
Optional gas limits for simulation, defaults to predefined constants
The SupportedChain to estimate gas for
Map of EntryPointVersion to their contract instances
Protected
rpcThe RPC client for making blockchain requests
Optional gas limits for simulation, defaults to predefined constants
Estimates pre-verification gas for a user operation. Calculates gas costs for calldata and fixed overheads.
The UserOperation to estimate for
Optional
baseFeePerGas: bigintOptional base fee per gas
The estimated pre-verification gas as a bigint
Estimates all gas parameters for a user operation.
The estimation parameters
Parameters for estimating user operation gas.
Current base fee per gas
Optional
options?: Partial<EstimateUserOperationGasOptions>Additional estimation options
Optional
stateOverrides?: StateOverrideSetOptional state overrides for simulation
User operation without gas estimates
Gas estimation results including all required gas limits
Internal
Estimates verification and call gas limits from execution results.
The user operation being estimated
The simulation execution result
Object containing gas limits and validity window
Internal
Merges user-provided options with default estimation options.
The EntryPointVersion being used
Optional
options: Partial<EstimateUserOperationGasOptions>Partial options to merge with defaults
Complete estimation options
Internal
Uses binary search to estimate gas limits for deployed accounts.
The user operation to estimate for
Gas limit for the main execution call
Maximum total fee per gas unit
Maximum priority fee per gas unit
Account nonce
Gas overhead for pre-verification operations
Gas limit for the verification phase
Current base fee per gas
Estimation options
Optional
stateOverrides: StateOverrideSetOptional state overrides
Gas estimation results
Base implementation of gas estimation for EVM-compatible chains. Provides methods for estimating gas costs for user operations including verification, execution, and pre-verification gas.
Implements
GasEstimator
Example