Skip to content

Commit

Permalink
added counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Brord van Wierst committed Jul 7, 2023
1 parent f29ce74 commit bdf9093
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ async function run() {
i + NUM_NFTS_MINTED_PER_TRANSACTION,
);

console.log(`Minting ${chunk.length} NFTs...`);
console.log(
`Minting ${chunk.length} NFTs... (${
i + chunk.length
}/${NFT_COLLECTION_SIZE})`,
);
const prepared = await account.prepareMintNfts(chunk);
const transaction = await prepared.send();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_immutable_metadata(index: int, issuer_nft_id: str) -> str:

while nft_mint_params:
chunk, nft_mint_params = nft_mint_params[:NUM_NFTS_MINTED_PER_TRANSACTION], nft_mint_params[NUM_NFTS_MINTED_PER_TRANSACTION:]
print(f'Minting {len(chunk)} NFTs...')
print(f'Minting {len(chunk)} NFTs... ({NFT_COLLECTION_SIZE-len(nft_mint_params)}/{NFT_COLLECTION_SIZE})')
prepared = account.prepare_mint_nfts(chunk)
transaction = prepared.send()

Expand Down
9 changes: 7 additions & 2 deletions sdk/examples/how_tos/nft_collection/01_mint_collection_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ async fn main() -> Result<()> {
})
.collect::<Vec<_>>();

for nft_mint_params in nft_mint_params.chunks(NUM_NFTS_MINTED_PER_TRANSACTION) {
println!("Minting {} NFTs...", nft_mint_params.len());
for (index, nft_mint_params) in nft_mint_params.chunks(NUM_NFTS_MINTED_PER_TRANSACTION).enumerate() {
println!(
"Minting {} NFTs... ({}/{})",
nft_mint_params.len(),
index * NUM_NFTS_MINTED_PER_TRANSACTION + nft_mint_params.len(),
NFT_COLLECTION_SIZE
);
let transaction = account.mint_nfts(nft_mint_params.to_vec(), None).await?;
wait_for_inclusion(&transaction.transaction_id, &account).await?;

Expand Down

0 comments on commit bdf9093

Please sign in to comment.