post
https://api.shasta.trongrid.io/wallet/estimateenergy
Estimate the energy required for the successful execution of smart contract transactions or deploying a contract
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Note:
- This API is closed by default. To enable this interface, both the
vm.estimateEnergyandvm.supportConstantconfiguration items must be activated simultaneously in the node configuration file. estimateEnergyperforms an estimation only; it does not generate an on-chain transaction or alter the current node's status.energy_requiredis measured in Energy, whilefee_limitis measured in sun, so the value cannot be assigned directly. The base conversion isfee_limit (sun) = energy_required × getEnergyFee (sun/Energy). Query the current chain parameters and keep a reasonable buffer for state and Dynamic Energy changes.- While
triggerconstantcontractis sufficient for estimating the Energy consumption of calling most on-chain smart contracts (e.g., USDD, BTT, TUSD),estimateEnergymay produce a closer estimate for a small number of special contracts. An estimate reflects the node state at request time and does not guarantee that the later on-chain transaction will succeed. - Parameter encoding and decoding: Parameter and return value encoding and decoding
Related resources
- Clearabi — previous in this section
- FeeLimit & Energy cost