Call Contract
The "Call Contract" functionality in the KrypC wallet-dev Service API allows users to interact with and execute specific functions within a deployed smart contract on the blockchain, enabling seamless integration and communication with decentralised applications.
This Call Contract Method using this method.
API Specification
Call Contract
POST
https://api.krypcore.com/api/v0/devWallet/callContract
Calls Contract under the given instance.
Headers
Name
Type
Description
DappId*
String
DappId
Authorization*
String
User Auth key obtained
SubscriptionId
String
String
ChainId
String
String
Request Body
Name
Type
Description
to*
String
To Address
chainId*
String
Chain ID
method*
String
Method
params*
String
Params
contractABI*
String
ContractABI
{
"Data": {
"response": [
35
]
},
"Message": "",
"Status": "SUCCESS"
}
Take a look at how you might call this method using our official libraries, or via curl
curl --location 'https://api.krypcore.com/api/v0/devWallet/callContract' \
--header 'DappId: **********' \
--header 'Authorization: **********' \
--header 'SubscriptionId: ********' \
--header 'ChainId: ********' \
--header 'Content-Type: application/json' \
--data '{
"to": "*********",
"chainId": 80001,
"method": "retrieve",
"params": [],
"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
Was this helpful?