Call Contract Method

This Call Contract Method using this method.

API Specification

Call Contract Method

POST http://localhost:8889/wallet/callContract

Call Contract Method under the given instance.

Headers

NameTypeDescription

ChainId*

String

ChainId

Request Body

NameTypeDescription

to*

String

The recipient's address

walletId*

String

The ID of the wallet

params*

String

Additional parameters for the transaction

method*

String

The method for the transaction

contractABI*

String

The Application Binary Interface (ABI) of the contract

{
  "Status": "SUCCESS",
  "Message": "",
  "Data": {
    "response": []
  }
}

Take a look at how you might call this method using our official libraries, or via curl:

curl -X POST http://localhost:8889/wallet/callContract \
-H "Content-Type: application/json" \
-H "ChainId: xxxx" \
-d '{
  "walletId": "effae2b6-3ee3-48cb-9528-87c29152c89e",
  "to": "0xc2de797fab7d2d2b26246e93fcf2cd5873a90b10",
  "method": "store",
  "params": [
    {
      "type": "uint256",
      "value": "35"
    }
  ],
  "contractABI": "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"name\":\"store\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"retrieve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]"
}'

Last updated