Okto Embedded WalletUsing Embedded Wallet
Read Contract Data On-chain Via Code
Learn how to read data from any smart contract using the Okto SDK.
Methods Overview
Methods | Description |
---|---|
async readContractData | Read data from any smart contract on supported chains |
Read Contract Data
async readContractData(network_name, data)
reads data from a smart contract based on the provided parameters.
Parameters
Parameter | Type | Description |
---|---|---|
network_name | string | The network where the contract is deployed |
data | any | Network-specific contract interaction details |
The structure of data
parameter varies based on the network:
Response
Success Response
Field Name | Type | Description |
---|---|---|
result | Promise<any> | Returns the data read from the contract. Type depends on the contract function being called |