v1

latestOpenAPI 3.1.02026-07-2612501.4 MB

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 and estimating the energy consumption; or estimate the energy consumption of contract deployment

post/node/v1/tron/mainnet/{apiKey}/wallet/triggerconstantcontract

Path parameters

apiKeystring required

please <span class="custom-style"><a href="../docs/quick-start-guide#-creating-your-api-key-on-the-zan-platform" target="_blank">create your own API key</a></span>

Request body

owner_addressstring required

Owner address that triggers the contract. If visible=true, use base58check format, otherwise use hex format. For constant call you can use the all-zero address.

contract_addressstring required

Smart contract address. If visible=true, use base58check format, otherwise use hex format.

function_selectorstring

Function call, must not be left blank.

parameterstring

Parameter encoding needs to be in accordance with the ABI rules, the rules are more complicated, users can use the ethers library to encode,For details, please refer to the document-Guide-Smart Contract-Best Practice-Parameter Encoding and Decoding.

visibleboolean required

Optional.Whehter the address is in base58 format.

Response

200

energy_usedinteger

Estimated energy consumption, including the basic energy consumption and penalty energy consumption

energy_penaltyinteger

The penalty energy consumption

constant_resultstring[]

Result list

transactionobject

Transaction information