POST
/
95e61622bf6a8af293978377718e3b77
/
wallet
/
triggerconstantcontract
wallet/triggerconstantcontract
curl --request POST \
  --url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/triggerconstantcontract \
  --header 'Content-Type: application/json' \
  --data '{
  "owner_address": "41b487cdb2d8dc7b2a8e5e7e7b4e3e8b8b8b8b8b",
  "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
  "function_selector": "balanceOf(address)",
  "parameter": "000000000000000000000000b487cdb2d8dc7b2a8e5e7e7b4e3e8b8b8b8b8b"
}'
{
  "result": {
    "result": true
  },
  "energy_used": 123,
  "constant_result": [
    "<string>"
  ],
  "transaction": {}
}
TRON API method that calls a constant (read-only) smart contract method without consuming energy or bandwidth. This method allows you to query contract state and call view functions without broadcasting a transaction to the blockchain.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • owner_address — (optional) address calling the contract method in hexadecimal format
  • contract_address — smart contract address to call in hexadecimal format
  • function_selector — function signature or selector (e.g., “balanceOf(address)”)
  • parameter — (optional) encoded parameters for the function call in hexadecimal format

Response

  • result — execution result object containing:
    • result — boolean indicating if the call was successful
  • energy_used — estimated energy consumption if this were a real transaction
  • constant_result — array of return values from the contract method in hexadecimal format
  • transaction — transaction object that would be created (for reference, not executed)

Use case

The wallet/triggerconstantcontract method is used for:
  • Calling read-only smart contract methods to query blockchain state.
  • Reading token balances, contract variables, and other view data without costs.
  • Testing contract method calls before executing actual transactions.
  • Building user interfaces that need to display current contract state.
  • Implementing contract interaction tools that require state queries.
  • Estimating energy costs for contract method calls before execution.

Body

application/json

Response

200 - application/json

Contract call result

The response is of type object.