# listNFT

## Description

The `listNFT` function is used to list a non-fungible token (NFT) for sale on a decentralized marketplace.&#x20;

It takes in various parameters, including the blockchain on which the NFT exists, the user's private key for that blockchain, the ID of the token, the price at which it is to be sold, the duration of any bidding period (if applicable), whether it is being listed for auction, and the address of the NFT contract.<br>

## Parameters

| Name              | Type    | Description                                                     |
| ----------------- | ------- | --------------------------------------------------------------- |
| `blockchain`      | string  | The blockchain on which the NFT exists.                         |
| `privateKey`      | string  | The private key of the user making the listing.                 |
| `tokenId`         | string  | The ID of the NFT to be listed.                                 |
| `price`           | string  | The price at which the NFT is to be listed.                     |
| `biddingDuration` | string  | The duration of any bidding period (if applicable), in seconds. |
| `forAuction`      | boolean | Whether the NFT is being listed for auction.                    |
| `nftAddress`      | string  | The address of the NFT contract.                                |

## Response

| Name      | Type   | Description                                                        |
| --------- | ------ | ------------------------------------------------------------------ |
| `code`    | number | The status code of the response (1 for success, 0 for failure).    |
| `receipt` | string | The transaction hash of the listing transaction on the blockchain. |
| `error`   | string | The error message if the operation fails.                          |

## Example Request and Response

### Prerequisites&#x20;

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:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `listNFT` request using the NO.AI SDK:

```jsx
const {NftMarketPlace} = require('@nest25/evm-chains-lib')
// create instance of SOULBOUND
const nftMarketPlace = new NftMarketPlace();
const privateKey = "your private key here"
// nft contract address
let nftContract = '0xaa223c2379daf21526925a07fe466fad7269103a';

const main = async () => {
    // list nft
    const contract = await nftMarketPlace.listNFT(
        'klay', 
        privateKey,
        "1",
        "1",
        "0",
        false,
        nftContract
    );
    // print result
    console.log(contract);
}
main()
```

### Response

```jsx
 
```

## Use Cases

* **Crypto Wallets:** The function can be used by crypto wallets to allow their users to list their NFTs for sale on decentralized marketplaces.
* **Online Marketplaces:** The function can be used by online marketplaces to create a decentralized marketplace for NFTs.
* **NFT Platforms:** The function can be used by NFT platforms to allow their users to sell their NFTs on third-party marketplaces.
