triggerconstantcontract - Tron
triggerconstantcontract. Executes a read-only smart contract call without broadcasting a transaction or consuming energy.
triggerconstantcontract - tron [Value: 20CU]
Executes a read-only smart contract call without broadcasting a transaction or consuming energy.
Use cases
- Read a TRC20 token's balanceOf, symbol, or decimals without spending energy
- Estimate energy_used ahead of a real triggersmartcontract call to size fee_limit
Constraints
- Never modifies chain state and never needs to be broadcast
- Maximum execution time per call is 80ms; long-running calls throw OUT_OF_TIME
- Also available under /walletsolidity/ for confirmed (solidified) data instead of the latest state
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/triggerconstantcontract \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "contract_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "function_selector": "example", "parameter": "example", "visible": true}'Response
200
{
"result": { "result": true },
"energy_used": 935,
"constant_result": ["0000000000000000000000000000000000000000000000000000000040cfcc00"],
"transaction": {
"ret": [{}],
"visible": false,
"txID": "cff6488e738ce77f7325572fe0aa2470f87dbf1c95eeeb2c25feec59d5afa35c",
"raw_data": {
"contract": [
{
"parameter": {
"value": {
"data": "70a08231000000000000000000000000dd791d6b49e190062d650e6a23c575510d35f2f9",
"owner_address": "41dd791d6b49e190062d650e6a23c575510d35f2f9",
"contract_address": "41eca9bc828a3005b9a3b909f2cc5c2a54794de05f"
},
"type_url": "type.googleapis.com/protocol.TriggerSmartContract"
},
"type": "TriggerSmartContract"
}
],
"ref_block_bytes": "28c0",
"ref_block_hash": "9eabbe133123b34c",
"expiration": 1777447218000,
"timestamp": 1777447160779
},
"raw_data_hex": "0a0228c022089eabbe133123b34c40d0d6f0c0dd335a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a1541dd791d6b49e190062d650e6a23c575510d35f2f9121541eca9bc828a3005b9a3b909f2cc5c2a54794de05f222470a08231000000000000000000000000dd791d6b49e190062d650e6a23c575510d35f2f970cb97edc0dd33"
}
}Request params
idinteger
jsonrpcstring
methodstring
object
owner_addressstring
The address initiating the contract call, in Base58 or Hex format. Required.
contract_addressstring
The address of the smart contract being called, in Base58 or Hex format.
function_selectorstring
The function signature to invoke on the contract (e.g. transfer(address,uint256)).
parameterstring
The hex-encoded, ABI-encoded arguments to pass to the function specified in function_selector.
datastring
The complete ABI-encoded call payload (function selector plus arguments combined); used as an alternative to supplying function_selector and parameter separately. If both are provided, function_selector and parameter take precedence.
call_valueinteger
The amount of TRX to send along with this call into the contract, in sun.
call_token_valueinteger
The amount of a TRC10 token to send along with this call into the contract.
token_idinteger
The identifier of the TRC10 token being sent via call_token_value.
Permission_idinteger
Multi-sig permission ID
visibleboolean
Whether addresses in the request/response are formatted as Base58 (true) or hex (false). Defaults to true.
extra_datastring
Transaction memo (hex; UTF-8 text when visible=true)
Response
200
Executes a read-only smart contract call without broadcasting a transaction or consuming energy.Response params
object
resultobject
The outcome of executing this read-only (constant) contract call.
object
resultboolean
Whether the call executed successfully without reverting.
energy_usedinteger
The amount of Energy the call would consume if actually broadcast on-chain.
constant_resultarray_of_strings
The hex-encoded return value(s) of the contract's function call.
transactionobject
The unsigned transaction object built from the call parameters, used only to simulate execution (never actually broadcast).
object
retarray_of_objects
Placeholder for the transaction's execution outcome; empty since this is a simulated, unbroadcast call.
visibleboolean
Indicates whether addresses in this transaction are represented in base58 format (true) or hex format (false).
txIDstring
The transaction hash computed for this simulated call, as if it were signed and broadcast.
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions represented by this simulated transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a read-only smart contract invocation.
object
datastring
The hex-encoded ABI-encoded call data, including the function selector and its arguments.
owner_addressstring
The address on whose behalf the call is simulated, in hex format.
contract_addressstring
The address of the smart contract being called, in hex format.
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, TriggerSmartContract).
ref_block_bytesstring
The last two bytes of the reference block number, used for transaction expiration and replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this simulated transaction would no longer be valid.
timestampinteger
Unix timestamp, in ms, marking when this simulated transaction was constructed.
raw_data_hexstring
The hex-encoded serialized bytes of raw_data for this simulated transaction.