Created
February 9, 2024 20:15
-
-
Save dmulvi/68f75d13d6fb73f2184809639555f8b1 to your computer and use it in GitHub Desktop.
Mint an NFT with Crossmint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
method: "POST", | |
headers: { | |
"X-API-KEY": "YOUR_API_KEY", | |
"Content-Type": "application/json", | |
}, | |
body: JSON.stringify({ | |
metadata: { | |
name: "Crossmint NFT #1", | |
description: "Awesome NFT #1", | |
image: "ipfs://QmVhAkiT3XCPQUaZKHootfEfixmKVqSiq5Y7uVPZyFGQXw", | |
}, | |
recipient: "email:testy@test.xyz:polygon", | |
}), | |
}; | |
const baseUrl = "https://staging.crossmint.com/api"; | |
const collectionId = "YOUR_COLLECTION_ID"; | |
fetch(`${baseUrl}/2022-06-09/collections/${collectionId}/nfts`, options) | |
.then((response) => response.json()) | |
.then((response) => console.log(response)) | |
.catch((err) => console.error(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment