getNFT

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

Example

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

Parameters

The options for retrieving the NFT.

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