# Mint a NFT With Image and Metadata In 1 Transaction

To use this method, you need an [idexo API key](/get-api-key.md).&#x20;

You also need to have the address of an XXX contract deployed, the address you are minting to, the path to the image, the name, description, and attributes for the NFT that will be minted. You will need to specify the blockchain network the NFT collection is on, i.e. one of the following supported networks:

* avalanche
* bnbchain
* dogechain
* ethereum
* fantom
* polygon

Assuming you have [installed the SDK](/master.md), you can use the following code in your file (instructions on modifying it follows):

```javascript
const ido = require('idexo-sdk')
ido.Multi.mintNFTWithImage(apiKey, network, contractAddress, addressToMintTo, image, nftName, nftDescription, attributes)
.then(res => console.log(res.data))
```

#### Parameters

<table><thead><tr><th width="185">Name</th><th width="111">Data Type</th><th width="113">Optional</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>string</td><td>required</td><td>see here on how to get an <a href="/pages/-MVIAS35PB3yZxHyVL-W">API key</a></td></tr><tr><td>network</td><td>string</td><td>required</td><td>see above for valid networks</td></tr><tr><td>contractAddress</td><td>string</td><td>required</td><td>deployed contract address</td></tr><tr><td>addressToMintTo</td><td>string</td><td>required</td><td>valid EVM address</td></tr><tr><td>image</td><td>string</td><td>required</td><td>can be 1) image file path, 2) URL, or 3) base64 string</td></tr><tr><td>nftName</td><td>string</td><td>required</td><td></td></tr><tr><td>nftDescription</td><td>string</td><td>required</td><td></td></tr><tr><td>attributes</td><td>json</td><td>optional</td><td>must be an array. Example: [ { "trait_type": "color", "value": "blue" } ]</td></tr><tr><td>options</td><td>object</td><td>optional</td><td>set metadata storage option (default "arweave"). ex. { metadataStorage: "filecoin" }</td></tr></tbody></table>

#### Example

```javascript
const ido = require('idexo-sdk')

const image = "https://blog.idexo.io/wp-content/uploads/2021/02/cropped-Logo-dark.png"
const attributes =[ { "trait_type": "color", "value": "blue" } ]
const options = { metadataStorage:"filecoin" } 

ido.Multi.mintNFTWithImage(
  apiKey, 
  "polygon", 
  "0x51BB9B9cCdF04af385b8356F41e20140bAdF80a0", 
  "0x3448a183da142bc6eccfdc690572dfe2d276ddfa", 
  image, "nftName", "nftDescription", attributes, options
).then(res => console.log(res.data))
// Valid Response
// res.data => 
{
      message: 'ido_sdk',
      error: null,
      data: {
        network: 'polygon',
        function_name: 'mintWithImage',
        args: [
          '0x51BB9B9cCdF04af385b8356F41e20140bAdF80a0',
          '0x3448a183da142bc6eccfdc690572dfe2d276ddfa',
          'nftName',
          'nftDescription',
          [Array]
        ],
        tx_hash: '0x16e80e4fc91ac2eec909cda9ad124b7590bac44be4ca16ed60e151ba5ae4075b',
        tx_status: false,
        tx_group: 'collection',
        sender: '0x8142409931f554d99013de129cdDc70EA016d62d',
        nonce: 12702,
        tx_id: '82304090-8cab-11ed-80da-fd24f00cf799',
        metadataUri: 'https://arweave.net/xtQEsAyWKEb1Hjov36d4ojlFVkXa9i2MOooF6WI3OS4'
      },
      code: 200
}
```


---

# 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.idexo.com/nft/mint-a-nft-with-image-and-metadata-in-1-transaction.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.
