Skip to main content

nft-standard-draft

Index

Type Aliases

ChainId

ChainId: keyof typeof ChainId

MetadataFieldType

MetadataFieldType: string | text | image | url | field | map | tree

The possible types for metadata fields.

NFTAdminBase

NFTAdminBase: SmartContract & { canBuy: any; canMint: any; canSell: any; canTransfer: any; canUpdate: any }

The NFTAdminBase interface defines the administrative functionalities required for managing an NFT collection on the Mina Protocol. It extends the SmartContract class and specifies methods that enforce permissions and validations for various NFT operations.

NFTAdminContractConstructor

NFTAdminContractConstructor: new (admin: PublicKey) => NFTAdminBase

Defines a constructor for contracts implementing NFTAdminBase, accepting an admin public key and returning an instance of NFTAdminBase.

@returns

An instance of NFTAdminBase.


Type declaration

    • Parameters

      • admin: PublicKey

        The public key of the contract's administrator.

      Returns NFTAdminBase

PausableContract

PausableContract: SmartContract & { pause: any; resume: any }

The PausableContract interface provides a mechanism to dynamically enable or disable certain functionalities within smart contracts. It extends the SmartContract class and introduces methods that allow a contract to be paused and resumed, which is crucial for managing emergencies, upgrades, or maintenance periods.

By implementing the PausableContract interface, contracts gain greater control over their operational states, enhancing security and flexibility in response to various scenarios.

UpgradableContract

UpgradableContract: SmartContract & { getUpgradeContract: any; upgradeVerificationKey: any }

Interface for contracts that can be upgraded. Extends SmartContract and requires methods to retrieve the associated upgrade authority contract and to upgrade the contract's verification key using the provided verification key.

UpgradeAuthorityBase

UpgradeAuthorityBase: SmartContract & { verifyUpgradeData: any }

Interface that any upgrade authority contract should implement. Extends SmartContract and requires the implementation of the verifyUpgradeData() method, which takes VerificationKeyUpgradeData as input and returns an UpgradeAuthorityAnswer.

UpgradeAuthorityContractConstructor

UpgradeAuthorityContractConstructor: new (upgradeAuthority: PublicKey) => UpgradeAuthorityBase

Defines a constructor for contracts implementing UpgradeAuthorityBase, accepting an upgradeAuthority public key and returning an instance of UpgradeAuthorityBase.


Type declaration

ValidatorDecisionType

ValidatorDecisionType: keyof typeof ValidatorDecisionType

Variables

constChainId

ChainId: { mina:devnet: Field; mina:mainnet: Field; zeko:devnet: Field; zeko:mainnet: Field } = ...

Chain IDs following Auro Wallet naming conventions.


Type declaration

  • mina:devnet: Field
  • mina:mainnet: Field
  • zeko:devnet: Field
  • zeko:mainnet: Field

constCollectionErrors

CollectionErrors: { adminContractAddressNotSet: string; cannotMint: string; cannotMintMasterNFT: string; cannotUpgradeVerificationKey: string; collectionNotPaused: string; collectionPaused: string; creatorSignatureRequiredToUpgradeCollection: string; creatorSignatureRequiredToUpgradeNFT: string; mintApprovalNotRequired: string; mintApprovalRequired: string; noPermissionToChangeBaseUri: string; noPermissionToChangeCreator: string; noPermissionToChangeName: string; noPermissionToChangeRoyalty: string; noPermissionToChangeTransferFee: string; noPermissionToPause: string; noPermissionToResume: string; noPermissionToSetAdmin: string; transferApprovalNotRequired: string; transferApprovalRequired: string; transferNotAllowed: string; updateApprovalNotRequired: string; updateApprovalRequired: string; upgradeContractAddressNotSet: string; wrongMasterNFTaddress: string } = ...

