POSTTriggerConstantContract

Tron Mainnethttps://tron-mainnet.nodit.io/walletsolidity/triggerconstantcontract

Invoke the readonly function (modified by the view or pure modifier) of a contract for contract data query; or Invoke the non-readonly function of a contract for predicting whether the transaction can be successfully executed or estimating the energy consumption. (Confirmed state)

Request Body
owner_addressstringrequired

Transaction initiator address. (Format: Base58 or Hex)

contract_addressstring

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

function_selectorstring

Function selector. Example: balanceOf(address)

parameterstring

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

datastring

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.

call_valueinteger (int64)

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

call_token_valueinteger (int64)

Amount of TRC-10 token transferred into the contract.

token_idinteger (int64)

TRC-10 token id

visibleboolean

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

Responses
resultboolean

Whether the call succeeded.

예: true

constant_resultstring[]

List of results from a constant contract call.

X-API-KEY
RequestCU25
cURL
curl -X POST "https://tron-mainnet.nodit.io/walletsolidity/triggerconstantcontract" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "owner_address": "TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM",
  "contract_address": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
  "function_selector": "balanceOf(address)",
  "parameter": "00000000000000000000000098927ffb9f554dc4a453c64b2e553a02d6df514b",
  "visible": true
}'
Response
Example · 200
{
  "result": {
    "result": true
  },
  "constant_result": [
    "000000000000000000000000000000000000000000000000000009a1832a6361"
  ]
}