Skip to main content

Read Data

After you have instantiated the SDK and connected to a smart contract, you can read any data from the contract.

Feature Functions

The SDK includes a comprehensive set of helper functions to read and format data from your smart contract.

Any Prebuilt contract or contract built using Solidity SDK has access to these functions in the SDK.

var nfts = await contract.ERC721.GetAll(); // ERC721
var nftOne = await contract.ERC1155.Get(1); // ERC1155
var totalSupply = await contract.ERC20.TotalSupply(); // ERC20

Function By Name

Call any contract function, mapping, view, or variable using the Read method and providing any required arguments:

// Below, we specify that we expect a string to be returned from "functionName" on the contract
var string = await contract.Read<string>("functionName", arg1, arg2);