AIXChain Blockchain Document
  • INTRODUCTION
    • Getting started with smart contract development
    • Build a Decentralized Library
  • AIXC AND ARC TOKEN
    • ARC
      • ARX Transfer
      • Query ARX balance
    • ARC-10
      • Issue ARC-10 token
      • Participate ARC-10
      • ARC-10 Transfer
      • Query ARC-10 balance
      • ARC-10 Transfer in Smart Contracts
    • ARC-20
      • Protocol Interface
      • Contract Example
      • Issuing ARC-20 tokens tutorial
    • ARC-721
      • Protocol Interface
      • Contract Example
  • ACCOUNT MODEL
  • BUILD NODE
    • How to setup a Super node to produce Blocks
      • Recommended configuration & Environment
      • Example cloud services
      • Deployment guide
    • Super Representative
      • How to become a SR
      • Super Representatives Election
      • How to change witness name
  • HTTP API
    • Introduction
    • API Signature and Broadcast Flow
    • API List
      • Full Node API Overview
      • Address Utilities
        • GenerateAddress
        • CreateAddress
        • ValidateAddress
      • Accounts
        • CreateAccount
        • GetAccount
        • UpdateAccount
        • AccountPermissionUpdate
        • GetAccountBalance
      • Account Resources
        • GetAccountResource
        • GetAccountNet
        • FreezeBalance
        • UnfreezeBalance
        • GetDelegatedResource
        • GetDelegatedResourceAccountIndex
      • Query the Network
        • GetBlockByNum
        • GetBlockById
        • GetBlockByLatestNum
        • GetBlockByLimitNext
        • GetNowBlock
        • GetTransactionById
        • GetTransactionInfoById
        • GetTransactionInfoByBlockNum
        • ListNodes
        • GetNodeInfo
        • GetChainParameters
        • GetBlockBalance
      • ARC10 Token
        • GetAssetIssueByAccount
        • GetAssetIssueById
        • GetAssetIssueList
        • GetPaginatedAssetIssueList
        • TransferAsset
        • CreateAssetIssue
        • UnfreezeAsset
        • UpdateAsset
      • Transactions
        • GetContract
        • GetTransactionSign
        • BroadcastTransaction
        • BroadcastHex
        • EasyTransfer
        • EasyTransferByPrivate
        • CreateTransaction
      • Voting & SRs
        • ListWitnesses
        • CreateWitness
        • UpdateWitness
        • GetBrokerage
        • UpdateBrokerage
        • VoteWitnessAccount
        • GetReward
        • WithdrawBalance
        • GetNextMaintenanceTime
      • Smart Contracts
        • TriggerSmartContract
        • DeployContract
        • UpdateSetting
        • UpdateEnergyLimit
        • ClearAbi
        • GetContract
        • TriggerConstantContract
      • Proposals
      • Solidity Node API
    • RPC List
  • AIXCHAIN CLI
  • Aixchain SDK
    • Quickstart
    • Address and Signature
    • Sending Transaction
    • Smart Contract
  • Faucet Aixchain
  • Wallets
Powered by GitBook
On this page
  1. HTTP API
  2. API List
  3. Smart Contracts

TriggerConstantContract

POST: http://172.104.51.182:16667/wallet/triggerconstantcontract

PreviousGetContractNextProposals

Last updated 1 month ago

Trigger the constant of the smart contract, the transaction is off the blockchain. Returns the Transaction Object. The corresponding method must be marked view or pure.

BODY PARAMS {

owner_address string

contract_address string

function_selector string

parameter string

visible boolean (Optional)

}

Note:

  • 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 address is smart contract address. If visible=true, use base58check format, otherwise use hex format.

  • function_selector is function call, must not be left blank.

  • 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..

  • visible: whehter the address is in base58check format.

Example:

curl --request POST --url --header 'Accept: application/json' --header 'Content-Type: application/json' --data ' { "owner_address": "410000000000000000000000000000000000000000", "contract_address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c", "function_selector": "balanceOf(address)", "parameter": "000000000000000000000000a614f803b6fd780986a42c78ec9c7f77e6ded13c" }

Input:

{

"owner_address": "AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "contract_address": "AV27cVbuGmTv9q6qgtPxsLUkuG9ohUUVPd", "function_selector": "balanceOf(address)", "parameter": "0000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb0", "visible": true

}

Response:

{

"result": { "result": true }, "constant_result": [ "0000000000000000000000000000000000000000000000000000000000000001" ], "transaction": { "ret": [ {} ], "visible": true, "txID": "65acb81ca6fddf5ddb36ce6f70f59055f54e9d1be7a8c914e09ab64861ad618b", "raw_data": { "contract": [ { "parameter": { "value": { "data": "70a082310000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb0", "owner_address": "AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "contract_address": "AV27cVbuGmTv9q6qgtPxsLUkuG9ohUUVPd" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "610a", "ref_block_hash": "29c5bc3adde0b6e8", "expiration": 1639969011000, "timestamp": 1639968952474 }, "raw_data_hex": "0a02610a220829c5bc3adde0b6e840b8ea94aedd2f5a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a15414203485a535a4072c9fbfaaddfe2a010ad0bcdb0121541d0f723a417a54e5629d865e05db8a45b79f0a9c3222470a082310000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb0709aa191aedd2f" }

}

http://172.104.51.182:16667/wallet/triggerconstantcontract