Skip to content

Commit

Permalink
metadata generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
encody committed Aug 10, 2021
1 parent 79663a0 commit 35c2678
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions generate_metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const [, , tokenId, recipientName, cohort, distinction] = process.argv;

if (!tokenId) {
console.log(
'usage: node generate_metadata.js <tokenId> <recipient_name> <cohort> <distinction>',
);
return;
}

const metadata = {
name: 'Web3T3 Certificate',
description:
'Web3 Teacher Training Track Certificate of Completion, issued by the Blockchain Acceleration Foundation',
external_url: 'https://certificates.web3.courses/certificate/' + tokenId,
image: 'https://certificates.web3.courses/images/icon.png',
attributes: [
{
trait_type: 'Recipient',
value: recipientName,
},
{
trait_type: 'Cohort',
display_type: 'number',
value: +cohort,
},
{
trait_type: 'Issue Date',
display_type: 'date',
value: Date.now(),
},
{
trait_type: 'Distinction',
value: distinction,
},
],
};

console.log(JSON.stringify(metadata));

0 comments on commit 35c2678

Please sign in to comment.