A FeeData wraps all the fee-related values associated with the network.

Constructors

new FeeData()

new FeeData(
   gasPrice?, 
   maxFeePerGas?, 
   maxPriorityFeePerGas?): FeeData

Creates a new FeeData for gasPrice, maxFeePerGas and maxPriorityFeePerGas.

Parameters

ParameterTypeDescription
gasPrice?null | bigintThe gas price.
maxFeePerGas?null | bigintThe maximum fee per gas.
maxPriorityFeePerGas?null | bigintThe maximum priority fee per gas.

Returns

FeeData

Source

providers/provider.ts:127

Properties

PropertyModifierTypeDescription
gasPricereadonlynull | bigintThe gas price for legacy networks.
maxFeePerGasreadonlynull | bigintThe maximum fee to pay per gas.

The base fee per gas is defined by the network and based on congestion, increasing the cost during times of heavy
load and lowering when less busy.

The actual fee per gas will be the base fee for the block and the priority fee, up to the max fee per gas.

This will be null on legacy networks (i.e. pre-EIP-1559)
maxPriorityFeePerGasreadonlynull | bigintThe additional amount to pay per gas to encourage a validator to include the transaction.

The purpose of this is to compensate the validator for the adjusted risk for including a given transaction.

This will be null on legacy networks (i.e. pre-EIP-1559)

Methods

toJSON()

toJSON(): any

Returns a JSON-friendly value.

Returns

any

The JSON-friendly value.

Source

providers/provider.ts:140