Hello guy im create a site when someone can mint their own nft, so I have the problem with the ID for the .json, I don’t know how to proceed, need I store an object call id and every time someone want to create a nft I do + 1 in the id ? but how to create the object with a id without always set to 0 because everyone will have id 1 ?
my js =>
async function createJsonFile() {
//let id = ?;
let file_name = (“0000000000000000000000000000000000000000000000000000000000000000” + id).slice(-64);
let name = document.getElementById(“name”).value;
let description = document.getElementById(“description”).value;
let image = currentUser.get(‘nft_picture’);
console.log(image);
let metadata = {
name: name,
description: description,
image: image
};
const metadata_file = new Moralis.File(file_name + “.json”, {base64 : btoa(JSON.stringify(metadata))});
//currentUser.set(‘nft_metadata’, metadata_file);
//metadata_file.save();
}
thank you for ur help