updatesetting - Tron

updatesetting. Updates the user resource percentage (consume_user_resource_percent) of a smart contract.

updatesetting - tron [Value: 20CU]
Updates the user resource percentage (consume_user_resource_percent) of a smart contract.
Use cases

Use cases

  • Adjust how much of a contract's call cost is subsidized by the deployer vs. the caller
Constraints

Constraints

  • Only the contract's owner_address can change this setting
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url https://lb.drpc.live/tron/{API-KEY}/wallet/updatesetting \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "contract_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "consume_user_resource_percent": 1, "visible": true}'
Copy
Response
200
{
  "visible": false,
  "txID": "<computed from raw_data>",
  "raw_data": {
    "contract": [
      {
        "parameter": {
          "value": {
              "owner_address":                 "41dd791d6b49e190062d650e6a23c575510d35f2f9",
              "contract_address":              "41eca9bc828a3005b9a3b909f2cc5c2a54794de05f",
              "consume_user_resource_percent": 100
          },
          "type_url": "type.googleapis.com/protocol.UpdateSettingContract"
        },
        "type": "UpdateSettingContract"
      }
    ],
    "ref_block_bytes": "<latest solidified block at construction time>",
    "ref_block_hash":  "<latest solidified block at construction time>",
    "expiration":      "<timestamp + 60_000>",
    "timestamp":       "<construction moment>"
  },
  "raw_data_hex": "<protobuf encoding of raw_data>"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
owner_addressstring
[Required] The contract owner's address
contract_addressstring
[Required] The smart contract's address
consume_user_resource_percentinteger
New percentage (0-100) of energy cost passed on to callers
visibleboolean
When true, addresses are base58check strings; when false (default), hex strings

Response

200
Updates the user resource percentage (consume_user_resource_percent) of a smart contract.

Response params

object
visibleboolean
Indicates whether addresses in this transaction are represented in base58 format (true) or hex format (false).
txIDstring
The unique transaction hash (transaction ID), computed as the SHA256 of raw_data.
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions to be executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a request to change how much Energy cost is passed on to a contract's callers.
object
owner_addressstring
The address authorized to update this setting (must match the contract's origin address), in hex format.
contract_addressstring
The address of the smart contract whose setting is being updated, in hex format.
consume_user_resource_percentinteger
The new percentage of Energy cost that callers of this contract must pay themselves, with the remainder charged to the contract owner.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, UpdateSettingContract).
ref_block_bytesstring
The last two bytes of the reference block number, taken from the latest solidified block at the time the transaction was built, used for replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, taken from the same solidified block, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction is no longer valid; typically set to the construction timestamp plus 60,000 ms.
timestampinteger
Unix timestamp, in ms, marking the moment the transaction was constructed.
raw_data_hexstring
The hex-encoded protobuf serialization of raw_data, used as the actual payload to sign and broadcast.