HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceCommunityDiscordBlogFAQBug BountyAnnouncementsChange Log
API Reference

TriggerConstantContract

This interface is used for pre-execution (or simulation) of smart contracts on the blockchain: it can call a contract's read-only functions for data queries, call non-read-only functions to predict transaction success or estimate required Energy consumption

Note:

  • TriggerConstantContract operation will not generate an on-chain transaction, nor will it change the status of the current node.

Returns

FieldTypeDescription
resultReturnRun result, for detailed parameter definition, refer to EstimateEnergy
energy_usedint64Total energy consumption, including basic and penalty energy consumption.
energy_penaltyint64Penalty Energy consumption.
constant_resultstring[]List of results from a constant contract call.
transactionTransactionTransaction object, see GetTransactionByID for structure.

Conclusion:

  • The energy consumption: energy_used
  • The penalty energy consumption: energy_penalty
  • The basic energy consumption: energy_used - energy_penalty
Language
Click Try It! to start a request and see the response here!