CAVYAR

CAVYAR AI

Verify Creator with Umi

Verify Creator
Verify
Verified Creator

A creator whose verified flag is false could have been added by anyone and, therefore, cannot be trusted. On the other hand, a creator whose verified flag is true is guaranteed to have signed a transaction that verified them as a creator of that asset.

import { mplTokenMetadata, verifyCreatorV1, } from "@metaplex-foundation/mpl-token-metadata"; import { generateSigner, publicKey } from "@metaplex-foundation/umi"; import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; const umi = createUmi("https://api.mainnet-beta.solana.com", "processed").use( mplTokenMetadata() ); const metadata = publicKey("YourMetadataAccount"); // Address of the NFTs metadata account const creator = generateSigner(umi); // The creator we are trying to verify as a Signer. await verifyCreatorV1(umi, { metadata, authority: creator, }).sendAndConfirm(umi);

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 the creator of an NFT (Non-Fungible Token) asset using the Umi framework in Solana. Here's what the code does:

  1. It imports necessary modules from the "@metaplex-foundation/mpl-token-metadata" and "@metaplex-foundation/umi" packages.

  2. It creates an instance of Umi by calling the createUmi function with the Solana API endpoint and the network environment ("processed" in this case).

  3. The mplTokenMetadata function is used to enable the MPL (Metaplex) token metadata extension for the Umi instance.

  4. The publicKey function is called with the address of the NFT's metadata account to obtain the public key of the metadata account.

  5. The generateSigner function is called with the Umi instance to generate a signer for the creator.

  6. The verifyCreatorV1 function is called with the Umi instance and an object containing the metadata account and the creator authority.

  7. The sendAndConfirm method is called on the result of verifyCreatorV1 to send and confirm the transaction using the Umi instance.

In summary, the code verifies the creator of an NFT asset by checking if the creator's authority has been verified using the Umi framework in Solana.

Ask

Soon™

Created by:

Axax...GsG2

Give this snippet a feedback!

Published on

April 24, 2025

Want to support the author?