Skip to content

Commit 4e1d1f9

Browse files
committed
update for previously minted checks
1 parent ba3e633 commit 4e1d1f9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

utils/nftport/mint.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ const path = require("path");
33
const basePath = process.cwd();
44
const fs = require("fs");
55

6-
const AUTH = 'YOUR API KEY HERE';
7-
const CONTRACT_ADDRESS = 'YOUR CONTRACT ADDRESS HERE';
8-
const MINT_TO_ADDRESS = 'YOUR WALLET ADDRESS HERE';
6+
// const AUTH = 'YOUR API KEY HERE';
7+
// const CONTRACT_ADDRESS = 'YOUR CONTRACT ADDRESS HERE';
8+
// const MINT_TO_ADDRESS = 'YOUR WALLET ADDRESS HERE';
9+
const AUTH = '7073fd40-9443-4f5f-8eac-ba9030b7051a';
10+
const CONTRACT_ADDRESS = '0x862b11c9d9ed5e566d41ffa848cbcfdefcd183db';
11+
const MINT_TO_ADDRESS = '0xB7422Da1890Ce24309b4670792a1D5E5A6D32F38';
912
const CHAIN = 'rinkeby';
1013
const TIMEOUT = 1000; // Milliseconds. This a timeout for errors only. If there is an error, it will wait then try again. 5000 = 5 seconds.
1114

@@ -20,11 +23,14 @@ async function main() {
2023

2124
for (const meta of ipfsMetas) {
2225
const mintFile = `${basePath}/build/minted/${meta.custom_fields.edition}.json`;
23-
26+
2427
try {
2528
fs.accessSync(mintFile);
26-
const meta = JSON.parse(mintFile)
27-
if(meta.mintData.response !== "OK") throw 'not minted'
29+
const mintedFile = fs.readFileSync(mintFile)
30+
if(mintedFile.length > 0) {
31+
const mintedMeta = JSON.parse(mintedFile)
32+
if(mintedMeta.mintData.response !== "OK") throw 'not minted'
33+
}
2834
console.log(`${meta.name} already minted`);
2935
} catch(err) {
3036
try {

0 commit comments

Comments
 (0)