Read Contract
Last updated
Last updated
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.
No permissions are required as this only exposes public blockchain data.
Request body fields | Required/Optional | Description | Type |
---|---|---|---|
Note the data
field in the response is hex encoded.
You can use the following code with the Dfns Typescript SDK to execute this call:
kind
Required
Specify "Evm
". Additional kinds will be added in the future.
Enum String
network
Required
Network used for the wallet (See Supported Networks for possible values)
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