ethclient: add BlobBaseFee method #31290 (#1395)

This commit is contained in:
Daniel Liu 2025-08-28 19:00:09 +08:00 committed by GitHub
parent bd1d41d3bc
commit 8679a9fc4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -604,6 +604,15 @@ func (ec *Client) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
return (*big.Int)(&hex), nil
}
// BlobBaseFee retrieves the current blob base fee.
func (ec *Client) BlobBaseFee(ctx context.Context) (*big.Int, error) {
var hex hexutil.Big
if err := ec.c.CallContext(ctx, &hex, "eth_blobBaseFee"); err != nil {
return nil, err
}
return (*big.Int)(&hex), nil
}
type feeHistoryResultMarshaling struct {
OldestBlock *hexutil.Big `json:"oldestBlock"`
Reward [][]*hexutil.Big `json:"reward,omitempty"`