RollupNFT
Hierarchy
- BaseMinaNFT
- RollupNFT
Index
Constructors
Properties
Methods
- getMetadata
- getMetadataRootAndMap
- getURL
- loadMetadata
- prepareCommitData
- toJSON
- update
- updateField
- updateFile
- updateFileData
- updateImage
- updateMap
- updateMetadata
- updateText
- compile
- compileBadge
- compileEscrow
- compileRedactedMap
- compileVerifier
- generateProof
- mapFromJSON
- setCache
- setCacheFolder
- stringFromField
- stringFromFields
- stringToField
- stringToFields
- urlFromStorage
- urlFromStorageString
Constructors
constructor
Properties
optionaladdress
Public key of the NFT
optionalexternal_url
External URL of the NFT
isSomeMetadata
Boolean if there is some metadata
metadata
metadataRoot
Root of the Merkle Map of the metadata
optionalname
Name of the NFT
storage
Storage of the NFT - IPFS (i:...) or Arweave (a:...) hash string
staticbadgeVerificationKey
staticbadgeVerifierVerificationKey
staticcache
staticescrowVerificationKey
staticnamesVerificationKey
staticredactedMapVerificationKey
statictransferVerificationKey
staticupdateVerificationKey
staticupdaterVerificationKey
staticverificationKey
staticverifierVerificationKey
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
map: MetadataMap
root: Metadata
publicgetURL
Returns undefined | string
publicloadMetadata
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
Prepare commit updates of the MinaNFT to blockchain
Parameters
commitData: RollupNFTCommit
MinaNFTPrepareCommit commit data
Returns Promise<undefined | RollupNFTCommitData>
publictoJSON
Converts to JSON
Parameters
params: { includePrivateData?: boolean } = {}
Returns object
JSON object
publicupdate
updates PrivateMetadata
Parameters
data: MinaNFTStringUpdate
MinaNFTStringUpdate update data
Returns void
publicupdateField
updates PrivateMetadata
Parameters
data: MinaNFTFieldUpdate
MinaNFTFieldUpdate update data
Returns void
publicupdateFile
updates PrivateMetadata
Parameters
data: MinaNFTFileUpdate
MinaNFTFileUpdate update data
Returns Promise<void>
publicupdateFileData
updates PrivateMetadata
Parameters
params: { data: FileData; isPrivate?: boolean; key: string; type?: string }
arguments
Returns void
publicupdateImage
updates PrivateMetadata
Parameters
data: MinaNFTImageUpdate
MinaNFTImageUpdate update data
Returns Promise<void>
publicupdateMap
updates PrivateMetadata
Parameters
data: MinaNFTMapUpdate
MinaNFTTextUpdate update data
Returns void
publicupdateMetadata
updates Metadata
Parameters
key: string
key to update
value: PrivateMetadata
value to update
Returns void
publicupdateText
updates PrivateMetadata
Parameters
data: MinaNFTTextUpdate
MinaNFTTextUpdate update data
Returns void
publicstaticcompile
Compiles RollupNFT MetadataUpdate contract
Returns Promise<VerificationKey>
verification key
publicstaticcompileBadge
Compiles MinaNFTVerifierBadge contract
Returns Promise<VerificationKey>
verification key
publicstaticcompileEscrow
Compiles Escrow contract
Returns Promise<VerificationKey>
verification key
publicstaticcompileRedactedMap
Compiles RedactedMinaNFTMapCalculation contract
Returns Promise<VerificationKey>
verification key
publicstaticcompileVerifier
Compiles MinaNFTVerifier contract
Returns Promise<VerificationKey>
verification key
publicstaticgenerateProof
Commit updates of the MinaNFT to blockchain using prepared data Generates recursive proofs for all updates, than verify the proof locally and send the transaction to the blockchain
Parameters
preparedCommitData: RollupNFTCommitData
RollupNFTCommitData commit data
verbose: boolean = false
verbose mode
Returns Promise<MinaNFTMetadataUpdateProof>
publicstaticmapFromJSON
Creates a Map from JSON
Parameters
json: object
json with map data
Returns Map<string, string>
map as JSON object
publicstaticsetCache
Sets a cache for prover keys
Parameters
cache: Cache
Returns void
publicstaticsetCacheFolder
Sets a cache folder for prover keys
Parameters
folder: string = "./cache"
folder for prover keys default is "./cache"
Returns void
publicstaticstringFromField
Converts a Field to a string
Parameters
field: Field
Field to convert
Returns string
string
publicstaticstringFromFields
Converts a Field[] to a string
Parameters
fields: Field[]
Fields to convert
Returns string
string
publicstaticstringToField
Converts a string to a Field
Parameters
item: string
string to convert
Returns Field
string as a Field
publicstaticstringToFields
Converts a string to a Fields
Parameters
item: string
string to convert
Returns Field[]
string as a Field[]
publicstaticurlFromStorage
Converts a Storage to a storage url string
Parameters
storage: Storage
Storage to convert
Returns string
string
publicstaticurlFromStorageString
Converts a string "i:..." or "a:..." to a storage url string
Parameters
storageStr: string
string to convert
Returns string
string
RollupNFT are the NFT used in the Rollup TODO: change parameters