NFT
Hierarchy
- unknown
- NFT
Index
Constructors
constructor
Returns NFT
Properties
events
Events emitted by the NFT contract.
Type declaration
approve: any
pause: typeof PauseEvent
resume: typeof PauseEvent
transfer: typeof OwnershipChangeEvent
update: typeof UpdateEvent
upgradeVerificationKey: typeof UpgradeVerificationKeyEvent
metadata
The metadata associated with the NFT (Field
).
metadataVerificationKeyHash
The hash of the verification key used for metadata proofs (Field
).
name
The name of the NFT (Field
).
packedData
A packed field containing additional NFT data and flags (Field
).
storage
Holds off-chain storage information, e.g., IPFS hash (Storage
).
Methods
approveAddress
Transfers ownership of the NFT from one user to another.
Parameters
approved: PublicKey
The public key of the approved address (
PublicKey
).
Returns Promise<PublicKey>
The public key of the owner (
PublicKey
).
getState
Returns Promise<NFTStateStruct>
pause
Pauses the NFT, disabling certain actions.
Returns Promise<PublicKey>
An owner public key to be checked by the Collection contract
resume
Resumes the NFT, re-enabling actions.
Returns Promise<PublicKey>
An owner public key to be checked by the Collection contract
transfer
Transfers ownership of the NFT from one user to another.
Parameters
params: TransferExtendedParams
The parameters for the transfer (
TransferExtendedParams
).
Returns Promise<TransferExtendedParams>
The public key of the old owner (
PublicKey
).
update
Updates the NFT's state with provided proofs and permissions.
Parameters
input: NFTState
The current state of the NFT (
NFTState
).output: NFTState
The desired new state of the NFT (
NFTState
).creator: PublicKey
The public key of the creator (
PublicKey
).
Returns Promise<Field>
The hash of the metadata verification key (
Field
).
upgradeVerificationKey
Upgrades the verification key used by the NFT contract.
Parameters
vk: VerificationKey
The new verification key (
VerificationKey
).
Returns Promise<UpgradeVerificationKeyData>
An owner public key to be checked by the Collection contract and the Boolean flag indicating if the owner's authorization is required
The NFT Contract represents an individual NFT within a collection.
It manages the state and behavior of a single NFT, including ownership, metadata, storage, pricing, and permissions. The contract provides functionality for updating NFT properties with proofs and permissions, transferring ownership, selling and buying NFTs, upgrading the verification key, and pausing or resuming the NFT.