3mint
  • 👋Welcome to 3mint
  • 💻3mint Platform
    • Introduction
    • Deploy a contract
    • Upload your NFT data
    • Create checkout links
    • Add customers
    • Monitor your links
  • ⌨️Developer Guides
    • Introduction
    • Contracts
      • Contract Architecture
      • End-to-end Example
    • Mint
      • How To
      • End-to-end Example
      • Code Snippets
    • Wallets
      • End-to-end Example
      • Mobile Pass
        • Creating Passes
    • Token Gating
      • End-to-end Example
      • Code Snippets
  • 📖API Reference
    • Overview
    • Contracts
      • Deploy Contract
      • Get Contract
    • Collectibles
      • Get All Templates
      • Mint Collectible
    • Wallets
      • Create Wallet
      • Get Wallet
    • Customers
      • Create Customer
      • Get Customer
      • Delete Customer
    • Claim Links
      • Create Link
      • Update Link
    • Token Gating
      • Create Gate
  • ❓FAQ
    • Web3 101
    • Platform
Powered by GitBook
On this page
  • NFT Mint
  • Minting an ERC721 NFT
  • Minting an ERC1155 NFT
  • ERC20 Airdrop
  • Minting an ERC20 token
  1. Developer Guides
  2. Mint

Code Snippets

Different ways to mint tokens

SDK Coming Soon

With the release of our SDK, you'll be able to easily integrate all features within your framework of choice.

NFT Mint

Minting an ERC721 NFT

This example mints a new ERC721 NFT and sends it directly to the specified user.

curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc721",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2",
         "quantity": 1 // How many NFTs should be minted -- must be positive integer 
       }'
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc721',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2',
    'quantity': 1 // How many NFTs should be minted -- must be positive integer 
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));

Minting an ERC1155 NFT

This example mints a new ERC1155 NFT and sends it directly to the specified user.

curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc1155",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2",
         "tokenId": "1",
         "quantity": 1 // How many NFTs should be minted -- must be positive integer 
       }'
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc1155',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x552a43cb61bc127d81b1f280bc39f62e5a51c0c2',
    'tokenId': '1',
    'quantity': 1 // How many NFTs should be minted -- must be positive integer
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));

ERC20 Airdrop

Minting an ERC20 token

This example sends an existing ERC20 token directly to the specified user.

curl -X POST https://api.3mint.io/api/v1/mint   
   -H "Content-Type: application/json"
   -H "X-API-KEY: [YOUR_API_KEY]"
   -d '{"chain": "polygon",
         "network": "mainnet",
         "type": "erc20",
         "to": "0x958fb436dB50DB2F689C364712113cc226b38151",
         "contractAddress": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
         "quantity": 1.01 // How many tokens should be sent -- must be positive float
       }'
import axios from 'axios';

// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/mint';

var requestOptions = {
  method: 'POST',
  url: `${url}`,
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': `${apiKey}`
  },
  data: {
    'chain': 'polygon',
    'network': 'mainnet',
    'type': 'erc20',
    'to': '0x958fb436dB50DB2F689C364712113cc226b38151',
    'contractAddress': '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984',
    'quantity': 1.01 // How many tokens should be sent -- must be positive float
  }
};

axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));
PreviousEnd-to-end ExampleNextWallets

Last updated 2 years ago

⌨️