Skip to content

Data Objects

Don Kackman edited this page Aug 17, 2022 · 3 revisions

Description of Data Objects That Get Passed Around

NFT

mintingInfo

Information needed by nft_mint-nft. Only wallet_id and 'target_address` are required.

{
  wallet_id: 0,
  target_address: '',
  royalty_address: '',
  edition_number: 1,
  edition_total: 1,
  royalty_percentage: 0,
  did_id: '',  
  fee: 0,
}

ipfsData

This is the output of the minter's upload function and is passed to createNftFromIpfs. createNftFromIpfs can also be called directly for a pre-existing ipfs folder. dataUris, hash, meta_uris, and meta_hash are required.

{
  dataUris: [],
  hash: '',
  meta_uris: [],
  meta_hash: '',
  license_uris: [],
  license_hash: '',
}

fileInfo

Used to point to and describe part of an NFT. All fields are required.

{
  name: '',
  type: '',     // the MIME type of the file
  filepath: ''  // local full filesystem path to the file
};

licenseFileInfo

Used to point to and describe the NFT license. type and one of filepath or uri are required.

{
  type: '',     // the MIME type of the license file
  filepath: '', // if present this will be upload with the NFT
  uri: ''       // otherwise the license can point to a URI
};

collectionMetadata

The data structure used to describe the NFT and optionally its collection. Since id is a uuid, for a series NFT the collection should be generated once and reused for each createNftMetadata call.

{
  name: '',
  id: '',     // a uuid - will be auto-populated by createCollecitonMetadata
  attributes: [ { type: '', value: '' } ]
}

metadata

The data structure used to describe the NFT and optionally its collection.

{
  format: 'CHIP-0007',  // auto-populated by createNftMetadata
  name: '',
  description: '',
  minting_tool: 'chia-repl', // auto-populated
  sensitive_content: false,
  attributes: [ { trait_type: 'trait', value: 'value' } ],
  collection: {
    name: '',
    id: '',     // a uuid - will be auto-populated by createCollecitonMetadata
    attributes: [ { type: '', value: '' } ]
  }
}