useClaimedNFTs

Hook for fetching all claimed NFTs from a given NFT Drop contract.

Available to use on contracts that implement ERC721Claimable , such as the NFT Drop .

Example

import { useClaimedNFTs, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "nft-drop");
const { data: nfts, isLoading, error } = useClaimedNFTs(contract);
}
function useClaimedNFTs(
contract: RequiredParam<NFTDrop>,
queryParams?: {},
): UseQueryResult<Array<NFT>, unknown>;

Parameters

Instance of a contract that extends the ERC721 spec (NFT drop, Signature Drop, or any custom contract that extends the ERC721 spec)

Type

let contract: RequiredParam<NFTDrop>;

By default, the hook will return the first 100 claimed NFTs

You can use the queryParams argument to paginate the NFTs that are returned.

import { useClaimedNFTs, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress, "nft-drop");
const { data, isLoading, error } = useClaimedNFTs(contract, {
// For example, to only return the first 50 claimed NFTs in the collection
// in order of token ID
count: 50,
start: 0,
});
}

Returns

let returnType: UseQueryResult<Array<NFT>, unknown>;

Query Result object that includes an array of NFTs that are claimed in the data property