Skip to main content

/wallet/estimateenergy REST API Endpoint

Estimate the energy required for the successful execution of smart contract transactions.

Updated on
Oct 4, 2023

/wallet/estimateenergy REST API Endpoint

Body Parameters

owner_address
string
REQUIRED
The address that triggers the contract, converted to a hexString.
contract_address
string
REQUIRED
The contract address, encoded in hexString
function_selector
integer
REQUIRED
The function call. This field must not be left blank
parameter
string
REQUIRED
The parameter encoding needs to be in accordance with the ABI rules
visible
boolean
A boolean value indicating whether the address is in base58 format

Returns

result
The result object with the following fields:
result
It is true if the estimate is successful, otherwise false
code
The response code
message
The result message
energy_required
The estimated energy to run the contract
Request
1
curl https://docs-demo.tron-mainnet.quiknode.pro/wallet/estimateenergy \
2
--header 'accept: application/json' \
3
--header 'content-type: application/json' \
4
--data '
5
{
6
"owner_address": "OWNER_ADDRESS",
7
"contract_address": "CONTRACT_ADDRESS",
8
"function_selector": "balanceOf(address)",
9
"parameter": "PARAMETERS",
10
"visible": true
11
}
12
'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free