const Wrapper = artifacts.require("CurioERC1155Wrapper"); module.exports = async (callback) => { const nftId = parseInt(process.argv[6]); console.log(`Querying metadata for ID: ${nftId}`); const wrapper = await Wrapper.deployed(); const dataURI = await wrapper.uri(nftId); console.log(`Data URI: ${dataURI}`); const data = dataURI.split(',')[1]; const raw = Buffer.from(data, "base64").toString("utf8"); console.log(JSON.stringify(JSON.parse(raw), null, 4)); console.log("Done."); callback(); }