import BigNumber from 'bignumber.js'; import { Context, Entity, NftCollection } from '../../../../internal'; import { AssetHolder, NftMetadata, OptionalArgsProcedureMethod, RedeemNftParams } from '../../../../types'; export type NftUniqueIdentifiers = { assetId: string; id: BigNumber; }; export interface HumanReadable { id: string; collection: string; } /** * Class used to manage Nft functionality. Each NFT belongs to an NftCollection, which specifies the expected metadata values for each NFT */ export declare class Nft extends Entity { id: BigNumber; /** * The {@link NftCollection} this NFT belongs to */ collection: NftCollection; /** * Redeem (or "burns") the NFT, removing it from circulation */ redeem: OptionalArgsProcedureMethod; /** * @hidden * Check if a value is of type {@link UniqueIdentifiers} */ static isUniqueIdentifiers(identifier: unknown): identifier is NftUniqueIdentifiers; /** * @hidden */ constructor(identifiers: NftUniqueIdentifiers, context: Context); /** * Get metadata associated with this token */ getMetadata(): Promise; /** * Determine if the NFT exists on chain */ exists(): Promise; /** * Get the conventional image URI for the NFT * * This function will check for a token level value and a collection level value. Token level values take precedence over base values in case of a conflict. * * When creating a collection an issuer can either require per token images by specifying global metadata key `imageUri` as a collection key or by * setting a collection base image URL by setting a value on the collection corresponding to the global metadata key `baseImageUri`. * * This method will return `null` if the NFT issuer did not configure the collection according to the convention. * * Per token URIs provide the most flexibility, but require more chain space to store, increasing the POLYX fee to issue each token. * * The URI values can include `{tokenId}` that will be replaced with the NFTs ID. If a base URI does not specify this the ID will be appended onto the URL. Examples: * - `https://example.com/nfts/{tokenId}/image.png` becomes `https://example.com/nfts/1/image.png` * - `https://example.com/nfts` becomes `https://example.com/nfts/1` if used a base value, but remain unchanged as a local value */ getImageUri(): Promise; /** * Get the conventional token URI for the NFT * * This function will check for a token level value and a collection level value. Token level values take precedence over base values in case of a conflict. * * When creating a collection an issuer can either require per token URL by specifying global metadata key `tokenURI` as a collection key or by * setting a collection base URL by setting a value on the collection corresponding to the global metadata key `baseTokenUri` on the collection. * * This method will return `null` if the NFT issuer did not configure the collection according to the convention. * * Per token URIs provide the most flexibility, but require more chain space to store, increasing the POLYX fee to issue each token. * * The URI values can include `{tokenId}` that will be replaced with the NFTs ID. If a base URI does not specify this the ID will be appended onto the URL. Examples: * - `https://example.com/nfts/{tokenId}/info.json` becomes `https://example.com/nfts/1/info.json` * - `https://example.com/nfts` becomes `https://example.com/nfts/1` if used a base value, but remain unchanged as a local value */ getTokenUri(): Promise; /** * Get owner of the NFT * * @note This method returns `null` if there is no existing holder for the token. This may happen even if the token has been redeemed/burned */ getOwner(): Promise; /** * Check if the NFT is locked in any settlement instruction * * @throws if NFT has no owner (has been redeemed) */ isLocked(): Promise; /** * @hidden */ toHuman(): HumanReadable; /** * given a global metadata ID fetches a local URI value * * @hidden */ private getLocalUri; /** * * given a global metadata ID fetches a base URI value * * @hidden */ private getBaseUri; /** * @hidden */ private templateId; /** * @hidden */ private templateBaseUri; /** * helper to lookup global metadata ID by name * * @hidden */ private getGlobalMetadataId; } //# sourceMappingURL=Nft.d.ts.map