Now, the on-chain metadata contains an optional collection field.
This points to a struct which contains two fields:
- verified: has the collection's update authority verified the collection?
- key: the address of the collection account
6/ This means you can easily query for all NFTs in a collection by calling getProgramAccounts.
The code is basically the same as querying for the NFTs associated with a specific Candy Machine.
But instead of filtering by the first creator (the CM), you filter by the collection.
7/ One last thing to note about collections—they're actually NFTs.
That is, the "key" field we saw above is the mint address of the collection NFT.
Basically, it looks like this 👇
8/ 🍄🍄🍄 TOKEN STANDARDS 🍄🍄🍄
Alright, onto the next new field: token_standard.
Simply put, this field tells you what type of token the metadata is for.
E.g., is this metadata for an NFT? Or is it for a non-fungible token?
9/ It's important to know this information, because different types of tokens have different metadata.
One interesting thing is that Metaplex is standardizing the idea of a "fungible asset."
These are fungible tokens that have extensive metadata and supply >= 0.
10/ As a quick example, USDC is a regular fungible token.
A sword in a video game would be a fungible asset, because it has more extensive metadata (e.g. how many damage points the sword does).
11/ 🍄🍄🍄 TOKEN USES 🍄🍄🍄
Finally, let's look at the last new field: uses.
This points to a struct that contains three fields:
- use_method (one of Burn, Multiple, and Single)
- remaining—how many more times can this method be used
- total—how many uses are allowed in total
12/ This field is particularly relevant for games.
For example, maybe an in-game asset like a potion can only be used 3 times.
With this new field, games can track that information on-chain.
13/ This was just a short overview—if you want to learn more, head to the docs!
Lastly, if you have any questions, feel free to ping me 😛
Here's a diagram that shows all the different parts of a Solana transaction.
More details below 👇
1/ Each Solana transaction contains a message, and the first part of each message is its header.
The header is simple, it just contains the numbers described in the diagram.
2/ The next part of the transaction message is an array of accounts. They are ordered based on whether they require a signature and whether they are writable.
This array also contains the addresses of the programs used by the instructions.
1/ Here's a thread of all the Solana threads I've written (a thread of threads), plus some great threads/tweets by other folks. I'll try to keep adding onto this in the future.
First, 11 resources to get started with Solana development