PreiseGitHubDashboard

TRON

protocol.Wallet/TriggerConstantContract25 Credits

Calls a smart contract function read-only, nothing is broadcast (gRPC).

Netzwerk: tron

Parameter

NameTypBeschreibung
owner_addressstringCaller address (bytes; base64 in the JSON form).
contract_addressstringContract address (bytes; base64 in the JSON form).
datastringABI-encoded call data: function selector + arguments (bytes; base64 in the JSON form). (optional)
call_valuenumberTRX sent with the call, in sun (int64). (optional)
call_token_valuenumberAmount of a TRC-10 token sent with the call (int64). (optional)
token_idnumberTRC-10 token id for call_token_value (int64). (optional)

Rückgabewert

Typ

Object

TransactionExtention message: transaction (unsigned), txid, constant_result[] (ABI-encoded return data), result (result, code, message), energy_used, energy_penalty, logs[], internal_transactions[].

Codebeispiele

# the key of the endpoint goes in the x-token header; add -proto <file> when the node has no gRPC reflection
grpcurl \
  -H 'x-token: 7c9e6679-7425-40de-944b-e07fc1f90ae7' \
  -d '{
  "owner_address": "<base64 caller address>",
  "contract_address": "<base64 contract address>",
  "data": "<base64 ABI call data>"
}' \
  grpc-holy-burned-sky-tron-mainnet.rpcnode.dev:443 \
  protocol.Wallet/TriggerConstantContract