🚀 A simple and efficient tool for minting NFTs through Magic Eden's API with support for multiple chains.
✅ Multi-Chain Support - Ethereum, Arbitrum, Base, Monad Testnet
✅ Gas Estimation - Accurate gas cost calculation before minting
✅ Transaction Monitoring - Real-time transaction confirmation tracking
✅ Error Handling - Comprehensive error messages and troubleshooting tips
| Network | Chain ID | Currency | Status |
|---|---|---|---|
| Ethereum Mainnet | 1 | ETH | ✅ |
| Arbitrum | 42161 | ETH | ✅ |
| Base | 8453 | ETH | ✅ |
| Monad Testnet | 10143 | MON | ✅ |
- Clone the repository
git clone https://github.com/dickifatma/MagicEden-Auto-Mint-NFT
cd MagicEden-Auto-Mint-NFT- Install dependencies
npm install ethers dotenv readline axios-
Create environment file .env.example // Delete .example
-
Configure your
.envfile
# Required: Your wallet private key
PRIVATE_KEY=your_private_key_here
# RPC URLs for different networks
RPC_URL_ETH_MAINNET=
RPC_URL_ARBITRUM=
RPC_URL_BASE=
RPC_URL_MONAD=magic-eden-mint-executor/
├── index.js # Main execution script
├── magiceden.js # Magic Eden API wrapper
├── .env.example # Environment template
├── package.json # Dependencies
└── README.md # Documentation
- Run the script
node index.js- Select network
🔗 Available chains:
1. Monad-Testnet
2. Arbitrum
3. Ethereum Mainnet
4. Base
Select chain (1 - 4): 3
- Enter contract address
📋 Enter contract address: - Specify mint amount
📦 How many to mint (default 1): 🔗 Available chains:
1. Monad-Testnet # Free testnet tokens
2. Arbitrum # Lower gas fees
3. Ethereum Mainnet # Main network
4. Base # Coinbase L2| Error | Cause | Solution |
|---|---|---|
PRIVATE_KEY not found |
Missing environment variable | Add PRIVATE_KEY to .env |
RPC URL not found |
Missing RPC configuration | Add RPC URLs to .env |
Invalid contract address |
Wrong format | Use 0x... format |
Insufficient balance |
Not enough funds | Add more ETH/tokens |
No mint steps found |
Mint not active | Check if mint is live |
Gas estimation failed |
Network issues | Retry or use default gas |
💡 INSUFFICIENT FUNDS:
- Add more ETH to your wallet
- Check if you have enough for mint cost + gas fees💡 NONCE ISSUE:
- Try again, transaction might have been replaced💡 RPC CONNECTION:
- Check your internet connection
- Verify RPC URL in .env
- Try different RPC provider- Never share your private key
- Use testnet for testing
- Keep .env file secure
- Don't commit private keys to git
Make sure your .gitignore includes:
.env
node_modules/
- Add network configuration
const networkNames = {
10143: 'monad-testnet',
42161: 'arbitrum',
1: 'ethereum',
8453: 'base',
// Add new network
137: 'polygon'
};- Add currency symbol
const getCurrencySymbol = (chain) => {
switch (chain) {
case 'monad-testnet': return 'MON';
case 'polygon': return 'MATIC';
default: return 'ETH';
}
};- Add RPC URL to .env
RPC_URL_POLYGON=# Use Monad testnet for free testing
Select chain (1 - 4): 1
# Get testnet tokens from faucet
# Test with small amounts first# Start with small amounts
📦 How many to mint (default 1): 1
# Always verify contract address
# Check gas prices during high activityMIT License - see LICENSE file for details.
- Fork the repository
- Create feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -am 'Add new feature') - Push to branch (
git push origin feature/new-feature) - Create Pull Request
- 🐛 Issues: GitHub Issues
- 📧 Email: dickifatma.dev@gmail.com
⭐ Star this repo if it helped you!