useUnclaimedNFTs

Hook for fetching information about all NFTs that haven't been claimed yet from an NFT Drop contract.

Available to use on contracts that extends the ERC721 spec

Example

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

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>;

query params to pass to the query for the sake of pagination By default, the hook returns the first 100 unclaimed NFTs from the contract.

Paginate the results by providing a queryParams object as the second argument.

import { useUnclaimedNFTs, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useUnclaimedNFTs(contract, {
count: 10, // Limit the number of results
start: 0, // Start from the nth result (useful for pagination)
});
}

Returns

let returnType: UseQueryResult<Array<NFTMetadata>>;

The hook's data property, once loaded, contains an array of NFT objects.