Skip to main content

NFTState

Represents the full state of an NFT, including both immutable and mutable properties.

Hierarchy

  • { immutableState: NFTImmutableState; isPaused: Bool; metadata: Field; metadataVerificationKeyHash: Field; name: Field; owner: PublicKey; price: UInt64; storage: Storage; version: UInt32 }
    • NFTState

Index

Constructors

externalconstructor

  • new NFTState(value: { immutableState: NFTImmutableState; isPaused: Bool; metadata: Field; metadataVerificationKeyHash: Field; name: Field; owner: PublicKey; price: UInt64; storage: Storage; version: UInt32 }): NFTState
  • Parameters

    • externalvalue: { immutableState: NFTImmutableState; isPaused: Bool; metadata: Field; metadataVerificationKeyHash: Field; name: Field; owner: PublicKey; price: UInt64; storage: Storage; version: UInt32 }
      • externalimmutableState: NFTImmutableState = NFTImmutableState

        The immutable state of the NFT.

      • externalisPaused: Bool = Bool

        Indicates whether the NFT contract is currently paused.

      • externalmetadata: Field = Field

        The metadata associated with the NFT.

      • externalmetadataVerificationKeyHash: Field = Field

        The hash of the verification key used for metadata proofs.

      • externalname: Field = Field

        The name of the NFT.

      • externalowner: PublicKey = PublicKey

        The current owner of the NFT.

      • externalprice: UInt64 = UInt64

        The price of the NFT.

      • externalstorage: Storage = Storage

        The off-chain storage information (e.g., IPFS hash).

      • externalversion: UInt32 = UInt32

        The version number of the NFT state.

    Returns NFTState

Properties

immutableState

immutableState: NFTImmutableState = NFTImmutableState

The immutable state of the NFT.

isPaused

isPaused: Bool = Bool

Indicates whether the NFT contract is currently paused.

metadata

metadata: Field = Field

The metadata associated with the NFT.

metadataVerificationKeyHash

metadataVerificationKeyHash: Field = Field

The hash of the verification key used for metadata proofs.

name

name: Field = Field

The name of the NFT.

owner

owner: PublicKey = PublicKey

The current owner of the NFT.

price

price: UInt64 = UInt64

The price of the NFT.

storage

storage: Storage = Storage

The off-chain storage information (e.g., IPFS hash).

version

version: UInt32 = UInt32

The version number of the NFT state.

Methods

staticassertEqual

  • Asserts that two NFTState instances are equal.


    Parameters

    Returns void

staticfromNFTState

  • fromNFTState(params: { address: PublicKey; creator: PublicKey; nftState: NFTStateStruct; tokenId: Field }): NFTState
  • Creates a new NFTState from an NFTStateStruct and other parameters.


    Parameters

    • params: { address: PublicKey; creator: PublicKey; nftState: NFTStateStruct; tokenId: Field }

      The parameters including nftState, creator, address, and tokenId.

      • address: PublicKey
      • creator: PublicKey
      • nftState: NFTStateStruct
      • tokenId: Field

    Returns NFTState

    A new NFTState instance.