> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# wallet/estimateenergy | TRON

> TRON API method that estimates the energy consumption for executing a smart contract function call. Use it on TRON via Chainstack.

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.

## Parameters

* `owner_address` — address of the account that would execute the contract call
* `contract_address` — address of the smart contract to estimate energy for
* `function_selector` — function signature of the contract method to call (e.g., "balanceOf(address)")
* `parameter` — hex-encoded parameters to pass to the function
* `visible` — boolean indicating whether to use visible (Base58) address format instead of hex

## Response

* `result` — estimation result object containing:
  * `result` — boolean indicating if estimation was successful
  * `energy_required` — estimated energy consumption for the function call
* `energy_used` — total energy that would be consumed
* `constant_result` — array of return values if the function is a view/pure function
* `transaction` — transaction object with estimated costs if applicable

## Use case

The `wallet/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.

<Tip>
  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.
</Tip>

## curl example

```shell Shell theme={"system"}
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
}'
```


## OpenAPI

````yaml openapi/tron_node_api/estimateenergy.json post /95e61622bf6a8af293978377718e3b77/wallet/estimateenergy
openapi: 3.0.0
info:
  title: wallet/estimateenergy TRON API
  version: 1.0.0
  description: Estimate energy consumption for contract call
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/estimateenergy:
    post:
      tags:
        - Smart Contracts
      summary: wallet/estimateenergy
      operationId: estimateEnergy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                owner_address:
                  type: string
                  description: Address executing the contract call
                contract_address:
                  type: string
                  description: Address of the smart contract
                function_selector:
                  type: string
                  description: Function signature to call
                parameter:
                  type: string
                  description: Hex-encoded parameters for the function
                visible:
                  type: boolean
                  description: Whether to use visible (Base58) address format
              required:
                - owner_address
                - contract_address
                - function_selector
                - parameter
              example:
                owner_address: THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC
                contract_address: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
                function_selector: balanceOf(address)
                parameter: >-
                  000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c
                visible: true
      responses:
        '200':
          description: Energy consumption estimation
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      result:
                        type: boolean
                        description: Whether estimation was successful
                      energy_required:
                        type: number
                        description: Estimated energy consumption
                  energy_used:
                    type: number
                    description: Total energy that would be consumed
                  constant_result:
                    type: array
                    description: Return values for view/pure functions
                  transaction:
                    type: object
                    description: Transaction object with estimated costs

````