Mint an NFT on Arbitrum
A step-by-step guide to implementing cross-chain NFT minting using the Execution API. This guide shows how to enable users to mint NFTs on any chain using funds from any supported source.
Prerequisites
Ensure you have the following:
- An Aarc API key from the developer dashboard
- Basic understanding of blockchain transactions and NFT smart contracts
- The NFT contract address and ABI of the collection you want to mint from
You need to get your NFT contract address whitelisted with Aarc. Contact our support team to request whitelisting.
Setup
- Create a new project directory and initialize it:
- Install required dependencies:
- Create a
.env
file with your Aarc API key:
- Create an
index.js
file for your implementation:
Implementation Steps
Setup Environment
First, set up your development environment with the necessary configurations:
Generate Mint Call Data
Before getting the deposit address, generate the calldata for the NFT mint:
The deposit address generated will be active only for 30 minutes.
Get Deposit Address
Get a deposit address with the NFT minting details:
Users must send the exact amount specified in the deposit instructions. Sending less than the required amount will result in a failed transaction.
Handle User Deposit and Monitor Mint
After getting the deposit address, handle the user deposit and monitor the minting process:
Error Handling
Handle NFT-specific errors in addition to standard bridge errors:
Complete Example
For the complete implementation, including utility functions and more detailed error handling, check out our example repository.
For additional support or questions, refer to our support.