Code Snippets
Different ways to token gate
NFT Ownership
User owns 2 ERC721 NFTs
curl -X POST https://api.3mint.io/api/v1/tokenGate
-H "Content-Type: application/json"
-H "X-API-KEY: [YOUR_API_KEY]"
-d '{"walletAddress": "0x958fb436dB50DB2F689C364712113cc226b38151",
"chain": "ethereum",
"network": "mainnet",
"requirements": [
{
"type": "erc721",
"contractAddress": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
"minBalance": 2,
"maxBalance": 2
}
]
}'import axios from 'axios';
// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/tokenGate';
var requestOptions = {
method: 'POST',
url: `${url}`,
headers: {
'Content-Type': 'application/json',
'X-API-KEY': `${apiKey}`
},
data: {
'walletAddress': '0x958fb436dB50DB2F689C364712113cc226b38151',
'chain': 'ethereum',
'network': 'mainnet',
'requirements': [
{
'type': 'erc721',
'contractAddress': '0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D',
'minBalance': 2,
'maxBalance': 2
},
]
}
};
axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));User owns at least 1 ERC1155 with a specific token ID
User owns multiple ERC721 NFTs from different collections
User owns 1 ERC721 NFT for at least 6 months and 10 days
User owns 1 ERC721 NFT since the beginning of 2022
User owns 1 ERC721 NFT with specific metadata attributes
Token Ownership
Address owns at least 2 WETH
Address has held at least 2 WETH for 30 days
Coin Ownership
Address owns at least 2.5 ETH
Combos
User owns 5 ETH or 2 WETH plus 1 to 4 ERC721 NFTs
Last updated