
Verify Collection NFT with Umi
Once the Collection attribute is set on an NFT, an authority of the Collection NFT can send a Verify instruction on the Token Metadata to flip its verify attribute from false to true.

CAVYAR AI
CAVYAR AI is in its earliest stages of development and the quality of generated descriptions will improve massively over time. At this stage, there is a risk of false information being generated.
The given code snippet is used to verify a collection NFT using Umi on the Solana blockchain. Here's what the code does:
-
It imports the necessary functions and modules from the "@metaplex-foundation/mpl-token-metadata" and "@metaplex-foundation/umi" packages.
-
It creates an instance of Umi using the
createUmi
function, passing the Solana API endpoint and the network environment as parameters. ThemplTokenMetadata
function is then used to enable the Token Metadata extension for Umi. -
The
publicKey
function is used to create a public key object for the NFT's metadata account and the collection mint account. These public key objects are assigned to themetadata
andcollectionMint
variables, respectively. -
The
generateSigner
function is used to generate the authority for the collection NFT. Theumi
instance is passed as a parameter to thegenerateSigner
function, and the resulting authority is assigned to thecollectionAuthority
variable. -
The
verifyCollectionV1
function is called with theumi
instance and an object containing themetadata
,collectionMint
, andauthority
parameters. This function verifies the collection NFT by flipping its verify attribute from false to true. -
The
sendAndConfirm
method is called on the result of theverifyCollectionV1
function, passing theumi
instance as a parameter. This method sends the verify instruction to the Solana blockchain and confirms its execution.
In summary, the code verifies a collection NFT by calling the verifyCollectionV1
function with the necessary parameters and then sends and confirms the verify instruction using the sendAndConfirm
method.
Ask

Soon™