curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW",
"contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": true
}'
{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": [
"<any>"
],
"transaction": {}
}
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "TSNEe5Tf4rnc9zPMNXfaTF5fZfHDDH8oyW",
"contract_address": "TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": true
}'
{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": [
"<any>"
],
"transaction": {}
}
owner_address
— address of the account that would execute the contract callcontract_address
— address of the smart contract to estimate energy forfunction_selector
— function signature of the contract method to call (e.g., “balanceOf(address)”)parameter
— hex-encoded parameters to pass to the functionvisible
— boolean indicating whether to use visible (Base58) address format instead of hexresult
— estimation result object containing:
result
— boolean indicating if estimation was successfulenergy_required
— estimated energy consumption for the function callenergy_used
— total energy that would be consumedconstant_result
— array of return values if the function is a view/pure functiontransaction
— transaction object with estimated costs if applicablewallet/estimateenergy
method is used for:
Energy consumption estimation
The response is of type object
.
Was this page helpful?