For the complete documentation index, see llms.txt. This page is also available as Markdown.

Estimate gas fees

Estimate transaction gas fees on Chiliz Chain using cURL/RPC, Blocknative Gas Network, or ethers.js, with minimum fee guidance (2,501 gwei base, 1 gwei priority).

Transaction fees (or "gas fees") can vary significantly depending on network activity, so having a reliable estimation method is crucial for a smooth user experiences.

What does it mean for Chiliz Chain developers?

Just like with any blockchain, you must pay gas for every transaction on Chiliz Chain.

The key is to balance cost-effectiveness with timely confirmations to avoid failing or delayed transactions. Keeping your gas estimates up to date helps prevent both overpaying and underpaying.

How to do it natively

If you want to keep it vanilla, you can rely on a cURL request to a Chiliz Chain RPC server. See here: How to get the current gas price.

How to do it through an explorer API

Both Chiliscan and Chiliz Block Explorer offer APIs allowing you to get the current gas price for Chiliz Chain.

Using Chiliscan's API

The Chiliscan API provides the avg-gas-price method for that purpose:

... which will return a JSON string with the current value.

Using Chiliz Block Explorer's API

The Chiliz Block Explorer API has the stats endpoint which provides that information:

The endpoint returns which includes gas price information. For example:

You'll want to use this section (prices are in Gwei):

  • average balances a moderate cost with reliable inclusion in the next few blocks.

  • fast pays the highest premium to incentivize validators to prioritize your transaction immediately, ensuring the quickest possible confirmation for urgent needs.

  • slow offers the lowest fee but carries the risk of your transaction remaining pending if network congestion increases.

How to do it using Blocknative?

Blocknative builds infrastructure to monitor and manage the complexity of transacting on public blockchain networks.

Blocknative’s Gas API offers a reliable, real-time approach to retrieving gas prices.

Step 1: Get a key

To use Blocknative's Gas API in your project, you will need an API Key.

You will need to join the Gas Network first, which will give you access to your own API key.

Step 2: Implement the call to the Gas API

Once you have an API key, you can request fee estimation for Chiliz.

Remember that the chain ID for Chiliz Chain Mainnet is 88888.

The simplest way is to call on the API via a REST request. For instance, via command line:

Learn more in the Blocknative documentation.

Last updated

Was this helpful?