getNFT

Retrieves information about a specific ERC721 non-fungible token (NFT).

Example

import { getNFT } from "thirdweb/extensions/erc721";
const nft = await getNFT({
contract,
tokenId: 1n,
});
function getNFT(
includeOwner?: boolean;
tokenId: bigint;
}>,
): Promise<NFT>;

Parameters

The options for retrieving the NFT.

Type

let options: BaseTransactionOptions<{
includeOwner?: boolean;
tokenId: bigint;
}>;

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 the NFT object.