# Mint a NFT With Image and Metadata In 1 Transaction

To use this method, you need an [idexo API key](https://docs.idexo.com/get-api-key).&#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](https://docs.idexo.com/master), 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="../get-api-key">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
}
```
