ethereum, ethclient: add FeeHistory support (#25403)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
lightclient
2022-07-29 18:22:04 +02:00
committed by GitHub
co-authored by Felix Lange
parent 377c7d799f
commit 9ad508018e
4 changed files with 65 additions and 0 deletions
+9
View File
@@ -201,6 +201,15 @@ type GasPricer interface {
SuggestGasPrice(ctx context.Context) (*big.Int, error)
}
// FeeHistory provides recent fee market data that consumers can use to determine
// a reasonable maxPriorityFeePerGas value.
type FeeHistory struct {
OldestBlock *big.Int // block coresponding to first response value
Reward [][]*big.Int // list every txs priority fee per block
BaseFee []*big.Int // list of each block's base fee
GasUsedRatio []float64 // ratio of gas used out of the total available limit
}
// A PendingStateReader provides access to the pending state, which is the result of all
// known executable transactions which have not yet been included in the blockchain. It is
// commonly used to display the result of unconfirmed actions (e.g. wallet value