Skip to main content

EVMFees

Defined in: atomiq-chain-evm/src/evm/chain/modules/EVMFees.ts:19

Fee estimation service for EVM chains.

Extended by

Constructors

Constructor

new EVMFees(
provider,
maxFeeRatePerGas,
priorityFee,
feeMultiplier): EVMFees;

Defined in: atomiq-chain-evm/src/evm/chain/modules/EVMFees.ts:59

Parameters

ParameterTypeDefault valueDescription
providerJsonRpcApiProviderundefinedUnderlying RPC provider providing read access to the EVM network
maxFeeRatePerGasbigint...Maximum fee rate for a transaction, default to 500 GWei
priorityFeebigint...Priority fee (or tip) to add to the transactions, default to 1 GWei
feeMultipliernumber1.25Fee multiplier to multiply the RPC-returned fee rate with

Returns

EVMFees

Methods

applyFeeRate()

static applyFeeRate(
tx,
gas,
feeRate): void;

Defined in: atomiq-chain-evm/src/evm/chain/modules/EVMFees.ts:137

Applies the gas limit and fee rate to a transaction

Parameters

ParameterTypeDescription
txTransactionRequestEVM Transaction to apply the fee rate to
gasnumberGas limit to add to the transaction
feeRatestringSerialized fee rate to add to the transaction, in format: <baseFee>,<priorityFee>

Returns

void


getFeeRate()

getFeeRate(): Promise<string>;

Defined in: atomiq-chain-evm/src/evm/chain/modules/EVMFees.ts:91

Gets the gas price with caching, format: <base fee Wei>,<priority fee Wei>

Returns

Promise<string>


getGasFee()

static getGasFee(gas, feeRate): bigint;

Defined in: atomiq-chain-evm/src/evm/chain/modules/EVMFees.ts:122

Calculates the total gas fee paid for a given gas limit at a given fee rate

Parameters

ParameterTypeDescription
gasnumberGas limit to add to the transaction
feeRatestringSerialized fee rate to add to the transaction, in format: <baseFee>,<priorityFee>

Returns

bigint