⛏️mintNFT

Description

The mintNFT function allows for the creation of a new NFT (non-fungible token) using the Metaplex library and returns the newly created NFT

Parameter

ParameterTypeDescription

privateKey

string

Private key of the user's account

uri

string

URI of the NFT

nftName

string

Name of the NFT

nftSymbol

string

Symbol of the NFT

Response

PropertyTypeDescription

uri

string

URI of the created NFT

name

string

Name of the created NFT

symbol

string

Symbol of the created NFT

publicKey

string

Public key of the user's account

metadata

string

Metadata of the created NFT including its image

Example Request and Response

Prerequisites

Before making requests with NEST® SDK, you must have it installed.

You can install NEST® SDK using either npm or yarn. Use the following commands to install NEST® SDK:

npm install @nest25/solana-lib
OR
yarn add @nest25/solana-lib

Request

Here is an example of how to make a mintNFT request using the NEST® SDK:

// import Nest SDK
import { Solana } from '@nest25/solana-lib';

// create a new instance of the SDK
const Sol = new Solana();

async function main() {
  // mint NFT and receive the mint address
  let receipt = await Sol.mintNFT(
    'your-private-key',
    'https://gateway.pinata.cloud/ipfs/QmXA4C9ywuHeS425pJVd5sCLRP4oQgoPTsNdeRpDQizR6d?_gl=1*t4k2m9*_ga*MTYyMDQ1NTgwNC4xNjc4NDI2ODQ1*_ga_5RMPXG14TE*MTY3ODQzODc2Ni40LjAuMTY3ODQzODc4My40My4wLjA',
    'Harsh',
    'BHATT',
  );
  console.log(receipt.mintAddress);
}

main();

Response

 PublicKey [PublicKey(EtfzPGmMjfm2dQRuwemFtheMX2zCHr7FAdkv6gtaFBC1)] 

Use Cases

  • Digital Art Marketplaces: Digital art marketplaces can leverage this function to create NFTs for digital artworks.

  • Gaming Platforms: Gaming platforms can utilize the mintNFT function to create NFTs for in-game items, virtual assets, and collectibles.

  • Music and Media Industry: The music and media industry can make use of the mintNFT function to create NFTs for unique digital assets such as songs, videos, and other digital content.

Last updated