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

TriggerSmartContract

POST: http://172.104.51.182:16667/wallet/triggersmartcontract

Returns TransactionExtention, which contains the unsigned Transaction

BODY PARAMS {

owner_address string

contract_address string

function_selector string

parameter string

fee_limit int32

call_value int32

permission_id int32 (Optional)

visible boolean (Optional)

}

Note:

  • owner address that triggers the contract, converted to a hex string

  • contract address, converted to a hex string

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

  • fee_limit is maximum TRX consumption, measured in Aiix (1 TRX = 1,000 Aixc).

  • call_value is amount of TRX transferred with this transaction, measured in Aiix (1 TRX = 1,000 Aixc).

  • permission_id for multi-signature

  • visible: whehter the address is in base58check format.

Example:

Input:

{

"owner_address":"AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "contract_address":"AV27cVbuGmTv9q6qgtPxsLUkuG9ohUUVPd", "function_selector":"mintWithTokenURI(address,uint256,string)", "json_string": "[{"address":"AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz"},{"uint256":"100"},{"string":"https://www.google.com.vn"}]", "parameter":"0000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001a68747470733a2f2f7777772e676f6f676c652e636f6d2e766e32000000000000", "fee_limit": 400000000, "call_value": 0, "visible": true

}

Response:

{

"result": { "result": true }, "transaction": { "visible": true, "txID": "c2d17d92b78b9039c39324496bdef566927996c655c8f9930343819cb6bceaa0", "raw_data": { "contract": [ { "parameter": { "value": { "data": "50bb4e7f0000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001a68747470733a2f2f7777772e676f6f676c652e636f6d2e766e32000000000000", "owner_address": "AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "contract_address": "AV27cVbuGmTv9q6qgtPxsLUkuG9ohUUVPd" }, "type_url": "type.googleapis.com/protocol.TriggerSmartContract" }, "type": "TriggerSmartContract" } ], "ref_block_bytes": "d36b", "ref_block_hash": "c1ea79b01e683426", "expiration": 1639055307000, "fee_limit": 400000000, "timestamp": 1639055249995 }, "raw_data_hex": "0a02d36b2208c1ea79b01e68342640f8e1bcfad92f5a9002081f128b020a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412d5010a15414203485a535a4072c9fbfaaddfe2a010ad0bcdb0121541d0f723a417a54e5629d865e05db8a45b79f0a9c322a40150bb4e7f0000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001a68747470733a2f2f7777772e676f6f676c652e636f6d2e766e3200000000000070cba4b9fad92f90018088debe01" }

}

PreviousSmart ContractsNextDeployContract

Last updated 29 days ago

curl --request POST --url --header 'Accept: application/json' --header 'Content-Type: application/json' --data ' "owner_address":"AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz", "contract_address":"AV27cVbuGmTv9q6qgtPxsLUkuG9ohUUVPd", "function_selector":"mintWithTokenURI(address,uint256,string)", "json_string": "[{"address":"AFzFXoQCgUeoApjejKM9B46NgFGHXvUyKz"},{"uint256":"100"},{"string":"https://www.google.com.vn"}]", "parameter":"0000000000000000000000004203485a535a4072c9fbfaaddfe2a010ad0bcdb000000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001a68747470733a2f2f7777772e676f6f676c652e636f6d2e766e32000000000000", "fee_limit": 400000000, "call_value": 0, "visible": true'

http://172.104.51.182:16667/wallet/triggersmartcontract