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 1

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

Example 2

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

Signature:

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

a response object that includes an array of NFTs