Skip to content

Instantly share code, notes, and snippets.

@doingthisalright
Created May 17, 2022 22:57
Show Gist options
  • Save doingthisalright/dcc32003731661e14a83ded5da701d56 to your computer and use it in GitHub Desktop.
Save doingthisalright/dcc32003731661e14a83ded5da701d56 to your computer and use it in GitHub Desktop.
Metaplex: Generate NFT Configuration files
// Usage `node GenerateNftConfigFiles.js`
const fs = require('fs')
const totalNFTSize = 10000;
for (let index = 0; index < totalNFTSize; index++) {
const content = {
"name": `<NAME>`,
"symbol": `<SYM>`,
"seller_fee_basis_points": 500,
"image": `image.jpg`,
"properties": {
"files": [
{
"uri": `image.jpg`,
"type": "image/jpg"
}
],
"creators": [
{
"address": "<ADDRESS>",
"share": 100
}
]
},
"collection": {
"name": `<Name>`,
"family": "<Family>"
}
};
const fileName = `./assets/${index}.json`;
fs.writeFile(fileName, JSON.stringify(content, null, 2), function(err) {
if(err) {
console.log(err);
} else {
console.log("JSON saved to " + fileName);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment