Configuration options for the gas estimator
Options for creating a gas estimator instance.
Optional
chain?: {Optional chain configuration to override defaults
Chain ID of the target network
RPC endpoint URL or client instance
An instance of GasEstimator appropriate for the chain
// Using RPC URL
const estimator = createGasEstimator({
chainId: 1,
rpc: "https://eth-mainnet.g.alchemy.com/v2/YOUR-API-KEY"
});
// Using custom chain config
const estimator = createGasEstimator({
chainId: 10,
chain: {
name: "Optimism",
stack: ChainStack.Optimism,
// ... other chain properties
},
rpc: rpcClient
});
Creates a gas estimator instance appropriate for the specified chain. Automatically selects the correct estimator implementation based on the chain type (e.g., Optimism, Arbitrum, Mantle, or standard EVM).