triggerconstantcontract — Tron Wallet API
Executes a read-only native Tron contract call without broadcasting a transaction.
https://triport.io/rpc/tron/wallet/triggerconstantcontract- Network
- Tron mainnet
- Scope
- tron:rpc
- Auth
- x-token: $TRIPORT_API_KEY
- Rate limit
- free+; tron_read_rpc_heavy: 2 / 5 / 20 / 80 RPS sustained · short burst 4 / 10 / 40 / 160 (free / basic / pro / business; default, unmeasured); Burst capacity
Endpoint and plans: Tron RPC endpoint.
triggerconstantcontract simulates a contract function through the native
wallet interface. It can query a view function or simulate a state-changing
function such as transfer(address,uint256) without committing changes or
broadcasting a transaction. The function is identified by its Solidity
signature, with optional ABI-encoded arguments supplied separately.
Both address fields use hex-41 by default; all addresses must be Base58 when
visible is true. For a raw EVM call object and ABI-encoded return bytes, use
eth_call. A successful HTTP status does not by
itself prove that contract execution succeeded.
Parameters
The JSON body defines the caller, target, function, and optional arguments.
owner_addressstringrequiredcontract_addressstringrequiredfunction_selectorstringrequiredtotalSupply().parameterstringoptional0x prefix.visiblebooleanoptionalfalse; set true only when every address is Base58.Response
The OpenAPI contract publishes no response example or closed set of
execution-result fields. {} is a schema-valid placeholder, not evidence that
the sample call succeeded. The dated observation below documents a response
subset separately from that schema.
responseobjectErrors
Wallet failures use HTTP status plus JSON. See Tron errors.
| HTTP | Meaning | When it happens |
|---|---|---|
400 | Bad request | A required field is missing or an address/parameter is malformed. |
401 | Unauthorized | The API key is missing or invalid. |
403 | Forbidden | The scope or tier does not permit the request. |
429 | Rate limited | The tron_read_rpc_heavy budget is exceeded. |
Contract execution can also report a revert inside a successful HTTP response; inspect the returned operation-specific object rather than checking HTTP alone.
Examples
const body = {
owner_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
contract_address: "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
function_selector: "totalSupply()",
};
const response = await fetch("https://triport.io/rpc/tron/wallet/triggerconstantcontract", {
method: "POST",
headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify(body),
});
const callResult = await response.json();Notes
- This operation is read-only; no broadcast endpoint is part of this guide.
- Do not include
0xinparameter; the schema accepts bare hexadecimal only. - Related:
eth_call. - A TRC-20
balanceOfthat returns zero is usually a parameter-encoding issue; see why a TRC-20 balanceOf call returns zero.