> ## 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/updateenergylimit | TRON

> TRON API method that updates the origin energy limit for a smart contract. Reference for wallet/updateenergylimit on TRON via Chainstack.

TRON API method that updates the origin energy limit for a smart contract. This setting determines the maximum amount of energy the contract creator provides for contract execution, affecting how much energy users need to provide when calling the contract.

## Parameters

* `owner_address` — address of the contract owner who can update the energy limit
* `contract_address` — address of the smart contract to update energy limit for
* `origin_energy_limit` — maximum energy amount the contract creator provides (in energy units, not TRX/sun)
* `visible` — boolean indicating whether to use visible (Base58) address format instead of hex

## Response

* `visible` — boolean indicating whether addresses are in visible format
* `txID` — unique transaction ID for the energy limit update transaction
* `raw_data` — raw transaction data containing:
  * `contract` — array with contract update details
  * `ref_block_bytes` — reference block bytes for transaction validation
  * `ref_block_hash` — hash of the reference block
  * `expiration` — transaction expiration timestamp
  * `timestamp` — transaction creation timestamp
* `raw_data_hex` — complete transaction data encoded in hexadecimal format

## Use case

The `wallet/updateenergylimit` method is used for:

* Setting energy subsidies for contract users to improve user experience.
* Managing contract execution costs by controlling energy allocation.
* Optimizing contract economics by adjusting energy provision strategies.
* Implementing freemium models where basic operations are subsidized.
* Balancing between contract owner costs and user accessibility.
* Adjusting energy limits based on contract usage patterns and feedback.

<Note>
  Only the contract owner can update the origin energy limit. Higher limits mean the contract owner covers more execution costs, making the contract cheaper for users to interact with. The value is specified in energy units (not TRX/sun).
</Note>

## curl example

```shell Shell theme={"system"}
curl --request POST \
  --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/updateenergylimit' \
  --header 'Content-Type: application/json' \
  --data '{
  "owner_address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC",
  "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "origin_energy_limit": 100000000,
  "visible": true
}'
```

This builds an unsigned transaction if the `owner_address` exists and is authorized (contract owner). Otherwise the node returns a validation error.

<Steps>
  <Step title="verify owner account exists">
    Use `wallet/getaccount` to make sure the address is activated and format matches `visible`.

    ```shell Shell theme={"system"}
    curl --request POST \
      --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getaccount' \
      --header 'Content-Type: application/json' \
      --data '{ "address": "THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC", "visible": true }'
    ```
  </Step>

  <Step title="confirm contract and owner">
    `wallet/getcontract` expects a hex address. It returns `origin_address` (the deployer/owner) and current settings.

    ```shell Shell theme={"system"}
    curl --request POST \
      --url 'https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/getcontract' \
      --header 'Content-Type: application/json' \
      --data '{ "value": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c" }'
    ```
  </Step>
</Steps>

<Info>
  common validation errors:

  * `Account [41…] does not exist` — the payer address does not exist on-chain or the format does not match `visible`. Query it with `wallet/getaccount` and fund/activate it first.
  * `No permission` or similar — the `owner_address` is not the contract owner; only the `origin_address` can update settings.
  * `Contract not found` — check the contract address and use hex for `wallet/getcontract`.
</Info>


## OpenAPI

````yaml openapi/tron_node_api/updateenergylimit.json post /95e61622bf6a8af293978377718e3b77/wallet/updateenergylimit
openapi: 3.0.0
info:
  title: wallet/updateenergylimit TRON API
  version: 1.0.0
  description: Update contract origin energy limit
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/updateenergylimit:
    post:
      tags:
        - Smart Contracts
      summary: wallet/updateenergylimit
      operationId: updateEnergyLimit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                owner_address:
                  type: string
                  description: Address of the contract owner
                contract_address:
                  type: string
                  description: Address of the smart contract
                origin_energy_limit:
                  type: number
                  description: >-
                    Maximum energy amount the contract creator provides (energy
                    units)
                visible:
                  type: boolean
                  description: Whether to use visible (Base58) address format
              required:
                - owner_address
                - contract_address
                - origin_energy_limit
              example:
                owner_address: THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC
                contract_address: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
                origin_energy_limit: 100000000
                visible: true
      responses:
        '200':
          description: Contract energy limit update transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  visible:
                    type: boolean
                    description: Whether addresses are in visible format
                  txID:
                    type: string
                    description: Transaction ID for the energy limit update
                  raw_data:
                    type: object
                    properties:
                      contract:
                        type: array
                        description: Contract update details
                      ref_block_bytes:
                        type: string
                        description: Reference block bytes
                      ref_block_hash:
                        type: string
                        description: Reference block hash
                      expiration:
                        type: number
                        description: Transaction expiration timestamp
                      timestamp:
                        type: number
                        description: Transaction creation timestamp
                  raw_data_hex:
                    type: string
                    description: Raw transaction data in hex format
        '400':
          description: Validation error (e.g., account not found or not owner)
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: string
              example:
                Error: >-
                  class org.tron.core.exception.ContractValidateException :
                  Account[41b3dcf27c251da9363f1a4888257c16676cf54edf] does not
                  exist

````