Skip to main content

useNFTs() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get a list of NFT tokens of your NFTContract.

Example

const { contract } = useContract(<ContractAddress>);
const { data: nfts, isLoading, error } = useNFTs(contract, { start: 0, count: 100 });

Signature:

export declare function useNFTs<TContract extends NFTContract>(
contract: RequiredParam<TContract>,
queryParams?: QueryAllParams,
): import("@tanstack/react-query").UseQueryResult<NFT[], unknown>;

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>an instance of a NFTContract
queryParamsQueryAllParams(Optional) query params to pass to the query for the sake of pagination

Returns:

import("@tanstack/react-query").UseQueryResult<NFT[], unknown>

a response object that includes an array of NFTs