TriggerConstantContract

Simulate a contract call against solidified state for view/pure queries, dry-runs, and Energy estimation.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Simulate a contract call against solidified state. Use it for view or pure function queries, dry-running non-read-only functions, and estimating Energy usage.


Notes

For TRC-20 balance queries, function_selector is usually balanceOf(address), and parameter is the target account address encoded as a 32-byte ABI argument.

If constant_result is empty, common causes include an incorrect function signature, incorrect ABI encoding, a target address that is not a contract, contract execution that reverted, or a node that does not support the constant-call path.

  • This API does not broadcast a transaction and does not change on-chain state. It is not a substitute for TriggerSmartContract when you need a real state-changing transaction.
  • This endpoint does not require a transaction-level fee_limit and does not consume the account's actual Bandwidth or Energy. Simulation is still subject to node configuration and protective TVM execution limits.
  • Decode contract return values according to their ABI types. Do not treat the constant_result[0] hex string as a human-readable value directly.
  • Convert TRC-20 balances using the token contract's decimals() value.
  • For balance reconciliation, prefer the SolidityNode version so unsolidified state is not written into final ledgers.
  • If you need specialized Energy estimation and the node has the required configuration enabled, use EstimateEnergy.

Related resources

Body Params
string
required

Transaction initiator address. (Format: Base58 or Hex)

string

Contract address. (Format: Base58 or Hex).
Example: TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs

string

Function selector.
Example: balanceOf(address)

string

ABI-encoded function parameters (Hex String).
Example: 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c

string

This field transmits the necessary data for smart contract interaction, including the function being called and its parameters. You may choose to use the data field, which contains the complete ABI-encoded information, or use the function_selector and parameter fields separately. Note that if both data and function_selector are present, the system will prioritize using the function_selector and parameter fields for the contract interaction.

int64

Amount of TRX transferred into the contract. (Unit: sun)

int64

Amount of TRC-10 token transferred into the contract.

int64

TRC-10 token id

boolean
Defaults to true

Optional. Set to true to format addresses in Base58; set to false for hex format. (Default: false)

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json