getOwnedNFTs

Retrieves the owned NFTs for a given owner. This extension only works with ERC721 contracts that support the tokenOfOwnerByIndex method

Example

import { getOwnedNFTs } from "thirdweb/extensions/erc721";
const ownedNFTs = await getOwnedNFTs({
contract,
owner: "0x1234...",
});
function getOwnedNFTs(
): Promise<Array<NFT>>;

Parameters

The options for retrieving the owned NFTs.

Type

Returns

let returnType:
| {
id: bigint;
metadata: NFTMetadata;
owner: string | null;
tokenURI: string;
type: "ERC721";
}
| {
id: bigint;
metadata: NFTMetadata;
owner: string | null;
supply: bigint;
tokenURI: string;
type: "ERC1155";
};

A promise that resolves to an array of NFTs owned by the specified owner.