Reads data from a smart contract.
import { readContract } from "thirdweb";const result = await readContract({ contract, method: "function totalSupply() view returns (uint256)",});
function readContract< TAbi extends Abi, TMethod extends string, TPreparedMethod extends PreparedMethod< ParseMethod<TAbi, TMethod> > = PreparedMethod<ParseMethod<TAbi, TMethod>>,>( options: ReadContractOptions<TAbi, TMethod, TPreparedMethod>,): Promise<ReadContractResult<TPreparedMethod[2]>>;
The transaction options.
let options: ReadContractOptions<TAbi, TMethod, TPreparedMethod>;
let returnType: Promise<ReadContractResult<TPreparedMethod[2]>>;
A promise that resolves with the result of the read transaction.