Creating and Minting NFTs on the Arbitrum Blockchain has never been easier. This guide will show you how to create and mint NFTs on Arbitrum using Crossmint.
By the end, you will learn how to:
- Create and Deploy an NFT Collection on Arbitrum using an API
- Create and mint NFTs on Arbitrum using the Mint API.
- Create and mint NFTs with No-code.
This guide will take you 10 mins to complete (approximately).
Let's get started!
Table of Contents:
- Create and Mint NFTs with No-code
- Setup
- Create an NFT Collection on Arbitrum
- Create and Mint NFTs on Arbitrum
- Conclusion
- What's Next?
- Need Help?
Create and Mint NFTs with No-code
Using Crossmint, you can create NFT collections, NFTs, and mint NFTs without needing to write any code. While the no-code feature for creating NFT collections and NFTs is not yet available for Arbitrum, it is supported on other chains.
Below is an in-depth guide that will teach you how to create and mint NFTs without any coding required.
Setup
In order to create and mint NFTs on Arbitrum using Crossmint, we need to first understand the difference between staging and production environments, creating an API Key, and declaring the scopes necessary for the API key to perform the required operations.
Difference between Staging and Production
There are two different environments, they are staging and production environments.
The staging environment serves as a test environment, this works with the blockchain's testnet, mimicking the production setup without affecting the live version. It's accessible via https://staging.crossmint.com and allows you to deploy and test the features in a risk-free setting.
The production environment, found at https://www.crossmint.com, is where the live, user-facing application resides. Changes here are public and have real-world implications.
Creating a Developer Account and API Key
Now let's create an API key. This step is crucial as it allows your application to call Crossmint's APIs.
Follow these steps:
- Create a Developer Account: Before you proceed, make sure that you have a Crossmint developer account. If not, please sign up - Crossmint Console.
- Navigate to API Keys Section: Log into Crossmint's Console and navigate to "Developers" section and click on "API Keys".
- Choose the Type of API Key: Opt for a Server-side API Key required for operations like NFT collection creation or minting.
- Select Scopes: Select scopes that determine the API key’s access level. Essential scopes include:
- "nfts.create"
- "nfts.read"
- "collections.create"
- "collections.update"
- "collections.read"
You need the scopes specified above to create NFT Collections and create NFTs.
Create an NFT Collection on Arbitrum
Before you proceed to creating and minting NFTs, you need to create an NFT Collection. Let's walk through the steps to accomplish this using Crossmint's API.
Prepare Your Collection's Metadata
The first step is to define the characteristics of your NFT collection. This includes the name, image URL representing the collection, a description, and the collection symbol (for EVM only). Here's an example of how to prepare this metadata:
const collectionMetadata = {
chain: "arbitrum", // Specify 'arbitrum' for the Arbitrum blockchain
metadata: {
name: "Arbitrum Collection", // Your collection's name
imageUrl: "https://www.example.com/collection-image.png", // URL of the collection's representative image
description: "A collection of NFTs on Arbitrum.", // Description of your collection
symbol: "tst" // Collection symbol (EVM chains only)
},
fungibility: "non-fungible", // Specify whether the collection is non-fungible or semi-fungible
supplyLimit: 1000, // The maximum number of NFTs in the collection
payments: {
price: "0.01", // Price per NFT in the native currency
recipientAddress: "0xYourWalletAddress" // Your wallet address to receive payments
},
reuploadLinkedFiles: true // Indicates if URLs in metadata should be reuploaded to IPFS
};
Here, we have a JavaScript object "collectionMetadata" housing the configuration for our collection. Adjust these fields as per your collection's specifics.
Make sure to replace the placeholders ("https://www.example.com/collection-image.png" and "0xYourWalletAddress") with your actual collection image URL and recipient wallet address.
Create the NFT Collection
Now that we have our collection's metadata defined, we need to make a POST request to the Crossmint API to create the NFT collection.
const axios = require('axios'); // Ensure you have axios installed
const createCollection = async (metadata) => {
const API_URL = "https://www.crossmint.com/api/2022-06-09/collections/";
const API_KEY = "your_api_key_here"; // Replace with your actual Crossmint API key
try {
const response = await axios.post(API_URL, metadata, {
headers: {
"X-API-KEY": API_KEY,
},
});
console.log("Collection created successfully:", response.data);
return response.data; // This includes the collection ID and action ID
} catch (error) {
console.error("Failed to create collection:", error.response.data);
}
};
createCollection(collectionMetadata).then((data) => {
console.log("Created Collection ID:", data.id);
console.log("Deployment Action ID:", data.actionId);
});
In this step, we're sending a POST request with our collection data and including our API key in the request headers for authentication. Upon success, we log the response data.
Verify Deployment Status
After calling the Crossmint API to create the NFT Collection, you can verify whether it has been deployed successfully on the blockchain. You can do this by polling for the status of the deployment action using the action ID returned in the previous step.
const ACTION_ID = "your_action_id_here"; // Replace with your actual action ID
const checkDeploymentStatus = async (actionId) => {
const API_URL = `https://www.crossmint.com/api/2022-06-09/actions/${actionId}`;
try {
const response = await axios.get(API_URL, {
headers: {
"X-API-KEY": API_KEY,
},
});
console.log("Deployment Status:", response.data.status);
return response.data.status; // This is the status of your collection's deployment
} catch (error) {
console.error("Failed to check deployment status:", error.response.data);
}
};
checkDeploymentStatus(ACTION_ID).then((status) => {
if (status === "success") {
console.log("Your collection has been deployed successfully!");
}
});
Replace "your_action_id_here" with the actual action ID you received from creating the collection. This script will check the status of the deployment and log whether it has been successfully deployed to the blockchain.
Following these steps will successfully create your NFT collection on Arbitrum using the Crossmint API. The collection is now ready for minting NFTs, which we will cover in the next section.
Create and Mint NFTs on Arbitrum
Now, we need to create and mint NFTs on the Arbitrum blockchain using the Crossmint API. Assuming that you have already created the NFT Collection, let's proceed.
Mint an NFT on the Created Collection
To mint an NFT, you will use the collection ID of the collection you created. You'll specify metadata for your NFT, which includes a name, image, and description, and the recipient information.
First, ensure you have the "collectionId" from the collection creation step. Then, prepare your NFT metadata and recipient details. Here's how you can do it in JavaScript:
const axios = require('axios');
const apiKey = 'YOUR_CROSSMINT_API_KEY';
const collectionId = 'YOUR_COLLECTION_ID'; // Replace with your actual collection ID
const nftMetadata = {
name: "Crossmint Example NFT",
image: "https://www.crossmint.com/assets/crossmint/logo.png",
description: "My NFT created via the mint API!"
};
const recipient = "email:testy@crossmint.io:arbitrum"; // Example recipient format
axios.post(`https://www.crossmint.com/api/2022-06-09/collections/${collectionId}/nfts`, {
recipient,
metadata: nftMetadata
}, {
headers: {
'X-API-KEY': apiKey
}
})
.then(response => {
console.log("Mint Response:", response.data);
})
.catch(error => {
console.error("Error minting NFT:", error);
});
In this code snippet, replace "YOUR_CROSSMINT_API_KEY" with your actual API key obtained from the Crossmint Console and also replace "YOUR_COLLECTION_ID" with the collection ID you received from creating your NFT collection.
The recipient in this example uses an email and chain format, but you can replace it with a direct wallet address if preferred. Replace the email address with the target email address that you want to mint the NFT to.
Verify the NFT was Minted Using the Action ID
After calling Crossmint's Mint API, you'll receive an actionId in the response. You can use this ID to check the status of the NFT mint. Below is how you can poll for the minting status:
const actionId = 'YOUR_ACTION_ID_FROM_MINTING'; // Replace with your actual action ID
const checkMintingStatus = () => {
axios.get(`https://www.crossmint.com/api/2022-06-09/actions/${actionId}`, {
headers: {
'X-API-KEY': apiKey
}
})
.then(statusResponse => {
console.log("Minting Status:", statusResponse.data);
if(statusResponse.data.status !== 'completed') {
console.log("Minting in progress, check back later.");
} else {
console.log("Minting completed successfully.");
}
})
.catch(error => {
console.error("Error checking minting status:", error);
});
}
// Initial check
checkMintingStatus();
// Optionally, set an interval to poll periodically
// setInterval(checkMintingStatus, 60000); // Check every 60 seconds
Replace "YOUR_ACTION_ID_FROM_MINTING" with the action ID you received from the minting response. This script first makes an immediate check on the minting status and logs the result. Optionally, you can enable the "setInterval" line to have it check periodically until the minting is confirmed as completed.
Conclusion
In this guide, we explored the steps necessary to create and mint NFTs on Arbitrum, starting with creating an API key with the appropriate scopes to creating an NFT collection and minting NFTs within that NFT Collection.
And that's it! You have now learned how to create NFT Collections, and how to create and mint NFTs on Arbitrum using Crossmint.
What's Next?
If you are wondering how Crossmint has helped enterprises and brands by powering their NFT Drops, you can click on the link below to read all our Case Studies.
If you want to learn how to use the Crossmint to create Web 3 Wallets for your users using their Email Address, please watch the YouTube video below.
Need help?
For support, please join the official Crossmint Discord Server. You can also use Crossmint Help Page for the same.