useReadContract

Signature #1

A hook to read from a contract.

Example

import { useReadContract } from "thirdweb/react";
const { data, isLoading } = useReadContract({
contract,
method: "totalSupply",
});

Parameters

Returns

a query object.

Signature #2

A hook to read from a contract.

Example

import { useReadContract } from "thirdweb/react";
import { getOwnedNFTs } form "thirdweb/extensions/erc721"
const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });

Parameters

Returns

a query object.