# deployNFTContract

## Description

The `deployNFTContract` function is a JavaScript function that facilitates the deployment of a new NFT contract on the Casper blockchain. The function uses the CasperClient and CEP47Client libraries to create and deploy the contract on the blockchain.

## Parameters

<table><thead><tr><th>Name</th><th width="126">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>RPC_API</code></td><td>string</td><td>The URL of the RPC API for the Casper network</td></tr><tr><td><code>privateKey</code></td><td>string</td><td>The user's private key for the Casper network</td></tr><tr><td><code>contractName</code></td><td>string</td><td>The name of the NFT contract to be deployed</td></tr><tr><td><code>tokenName</code></td><td>string</td><td>The name of the NFT token</td></tr><tr><td><code>symbol</code></td><td>string</td><td>The symbol of the NFT token</td></tr><tr><td><code>metadata</code></td><td>string</td><td>The metadata for the NFT token</td></tr></tbody></table>

## Response

| Name                   | Type   | Description                                                                                  |
| ---------------------- | ------ | -------------------------------------------------------------------------------------------- |
| `contractDeployResult` | object | The contract deployment result containing the hash, contract, and other relevant information |

## Example Request and Response

### Prerequisites

Before making requests with NO.AI SDK, you must have it installed.

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

```sh
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib
```

### Request

Here is an example of how to make a `deployNFTContract` request using the NO.AI 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 privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';

async function main() {
  // contract name for nft contract
  const contractName = 'RWSCT NFT Contract';
  // token name for nft contract
  const tokenName = 'Real World Smart Contract Token';
  // token symbol for nft contract
  const symbol = 'RWSCT';
  // metadata for nft contract
  const metadata = 'name RWSCT, description NFT_Contract, image img, royalty null, royaltyReceiver null';
  // deploy nft contract
  const txHash = await casper.deployNFTContract(RPC_API, privateKey, contractName, tokenName, symbol, metadata);
  // print txHash
  console.log(`Contract hash: ${txHash.hash}`);
}
// call main function
main();

```

### Response

```sh
    {
        hash: '20366757cf99cd8bb3db1ff2bb3b515dbb1a603bfba1e8633eab7b5cd310d4e0'
    }
```

## Use Cases

* **NFT Marketplaces:** The function can be used by NFT marketplaces to deploy new NFT contracts on the Casper blockchain.
* **Individual Creators:** The function can be used by individual creators to deploy their own NFT contracts and tokens on the Casper blockchain.
* **Businesses:** The function can be used by businesses to deploy their own branded NFT contracts and tokens on the Casper blockchain for promotional and marketing purposes.
