HomeGuidesAPI ReferenceChangelog
GuidesAPI ReferenceCommunityDiscordBlogFAQBug BountyAnnouncementsChange Log
API Reference

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

Log in to see full request history
timestatususer agent
Retrieving recent requests…
LoadingLoading…

Note:

  • TriggerConstantContract operation will not generate an on-chain transaction, nor will it change the status of the current node.
  • For estimating energy: use triggerconstantcontract to call the non-readonly method of the contract, and the energy_used field in the returned value is the energy consumption. Therefore, the fee_limit of the transaction can be set to energy_used x energy unit price.
  • Parameter encoding and decoding example: Parameter and return value encoding and decoding
Body Params
string
Defaults to 410000000000000000000000000000000000000000

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.

string
Defaults to 41a614f803b6fd780986a42c78ec9c7f77e6ded13c

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

string
Defaults to balanceOf(address)

Function call, must not be left blank.

string
Defaults to 000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c

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.

boolean

Optional.Whehter the address is in base58 format.

Responses

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