curl --request POST \
--url https://api.dfns.io/networks/{network}/call-function \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract": "<string>",
"abi": {
"type": "<string>",
"name": "<string>",
"stateMutability": "<string>",
"inputs": [
{
"name": "<string>",
"type": "<string>",
"components": [
{}
]
}
],
"outputs": [
{
"name": "<string>",
"type": "<string>",
"components": [
{}
]
}
]
},
"calldata": {}
}
'Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to view.
Currently only works on EVM compatible chains.
curl --request POST \
--url https://api.dfns.io/networks/{network}/call-function \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract": "<string>",
"abi": {
"type": "<string>",
"name": "<string>",
"stateMutability": "<string>",
"inputs": [
{
"name": "<string>",
"type": "<string>",
"components": [
{}
]
}
],
"outputs": [
{
"name": "<string>",
"type": "<string>",
"components": [
{}
]
}
]
},
"calldata": {}
}
'CustomerEmployee)EndUser)Bearer Token: Used to authenticate API requests. More details how to generate the token: Authentication flows
Network name formatted in kebab case
Success
Was this page helpful?