Skip to content

Fix uploads mints #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jan 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update for previously minted checks
  • Loading branch information
codeSTACKr committed Dec 30, 2021
commit 4e1d1f97e4afd5c2074ff57f5de2a229eb878f8c
18 changes: 12 additions & 6 deletions utils/nftport/mint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ const path = require("path");
const basePath = process.cwd();
const fs = require("fs");

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

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

for (const meta of ipfsMetas) {
const mintFile = `${basePath}/build/minted/${meta.custom_fields.edition}.json`;

try {
fs.accessSync(mintFile);
const meta = JSON.parse(mintFile)
if(meta.mintData.response !== "OK") throw 'not minted'
const mintedFile = fs.readFileSync(mintFile)
if(mintedFile.length > 0) {
const mintedMeta = JSON.parse(mintedFile)
if(mintedMeta.mintData.response !== "OK") throw 'not minted'
}
console.log(`${meta.name} already minted`);
} catch(err) {
try {
Expand Down