Skip to main content

RollupNFT

RollupNFT are the NFT used in the Rollup TODO: change parameters

Hierarchy

Index

Constructors

constructor

  • new RollupNFT(params?: { address?: string | PublicKey; external_url?: string; name?: string; root?: Metadata; storage?: Storage }): RollupNFT
  • Create MinaNFT object


    Parameters

    • params: { address?: string | PublicKey; external_url?: string; name?: string; root?: Metadata; storage?: Storage } = {}

      arguments

    Returns RollupNFT

Properties

optionaladdress

address?: PublicKey

Public key of the NFT

optionalexternal_url

external_url?: string

External URL of the NFT

isSomeMetadata

isSomeMetadata: boolean = false

Boolean if there is some metadata

metadata

metadata: Map<string, PrivateMetadata>

metadataRoot

metadataRoot: Metadata

Root of the Merkle Map of the metadata

optionalname

name?: string

Name of the NFT

storage

storage: undefined | Storage

Storage of the NFT - IPFS (i:...) or Arweave (a:...) hash string

staticbadgeVerificationKey

badgeVerificationKey: undefined | VerificationKey

staticbadgeVerifierVerificationKey

badgeVerifierVerificationKey: undefined | VerificationKey

staticcache

cache: undefined | Cache

staticescrowVerificationKey

escrowVerificationKey: undefined | VerificationKey

staticnamesVerificationKey

namesVerificationKey: undefined | VerificationKey

staticredactedMapVerificationKey

redactedMapVerificationKey: undefined | VerificationKey

statictransferVerificationKey

transferVerificationKey: undefined | VerificationKey

staticupdateVerificationKey

updateVerificationKey: undefined | VerificationKey

staticupdaterVerificationKey

updaterVerificationKey: undefined | VerificationKey

staticverificationKey

verificationKey: undefined | VerificationKey

staticverifierVerificationKey

verifierVerificationKey: undefined | VerificationKey

Methods

publicgetMetadata

  • Gets public attribute


    Parameters

    • key: string

      key of the attribute

    Returns undefined | PrivateMetadata

    value of the attribute

publicgetMetadataRootAndMap

  • Calculates a root and MerkleMap of the publicAttributes


    Returns { map: MetadataMap; root: Metadata }

    Root and MerkleMap of the publicAttributes

publicgetURL

  • getURL(): undefined | string
  • Returns undefined | string

publicloadMetadata

  • loadMetadata(metadataURI?: undefined | string, skipCalculatingMetadataRoot?: boolean): Promise<void>
  • Load metadata from blockchain and IPFS/Arweave


    Parameters

    • metadataURI: undefined | string = undefined

      URI of the metadata. Obligatorily in case there is private metadata as private metadata cannot be fetched from IPFS/Arweave

    • skipCalculatingMetadataRoot: boolean = false

      Skip calculating metadata root in case metadataURI is not provided and NFT contains private data

    Returns Promise<void>

publicprepareCommitData

publictoJSON

  • toJSON(params?: { includePrivateData?: boolean }): object
  • Converts to JSON


    Parameters

    • params: { includePrivateData?: boolean } = {}

    Returns object

    JSON object

publicupdate

publicupdateField

publicupdateFile

publicupdateFileData

  • updateFileData(params: { data: FileData; isPrivate?: boolean; key: string; type?: string }): void
  • updates PrivateMetadata


    Parameters

    • params: { data: FileData; isPrivate?: boolean; key: string; type?: string }

      arguments

    Returns void

publicupdateImage

publicupdateMap

publicupdateMetadata

  • updates Metadata


    Parameters

    Returns void

publicupdateText

publicstaticcompile

  • compile(): Promise<VerificationKey>
  • Compiles RollupNFT MetadataUpdate contract


    Returns Promise<VerificationKey>

    verification key

publicstaticcompileBadge

  • compileBadge(): Promise<VerificationKey>
  • Compiles MinaNFTVerifierBadge contract


    Returns Promise<VerificationKey>

    verification key

publicstaticcompileEscrow

  • compileEscrow(): Promise<VerificationKey>
  • Compiles Escrow contract


    Returns Promise<VerificationKey>

    verification key

publicstaticcompileRedactedMap

  • compileRedactedMap(): Promise<VerificationKey>
  • Compiles RedactedMinaNFTMapCalculation contract


    Returns Promise<VerificationKey>

    verification key

publicstaticcompileVerifier

  • compileVerifier(): Promise<VerificationKey>
  • Compiles MinaNFTVerifier contract


    Returns Promise<VerificationKey>

    verification key

publicstaticgenerateProof

publicstaticmapFromJSON

  • mapFromJSON(json: object): Map<string, string>
  • Creates a Map from JSON


    Parameters

    • json: object

      json with map data

    Returns Map<string, string>

    map as JSON object

publicstaticsetCache

  • setCache(cache: Cache): void
  • Sets a cache for prover keys


    Parameters

    • cache: Cache

    Returns void

publicstaticsetCacheFolder

  • setCacheFolder(folder?: string): void
  • Sets a cache folder for prover keys


    Parameters

    • folder: string = "./cache"

      folder for prover keys default is "./cache"

    Returns void

publicstaticstringFromField

  • stringFromField(field: Field): string
  • Converts a Field to a string


    Parameters

    • field: Field

      Field to convert

    Returns string

    string

publicstaticstringFromFields

  • stringFromFields(fields: Field[]): string
  • Converts a Field[] to a string


    Parameters

    • fields: Field[]

      Fields to convert

    Returns string

    string

publicstaticstringToField

  • stringToField(item: string): Field
  • Converts a string to a Field


    Parameters

    • item: string

      string to convert

    Returns Field

    string as a Field

publicstaticstringToFields

  • stringToFields(item: string): Field[]
  • Converts a string to a Fields


    Parameters

    • item: string

      string to convert

    Returns Field[]

    string as a Field[]

publicstaticurlFromStorage

  • urlFromStorage(storage: Storage): string
  • Converts a Storage to a storage url string


    Parameters

    Returns string

    string

publicstaticurlFromStorageString

  • urlFromStorageString(storageStr: string): string
  • Converts a string "i:..." or "a:..." to a storage url string


    Parameters

    • storageStr: string

      string to convert

    Returns string

    string