Type declaration

  • adminContractAddressNotSet: string
  • cannotMint: string
  • cannotMintMasterNFT: string
  • cannotUpgradeVerificationKey: string
  • collectionNotPaused: string
  • collectionPaused: string
  • creatorSignatureRequiredToUpgradeCollection: string
  • creatorSignatureRequiredToUpgradeNFT: string
  • mintApprovalNotRequired: string
  • mintApprovalRequired: string
  • noPermissionToChangeBaseUri: string
  • noPermissionToChangeCreator: string
  • noPermissionToChangeName: string
  • noPermissionToChangeRoyalty: string
  • noPermissionToChangeTransferFee: string
  • noPermissionToPause: string
  • noPermissionToResume: string
  • noPermissionToSetAdmin: string
  • transferApprovalNotRequired: string
  • transferApprovalRequired: string
  • transferNotAllowed: string
  • updateApprovalNotRequired: string
  • updateApprovalRequired: string
  • upgradeContractAddressNotSet: string
  • wrongMasterNFTaddress: string

constMetadataFieldTypeValues

MetadataFieldTypeValues: { field: { code: [object Object]; inputType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field; storedType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field }; image: { code: [object Object]; inputType: string; storedType: typeof Text }; map: { code: [object Object]; inputType: typeof Metadata; storedType: typeof Metadata }; string: { code: [object Object]; inputType: string; storedType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field }; text: { code: [object Object]; inputType: string; storedType: typeof Text }; tree: { code: [object Object]; inputType: typeof MetadataTree; storedType: typeof MetadataTree }; url: { code: [object Object]; inputType: string; storedType: typeof Text } } = ...

Mapping of metadata field types to their code values and associated types.


Type declaration

  • readonlyfield: { code: [object Object]; inputType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field; storedType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field }
    • readonlycode: [object Object]
    • readonlyinputType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field
    • readonlystoredType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field
  • readonlyimage: { code: [object Object]; inputType: string; storedType: typeof Text }
    • readonlycode: [object Object]
    • readonlyinputType: string
    • readonlystoredType: typeof Text
  • readonlymap: { code: [object Object]; inputType: typeof Metadata; storedType: typeof Metadata }
    • readonlycode: [object Object]
    • readonlyinputType: typeof Metadata
    • readonlystoredType: typeof Metadata
  • readonlystring: { code: [object Object]; inputType: string; storedType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field }
    • readonlycode: [object Object]
    • readonlyinputType: string
    • readonlystoredType: typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field
  • readonlytext: { code: [object Object]; inputType: string; storedType: typeof Text }
    • readonlycode: [object Object]
    • readonlyinputType: string
    • readonlystoredType: typeof Text
  • readonlytree: { code: [object Object]; inputType: typeof MetadataTree; storedType: typeof MetadataTree }
  • readonlyurl: { code: [object Object]; inputType: string; storedType: typeof Text }
    • readonlycode: [object Object]
    • readonlyinputType: string
    • readonlystoredType: typeof Text

constNFTProgram

NFTProgram: {} & { insertMetadata: (publicInput: NFTState, ...args: TupleToInstances<[typeof MetadataMap, typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field, typeof Field & (x: string | number | bigint | Field | FieldVar | FieldConst) => Field, typeof Signature]>) => Promise<{}>; merge: (publicInput: NFTState, ...args: TupleToInstances<[typeof SelfProof, typeof SelfProof]>) => Promise<{}> } = ...

Defines the NFTProgram ZkProgram with methods for updating NFT metadata.

constTEXT_TREE_HEIGHT

TEXT_TREE_HEIGHT: 20 = 20

The default height of the Merkle tree used to represent the text data.

constValidatorDecisionType

ValidatorDecisionType: { updateDatabase: Field; updateValidatorsList: Field } = ...

Validator decision types for upgrade proposals.


Type declaration

  • readonlyupdateDatabase: Field
  • readonlyupdateValidatorsList: Field

constValidatorsVoting

ValidatorsVoting: {} & { abstain: (publicInput: ValidatorsDecisionState, ...args: TupleToInstances<[typeof ValidatorsDecision, typeof PublicKey, typeof ValidatorsList]>) => Promise<{}>; merge: (publicInput: ValidatorsDecisionState, ...args: TupleToInstances<[typeof SelfProof, typeof SelfProof]>) => Promise<{}>; vote: (publicInput: ValidatorsDecisionState, ...args: TupleToInstances<[typeof ValidatorsDecision, typeof PublicKey, typeof ValidatorsList, typeof Signature]>) => Promise<{}> } = ...

The ValidatorsVoting ZkProgram implements the voting logic for validators.