2023-01-30 03:21:37 +00:00
|
|
|
const Wrapper = artifacts.require("CurioERC1155Wrapper");
|
|
|
|
|
|
|
|
module.exports = async (callback) => {
|
2023-01-30 03:28:42 +00:00
|
|
|
const nftId = parseInt(process.argv[6]);
|
|
|
|
console.log(`Querying metadata for ID: ${nftId}`);
|
2023-01-30 03:21:37 +00:00
|
|
|
|
|
|
|
const wrapper = await Wrapper.deployed();
|
|
|
|
|
2023-01-30 03:28:42 +00:00
|
|
|
const dataURI = await wrapper.uri(nftId);
|
2023-01-30 03:21:37 +00:00
|
|
|
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();
|
|
|
|
}
|