NFTAdmin
Hierarchy
- unknown
- NFTAdmin
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
Returns NFTAdmin
Properties
admin
The public key of the contract's administrator. This account has the authority to perform administrative actions such as pausing the contract or upgrading the verification key.
allowChangeRoyalty
A boolean flag indicating whether the contract has the ability to change the royalty fee.
allowChangeTransferFee
A boolean flag indicating whether the contract has the ability to change the transfer fee.
canBePaused
A boolean flag indicating whether the contract has the ability to be paused. This allows for disabling the pause functionality if desired.
events
Contract events emitted during various operations.
Type declaration
ownershipChange: typeof OwnershipChangeEvent
Emitted when ownership of the contract changes.
pause: typeof PauseEvent
Emitted when the contract is paused.
resume: typeof PauseEvent
Emitted when the contract is resumed.
upgradeVerificationKey: any
Emitted when the verification key is upgraded.
isPaused
A boolean flag indicating whether the contract is currently paused.
When true
, certain operations are disabled.
Methods
canChangeBaseUri
Determines if the base URI can be changed for a Collection.
Parameters
baseUri: Field
Returns Promise<Bool>
canChangeCreator
Determines if the creator can be changed for a Collection.
Parameters
creator: PublicKey
Returns Promise<Bool>
canChangeName
Determines if the name can be changed for a Collection.
Parameters
name: Field
Returns Promise<Bool>
canChangeRoyalty
Determines if the royalty fee can be changed for a Collection.
Parameters
royaltyFee: UInt32
Returns Promise<Bool>
canChangeTransferFee
Determines if the transfer fee can be changed for a Collection.
Parameters
transferFee: UInt64
Returns Promise<Bool>
canChangeVerificationKey
Parameters
vk: VerificationKey
address: PublicKey
tokenId: Field
Returns Promise<Bool>
canMint
Determines whether minting is allowed for the given request. Returns mint parameters if allowed, or none if not allowed.
Parameters
mintRequest: MintRequest
The minting request details.
Returns Promise<MintParamsOption>
A
MintParamsOption
indicating if minting is permitted.
canPause
Determines if the collection can be paused.
Returns Promise<Bool>
canResume
Determines if the collection can be resumed.
Returns Promise<Bool>
canSetAdmin
Determines if the admin contract can be changed for a Collection.
Parameters
admin: PublicKey
Returns Promise<Bool>
canTransfer
Determines whether a transfer between the specified addresses is permitted.
Parameters
transferEvent: TransferEvent
The transfer event details.
Returns Promise<Bool>
A
Bool
indicating whether the transfer is allowed.
canUpdate
deploy
Deploys the contract with initial settings.
Parameters
props: NFTAdminDeployProps
Deployment properties including admin, upgradeAuthority, uri, canPause, and isPaused.
Returns Promise<void>
ensureOwnerSignature
Ensures that the transaction is authorized by the contract owner.
Returns Promise<AccountUpdate>
A signed
AccountUpdate
from the admin.
pause
Pauses the contract, disabling certain administrative actions. Can only be called by the admin if
canPause
istrue
.Returns Promise<void>
resume
Resumes the contract, re-enabling administrative actions. Can only be called by the admin if
canPause
istrue
.Returns Promise<void>
transferOwnership
Transfers ownership of the contract to a new admin.
Parameters
to: PublicKey
The public key of the new owner.
Returns Promise<PublicKey>
The public key of the previous owner.
upgradeVerificationKey
Upgrades the contract's verification key after validating with the upgrade authority.
Parameters
vk: VerificationKey
The new verification key to upgrade to.
Returns Promise<void>
The NFTAdmin contract serves as the foundational administrative layer for NFT collections on the Mina Protocol. It provides essential functionalities such as contract upgrades, pausing and resuming operations, and ownership management. This contract can be extended by custom admin contracts to implement specific administrative logic, ensuring flexibility while maintaining a standardized interface.