Class: NFTState

Properties overview

  • approved: PublicKey = PublicKey;
  • context: NFTTransactionContext = NFTTransactionContext;
  • creator: PublicKey = PublicKey;
  • immutableState: NFTImmutableState = NFTImmutableState;
  • isPaused: Bool = Bool;
  • metadata: Field = Field;
  • metadataVerificationKeyHash: Field = Field;
  • name: Field = Field;
  • oracleAddress: PublicKey = PublicKey;
  • owner: PublicKey = PublicKey;
  • storage: Storage = Storage;
  • version: UInt32 = UInt32;

Methods overview

  • assertEqual()
  • fromNFTState()

Defined in: packages/nft/src/interfaces/types.ts:182

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

Extends

  • {
    approved: PublicKey;
    context: NFTTransactionContext;
    creator: PublicKey;
    immutableState: NFTImmutableState;
    isPaused: Bool;
    metadata: Field;
    metadataVerificationKeyHash: Field;
    name: Field;
    oracleAddress: PublicKey;
    owner: PublicKey;
    storage: Storage;
    version: UInt32;
    }

Constructors

new NFTState()

new NFTState(value: {
  approved: PublicKey;
  context: NFTTransactionContext;
  creator: PublicKey;
  immutableState: NFTImmutableState;
  isPaused: Bool;
  metadata: Field;
  metadataVerificationKeyHash: Field;
  name: Field;
  oracleAddress: PublicKey;
  owner: PublicKey;
  storage: Storage;
  version: UInt32;
 }): NFTState

Defined in: node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:103

Parameters

value
approved

PublicKey = PublicKey

The approved address of the NFT.

context

NFTTransactionContext = NFTTransactionContext

The transaction context of the NFT.

creator

PublicKey = PublicKey

The public key of the creator of the NFT (readonly).

immutableState

NFTImmutableState = NFTImmutableState

The immutable state of the NFT.

isPaused

Bool = Bool

Indicates whether the NFT contract is currently paused.

metadata

Field = Field

The metadata associated with the NFT.

metadataVerificationKeyHash

Field = Field

The hash of the verification key used for metadata proofs.

name

Field = Field

The name of the NFT.

oracleAddress

PublicKey = PublicKey

The oracle address to link the NFT update with the network and accounts state

owner

PublicKey = PublicKey

The owner of the NFT.

storage

Storage = Storage

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

version

UInt32 = UInt32

The version number of the NFT state.

Returns

NFTState

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).constructor

Properties

approved

approved: PublicKey = PublicKey;

Defined in: packages/nft/src/interfaces/types.ts:190

The approved address of the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).approved

context

context: NFTTransactionContext = NFTTransactionContext;

Defined in: packages/nft/src/interfaces/types.ts:205

The transaction context of the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).context

creator

creator: PublicKey = PublicKey;

Defined in: packages/nft/src/interfaces/types.ts:203

The public key of the creator of the NFT (readonly).

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).creator

immutableState

immutableState: NFTImmutableState = NFTImmutableState;

Defined in: packages/nft/src/interfaces/types.ts:184

The immutable state of the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).immutableState

isPaused

isPaused: Bool = Bool;

Defined in: packages/nft/src/interfaces/types.ts:198

Indicates whether the NFT contract is currently paused.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).isPaused

metadata

metadata: Field = Field;

Defined in: packages/nft/src/interfaces/types.ts:192

The metadata associated with the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).metadata

metadataVerificationKeyHash

metadataVerificationKeyHash: Field = Field;

Defined in: packages/nft/src/interfaces/types.ts:200

The hash of the verification key used for metadata proofs.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).metadataVerificationKeyHash

name

name: Field = Field;

Defined in: packages/nft/src/interfaces/types.ts:186

The name of the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).name

oracleAddress

oracleAddress: PublicKey = PublicKey;

Defined in: packages/nft/src/interfaces/types.ts:207

The oracle address to link the NFT update with the network and accounts state

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).oracleAddress

owner

owner: PublicKey = PublicKey;

Defined in: packages/nft/src/interfaces/types.ts:188

The owner of the NFT.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).owner

storage

storage: Storage = Storage;

Defined in: packages/nft/src/interfaces/types.ts:194

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

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).storage

version

version: UInt32 = UInt32;

Defined in: packages/nft/src/interfaces/types.ts:196

The version number of the NFT state.

Inherited from

Struct({
  / The immutable state of the NFT. /
  immutableState: NFTImmutableState,
  / The name of the NFT. /
  name: Field,
  / The owner of the NFT. /
  owner: PublicKey,
  / The approved address of the NFT. /
  approved: PublicKey,
  / The metadata associated with the NFT. /
  metadata: Field,
  / The off-chain storage information (e.g., IPFS hash). /
  storage: Storage,
  / The version number of the NFT state. /
  version: UInt32,
  / Indicates whether the NFT contract is currently paused. /
  isPaused: Bool,
  / The hash of the verification key used for metadata proofs. /
  metadataVerificationKeyHash: Field,

  / The public key of the creator of the NFT (readonly). /
  creator: PublicKey, // readonly
  / The transaction context of the NFT. /
  context: NFTTransactionContext, // readonly
  / The oracle address to link the NFT update with the network and accounts state /
  oracleAddress: PublicKey, // readonly
}).version

Methods

assertEqual()

static assertEqual(a: NFTState, b: NFTState): void

Defined in: packages/nft/src/interfaces/types.ts:214

Asserts that two NFTState instances are equal.

Parameters

a

NFTState

The first NFTState instance.

b

NFTState

The second NFTState instance.

Returns

void


fromNFTState()

static fromNFTState(params: {
  address: PublicKey;
  context: NFTTransactionContext;
  creator: PublicKey;
  nftState: NFTStateStruct;
  oracleAddress: PublicKey;
  tokenId: Field;
 }): NFTState

Defined in: packages/nft/src/interfaces/types.ts:233

Creates a new NFTState from an NFTStateStruct and other parameters.

Parameters

params

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

address

PublicKey

context

NFTTransactionContext

creator

PublicKey

nftState

NFTStateStruct

oracleAddress

PublicKey

tokenId

Field

Returns

NFTState

A new NFTState instance.