NFTStandardUpdate

Class: NFTStandardUpdate

Properties overview

  • admin: State;
  • Overrides: SmartContract.deploy

Methods overview

  • canUpdate()
  • deploy()
  • ensureOwnerSignature()

Defined in: packages/nft/src/interfaces/update.ts:62

The NFTStandardUpdate contract is the default implementation of the NFTUpdateBase interface.

Extends

  • SmartContract

Implements

Constructors

new NFTStandardUpdate()

new NFTStandardUpdate(address: PublicKey, tokenId?: Field): NFTStandardUpdate

Defined in: node_modules/o1js/dist/node/lib/mina/zkapp.d.ts:148

Parameters

address

PublicKey

tokenId?

Field

Returns

NFTStandardUpdate

Inherited from

SmartContract.constructor

Properties

admin

admin: State<PublicKey>;

Defined in: packages/nft/src/interfaces/update.ts:66

The public key of the contract's administrator.

Methods

canUpdate()

canUpdate(
   collectionAddress: PublicKey, 
   nftAddress: PublicKey, 
   input: NFTState, 
output: NFTState): Promise<Bool>

Defined in: packages/nft/src/interfaces/update.ts:95

Checks if an NFT can be updated from its current state (input) to a new state (output).

Parameters

collectionAddress

PublicKey

The public key of the NFT collection address.

nftAddress

PublicKey

The public key of the NFT.

input

NFTState

The current state of the NFT.

output

NFTState

The desired new state of the NFT.

Returns

Promise<Bool>

A Promise resolving to a Bool indicating whether the update is permitted.

Implementation of

NFTUpdateBase.canUpdate

deploy()

deploy(props: NFTUpdateDeployProps): Promise<void>

Defined in: packages/nft/src/interfaces/update.ts:72

Deploys the contract with initial settings.

Parameters

props

NFTUpdateDeployProps

Deployment properties including admin, upgradeAuthority, uri, canPause, and isPaused.

Returns

Promise<void>

Implementation of

NFTUpdateBase.deploy

Overrides

SmartContract.deploy

ensureOwnerSignature()

ensureOwnerSignature(): Promise<AccountUpdate>

Defined in: packages/nft/src/interfaces/update.ts:87

Ensures that the transaction is authorized by the contract owner.

Returns

Promise<AccountUpdate>

A signed AccountUpdate from the admin.