TRON
walletsolidity/triggerconstantcontract25 créditos
Calls a smart contract function read-only (simulated, nothing is broadcast) (solidified state).
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| owner_address | string | Address of the caller (base58 or hex). |
| contract_address | string | Contract address (base58 or hex). |
| function_selector | string | Function signature, e.g. transfer(address,uint256). (opcional) |
| parameter | string | ABI-encoded call arguments as a hex string, without the 4-byte selector. (opcional) |
| data | string | Full ABI-encoded call data (selector + arguments); ignored when function_selector is set. (opcional) |
| call_value | number | TRX sent with the call, in sun. (opcional) |
| call_token_value | number | Amount of a TRC-10 token sent with the call. (opcional) |
| token_id | number | TRC-10 token id for call_token_value. (opcional) |
| visible | boolean | true = base58 addresses (in the request and the response); false (default) = hex addresses. (opcional) |
Valor devuelto
Tipo
Object
Object with result (result: true when processed; code, message on failure), constant_result (ABI-encoded hex return data), energy_used, energy_penalty, transaction (the unsigned simulated transaction; check transaction.ret[0].ret for a revert), logs and internal_transactions. Nothing is committed on-chain.
Ejemplos de código
curl 'https://holy-burned-sky-tron-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7/walletsolidity/triggerconstantcontract' \
-X POST \
-H 'content-type: application/json' \
-d '{
"owner_address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy",
"contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"function_selector": "symbol()",
"visible": true
}'