wallet/estimateenergy
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
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy"
payload = {
"owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
owner_address: 'THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC',
contract_address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
function_selector: 'balanceOf(address)',
parameter: '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c',
visible: true
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'owner_address' => 'THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC',
'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
'function_selector' => 'balanceOf(address)',
'parameter' => '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c',
'visible' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy"
payload := strings.NewReader("{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy")
.header("Content-Type", "application/json")
.body("{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}"
response = http.request(request)
puts response.read_body{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": "<array>",
"transaction": {}
}TRON node API
wallet/estimateenergy | TRON
TRON API method that estimates the energy consumption for executing a smart contract function call. Use it on TRON via Chainstack.
POST
/
95e61622bf6a8af293978377718e3b77
/
wallet
/
estimateenergy
wallet/estimateenergy
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
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy"
payload = {
"owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "balanceOf(address)",
"parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"visible": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
owner_address: 'THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC',
contract_address: 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
function_selector: 'balanceOf(address)',
parameter: '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c',
visible: true
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'owner_address' => 'THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC',
'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',
'function_selector' => 'balanceOf(address)',
'parameter' => '000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c',
'visible' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy"
payload := strings.NewReader("{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy")
.header("Content-Type", "application/json")
.body("{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/estimateenergy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"owner_address\": \"THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC\",\n \"contract_address\": \"TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\",\n \"function_selector\": \"balanceOf(address)\",\n \"parameter\": \"000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c\",\n \"visible\": true\n}"
response = http.request(request)
puts response.read_body{
"result": {
"result": true,
"energy_required": 123
},
"energy_used": 123,
"constant_result": "<array>",
"transaction": {}
}TRON API method that estimates the energy consumption for executing a smart contract function call. This method helps predict the energy costs before actually executing a transaction, enabling better cost planning and user experience optimization.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
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 hex
Response
result— estimation result object containing:result— boolean indicating if estimation was successfulenergy_required— estimated energy consumption for the function call
energy_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 applicable
Use case
Thewallet/estimateenergy method is used for:
- Predicting transaction costs before executing smart contract calls.
- Building user interfaces that show estimated fees upfront.
- Optimizing contract interactions by choosing energy-efficient functions.
- Implementing cost-aware transaction batching and prioritization.
- Creating accurate fee estimation tools for wallets and dApps.
- Analyzing contract performance and identifying gas-intensive operations.
Use this method before calling expensive contract functions to give users accurate cost estimates. This is especially useful for functions that might fail due to insufficient energy, allowing you to prevent failed transactions.
curl example
Shell
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
}'
Body
application/json
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
Last modified on June 22, 2026
Was this page helpful?