Skip to content

Class: DefaultGasLimitEstimator

This is the default module used to estimate the gas for a transaction. When creating a new transaction manager, you can instead pass a custom gas estimator implementing GasEstimator. Whenever applicable, you should extend this class to reuse the protected simulateTransactionForGas method.

This class estimates the gas by simulating the transaction against the current blockchain state.

Implements

Constructors

new DefaultGasLimitEstimator()

new DefaultGasLimitEstimator(): DefaultGasLimitEstimator

Returns

DefaultGasLimitEstimator

Methods

estimateGas()

estimateGas(transactionManager: TransactionManager, transaction: Transaction): Promise<Result<bigint, EstimateGasErrorCause>>

Parameters

transactionManager: TransactionManager

transaction: Transaction

Returns

Promise<Result<bigint, EstimateGasErrorCause>>

Implementation of

GasEstimator.estimateGas

Defined in

packages/transaction-manager/lib/GasEstimator.ts:47