Providers
FeeData
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
Parameter | Type | Description |
---|---|---|
gasPrice ? | null | bigint | The gas price. |
maxFeePerGas ? | null | bigint | The maximum fee per gas. |
maxPriorityFeePerGas ? | null | bigint | The maximum priority fee per gas. |
Returns
Source
Properties
Property | Modifier | Type | Description |
---|---|---|---|
gasPrice | readonly | null | bigint | The gas price for legacy networks. |
maxFeePerGas | readonly | null | bigint | The 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) |
maxPriorityFeePerGas | readonly | null | bigint | The 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
Was this page helpful?