Skip to main content
The Simulation API allows you to simulate transactions and obtain the estimated gas usage needed to successfully execute the transactions. Set estimate_gas: true in the request to get gas estimates.
Note: you can get 100% accurate gas estimates using the tenderly_estimateGas and tenderly_estimateGasBundle RPC methods.
Example Make sure to store the access key securely in a .env file.
example.ts
This calculates the maximum gas needed for the transaction. After a successful simulation, check the gas_used field in the transaction structure. Result
example.json