Skip to main content

useOwnedNFTs() function

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

Use this to get a the owned NFTs for a specific NFTContract and wallet address.

Example 1

const nftDrop = useNFTDrop(<ContractAddress>);
const { data: ownedNFTs, isLoading, error } = useOwnedNFTs(nftDrop, <OwnerWalletAddress>);

Example 2

const { contract } = useContract(<ContractAddress>);
const { data: ownedNFTs, isLoading, error } = useOwnedNFTs(contract?.nft, <OwnerWalletAddress>);

Signature:

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

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>an instance of a NFTContract
ownerWalletAddressRequiredParam<WalletAddress>the wallet adress to get owned tokens for

Returns:

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

a response object that includes the list of owned tokens