getBlobBaseFee
Returns the current blob base fee in wei
Loading...
Returns the current blob base fee in wei
Import the public actions package so you can call this action.
import "github.com/ChefBingbong/viem-go/actions/public"An example showing how to construct a public client and query the current blob base fee.
import ( "context" "log"
"github.com/ChefBingbong/viem-go/actions/public" "github.com/ChefBingbong/viem-go/client" "github.com/ChefBingbong/viem-go/client/transport" "github.com/ChefBingbong/viem-go/chain/definitions")
ctx := context.Background()
publicClient, err := client.CreatePublicClient(client.PublicClientConfig{ Chain: definitions.Mainnet, Transport: transport.HTTP("https://eth.llamarpc.com"),})if err != nil { log.Fatal(err)}defer func() { _ = publicClient.Close() }()
blobBaseFee, err := public.GetBlobBaseFee(ctx, publicClient)if err != nil { log.Fatal(err)}log.Printf("Blob base fee: %s wei", blobBaseFee.String())*big.Int
The current blob base fee in wei.
This action takes no parameters.
Underlying JSON-RPC method used by this action.
eth_blobBaseFee (EIP-4844)