In response to my 2nd question, the Metadata will already be already included within the PNG files from that line of code you show? So I could just upload the image created onto Opensea and the metadata will also be uploaded too?
Ah okay! Still trying to wrap my head around the smart contracts, a lot more complicated than uploading each file one by one on Opensea :S
As you can see the metadata files will be generated under the metadata folder.
You can run this little javascript to update the meta data
constfetch=require('node-fetch');// Update [ADD_CONTRACT_ADDRESS] to your Contract AddressconstOPENSEA_URI='https://api.opensea.io/asset/ADD_CONTRACT_ADDRESS';// Maximum Tokens Belonging to ContractconstMAX_TOKENS=3349;// update OPENSEA_URIfunctionrefreshData(tokenId){constURI=`${OPENSEA_URI}/${tokenId}/?force_update=true`;constOPTIONS={method:'GET'};fetch(URI,OPTIONS).then(res=>res.json()).then(json=>{if(json.detail){console.log(`failed: ${tokenId}`);}elseif(json.token_id){console.log(`success: ${tokenId}`);}}).catch(err=>console.error(`failed: ${tokenId}`));};constrefreshTokens=(start,end)=>{Array.from({length:end-start+1},(x,i)=>start+i).forEach((tokenId)=>{refreshData(tokenId);});}letstart=0;letend=1;constid=setInterval(()=>{refreshTokens(start,end);if(end>MAX_TOKENS)clearInterval(id);start=end+1;end=start+1;},2000);
Sorry to keep asking questions! There is a lot to learn.
What do I put in here:
IMAGES_BASE_URI = "ADD_IMAGES_BASE_URI_HERE"
I'm still a little confused as to what to do after creating the PNG and Metadata files. Do I need to upload these onto IPFS and then upload that to Opensea? Or if I upload the PNG files directly to Opensea it would automatically do it for me?
This is where you store your images for public views. It can be used when creating your smart contract.
Hope this gives you enough hint. I'm working on a web app to generate pixelated nft arts at the moment so I don't have much time to explain things in much details. I would create a new blog post for creating ERC721 Token and nft in the near future.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for your quick reply! :)
In response to my 2nd question, the Metadata will already be already included within the PNG files from that line of code you show? So I could just upload the image created onto Opensea and the metadata will also be uploaded too?
Ah okay! Still trying to wrap my head around the smart contracts, a lot more complicated than uploading each file one by one on Opensea :S
As you can see the metadata files will be generated under the metadata folder.
You can run this little javascript to update the meta data
`
Check this article out for more details about metadata
docs.opensea.io/docs/2-adding-meta...
Hope it helps.
Great thanks!
Sorry to keep asking questions! There is a lot to learn.
What do I put in here:
IMAGES_BASE_URI = "ADD_IMAGES_BASE_URI_HERE"
I'm still a little confused as to what to do after creating the PNG and Metadata files. Do I need to upload these onto IPFS and then upload that to Opensea? Or if I upload the PNG files directly to Opensea it would automatically do it for me?
This is where you store your images for public views. It can be used when creating your smart contract.
Hope this gives you enough hint. I'm working on a web app to generate pixelated nft arts at the moment so I don't have much time to explain things in much details. I would create a new blog post for creating ERC721 Token and nft in the near future.