# 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

| Parameter    | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| `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

| Property    | Type   | Description                                     |
| ----------- | ------ | ----------------------------------------------- |
| `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 Volary SDK, you must have it installed.

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

```sh
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 Volary SDK:

```javascript
// 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

```sh
 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/solana-sdk/mintnft.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
