Skip to content

Class: DefaultGasLimitEstimator

Defined in: packages/txm/lib/GasEstimator.ts:52

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

Constructor

new DefaultGasLimitEstimator(): DefaultGasLimitEstimator;

Returns

DefaultGasLimitEstimator

Methods

estimateGas()

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

Defined in: packages/txm/lib/GasEstimator.ts:53

Parameters

transactionManager

TransactionManager

transaction

Transaction

Returns

Promise<Result<bigint, EstimateGasError>>

Implementation of

GasEstimator.estimateGas