Given an image, in any file format, when you add it to IPFS (ipfs add
), you get a content
ID like "qm1"
Given an image, POST it to Infura or Piñata, and get back its IPFS content ID (should be familiar if you're used to using AWS S3 buckets).
Let's say you have a JSON file with the following metadata:
{
image_cid: "qm1",
name: "Cool Sword Bro",
description: "This sword is super cool, wow",
}
When you add this to IPFS, you will get some IPFS content id like "qm2"
Each token has the following fields:
part of the NEP4 standard:
- id (auto-incremented)
- owner (a NEAR account)
extra, arterra-only stuff:
- group id
Could look into how OpenSea wants metadata returned and ensure that NFTs are returned in this format.
In addition to specific tokens, you have an "NFT group". Each NFT group has:
- id (auto-incremented)
- creator (a NEAR account)
- metadata cid (not guaranteed to be unique for different NFT Groups)
- max supply
- minted supply
When minting an NFT:
- Must provide
group_id
- Check that
env::predecessor_account_id
is NFT Group'screator
OR in a list of admins - Check that
minted_supply
is less thanmax_supply
- Make calls to Infura/Piñata to upload image & other metadata, get cid (content ID) of the final JSON file for the metadata
- Make a call to NEAR to mint this, passing in that cid
- Make call to NEAR to fetch NFT or NFT group
- Make call to Infura/Piñata to load content with returned metadata cids