curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy \
--header 'Content-Type: application/json' \
--data '
{
"owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": true
}
'{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": "<array>",
"transaction": {}
}curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy \
--header 'Content-Type: application/json' \
--data '
{
"owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": true
}
'{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": "<array>",
"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:
curl --request POST \
--url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy' \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": true
}'
Address executing the contract call
Address of the smart contract
Function signature to call
Hex-encoded parameters for the function
Whether to use visible (Base58) address format
Energy consumption estimation
Total energy that would be consumed
Return values for view/pure functions
Transaction object with estimated costs
Was this page helpful?