# mintNFT

## Description

The `mintNFT` function is designed to facilitate the minting of non-fungible tokens (NFTs) on the Casper blockchain network. It takes user inputs to create and send a transaction to the network for minting the NFT

## Parameters

<table><thead><tr><th>Parameter</th><th width="156">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The RPC API endpoint of the Casper blockchain network</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The private key of the wallet that will be used to mint the NFT</td></tr><tr><td><code>metadata</code></td><td>object</td><td>The metadata of the NFT that is being minted</td></tr></tbody></table>

## Response

| Property  | Type   | Description                                     |
| --------- | ------ | ----------------------------------------------- |
| `tokenId` | string | The unique identifier of the minted NFT         |
| `txHash`  | string | The transaction hash of the minting transaction |

## 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/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `mintNFT` request using the Volary SDK:

```javascript
// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();

// set testnet variables
const testPrivateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // metadata for nft
  const metadata = {
    name: 'Bored Ape Mango',
    description: 'Bored Ape Mango DESCRIPTION',
    image: 'img',
    royalty: '40',
  };
  // mint free nft
  const result = await casper.mintNFT(RPC_API, testPrivateKey, metadata);
  console.log(result);
}
// call main function
main();
```

### Response

```sh
 {
        tokenId: '164298',
        txHash: '0e65c21af14e52ecf426b46cad8df84940ab7c4a05e6c5e41eb993c855b7defc'
}
```

## Use Cases

* **Digital Art Marketplaces:** The function can be used by digital art marketplaces to mint NFTs for the artworks that are being sold on their platforms.
* **Gaming Industry:** The function can be used by the gaming industry to mint NFTs for in-game items and assets, which can be traded and sold on various marketplaces.
* **Collectibles:** The function can be used by collectibles platforms to mint NFTs for various types of collectibles, such as sports cards, rare coins, and other memorabilia.


---

# 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/casper-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.
