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

> TRON API method that updates the consume user resource percentage setting for a smart contract. wallet/updatesetting on TRON via Chainstack.

TRON API method that updates the consume user resource percentage setting for a smart contract. This setting determines what percentage of the contract caller's resources (bandwidth and energy) should be consumed when executing the contract.

## Parameters

* `owner_address` — address of the contract owner who can update settings
* `contract_address` — address of the smart contract to update settings for
* `consume_user_resource_percent` — percentage (0–100) of caller's resources to consume
* `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 setting 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/updatesetting` method is used for:

* Adjusting resource consumption patterns for smart contract execution.
* Optimizing contract costs by controlling user vs contract owner resource usage.
* Managing energy and bandwidth allocation between contract and users.
* Implementing different pricing models for contract interactions.
* Fine-tuning contract economics and user experience trade-offs.
* Setting up contracts to be more or less resource-friendly to callers.

<Note>
  Only the contract owner can update the consume user resource percentage. Setting this to 100 means all resources come from the caller, while 0 means all resources come from the contract owner. The default is typically 100.
</Note>

## curl example

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

<Steps>
  <Step title="verify owner account exists">
    ```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 owner">
    Use `wallet/getcontract` with a hex address to retrieve `origin_address` and ensure it matches `owner_address` (converted to hex if needed).

    ```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 is not activated or `visible` does not match the provided address format.
  * `No permission` — the `owner_address` is not the contract owner (`origin_address`).
  * `Contract not found` — verify the contract address and format.
</Info>


## OpenAPI

````yaml openapi/tron_node_api/updatesetting.json post /95e61622bf6a8af293978377718e3b77/wallet/updatesetting
openapi: 3.0.0
info:
  title: wallet/updatesetting TRON API
  version: 1.0.0
  description: Update contract consume user resource percentage
servers:
  - url: https://tron-mainnet.core.chainstack.com
security: []
paths:
  /95e61622bf6a8af293978377718e3b77/wallet/updatesetting:
    post:
      tags:
        - Smart Contracts
      summary: wallet/updatesetting
      operationId: updateSetting
      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
                consume_user_resource_percent:
                  type: number
                  description: Percentage (0-100) of caller's resources to consume
                  minimum: 0
                  maximum: 100
                visible:
                  type: boolean
                  description: Whether to use visible (Base58) address format
              required:
                - owner_address
                - contract_address
                - consume_user_resource_percent
              example:
                owner_address: THPvaUhoh2Qn2y9THCZML3H815hhFhn5YC
                contract_address: TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
                consume_user_resource_percent: 10
                visible: true
      responses:
        '200':
          description: Contract setting 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 setting 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

````