Read Contract
POST /networks/read-contract
Calls a read-only function on a smart contract. In Solidity, these use the view
keyword. Note: Currently only works on EVM compatible chains.
Request headers required. See Request Headers for more information.
Authentication required. See Authentication Headers for more information.
Required Permissions
No permissions are required as this only exposes public blockchain data.
Request body
kind
Required
Specify "Evm
". Additional kinds will be added in the future.
Enum String
contract
Required
Address of the contract to call
String
data
Required
Encoded hex string indicating which function in the smart contract to call with which parameters. For more information, see the encodeFunctionData ethersJS documentation.
String
Sample request body
Response
Response example
Note the data
field in the response is hex encoded.
EthersJS / Dfns SDK Example
You can use the following code with the Dfns Typescript SDK to execute this call:
Last updated