Estimate gas fees
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.
To ensure that your transaction doesn't remain in "pending" status for too long, you should include enough to cover the fees:
Minimum gas fee: 2,501 Gwei.
Minimum priority fee: 1 Gwei.
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.
You need an API key in order to interact with the available API methods/endpoints.
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):
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.
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?