Skip to main content

FeeData

To contain the gas Fee Data to be used with EIP-1559 transactions. EIP-1559 was applied to Ethereum after London hardfork.

Typically you will only need maxFeePerGas and maxPriorityFeePerGas for a transaction following EIP-1559. However, if you want to get informed about the fees of last block, you can use baseFeePerGas too.

@see

Index

Properties

optionalreadonlybaseFeePerGas

baseFeePerGas?: Numbers

The baseFeePerGas returned from the last available block.

If EIP-1559 is not supported, this will be undefined

However, the user will only pay (the future baseFeePerGas + the maxPriorityFeePerGas). And this value is just for getting informed about the fees of last block.

optionalreadonlygasPrice

gasPrice?: Numbers

This filed is used for legacy networks that does not support EIP-1559.

optionalreadonlymaxFeePerGas

maxFeePerGas?: Numbers

The maximum fee that the user would be willing to pay per-gas.

However, the user will only pay (the future baseFeePerGas + the maxPriorityFeePerGas). And the maxFeePerGas could be used to prevent paying more than it, if baseFeePerGas went too high.

If EIP-1559 is not supported, this will be undefined

optionalreadonlymaxPriorityFeePerGas

maxPriorityFeePerGas?: Numbers

The validator's tip for including a transaction in a block.

If EIP-1559 is not supported, this will be undefined