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
| Parameter | Type | Default value | Description |
|---|---|---|---|
provider | JsonRpcApiProvider | undefined | Underlying RPC provider providing read access to the EVM network |
maxFeeRatePerGas | bigint | ... | Maximum fee rate for a transaction, default to 500 GWei |
priorityFee | bigint | ... | Priority fee (or tip) to add to the transactions, default to 1 GWei |
feeMultiplier | number | 1.25 | Fee 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
| Parameter | Type | Description |
|---|---|---|
tx | TransactionRequest | EVM Transaction to apply the fee rate to |
gas | number | Gas limit to add to the transaction |
feeRate | string | Serialized 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
| Parameter | Type | Description |
|---|---|---|
gas | number | Gas limit to add to the transaction |
feeRate | string | Serialized fee rate to add to the transaction, in format: <baseFee>,<priorityFee> |
Returns
bigint