Skip to content

Instantly share code, notes, and snippets.

@roybotbot
Created August 7, 2022 19:21
Show Gist options
  • Save roybotbot/045167389a0cf32cc14027c15412677c to your computer and use it in GitHub Desktop.
Save roybotbot/045167389a0cf32cc14027c15412677c to your computer and use it in GitHub Desktop.
Very simple script - takes data from .csv file and makes the mint commands.
#!/bin/bash
# roybot Minter v0.1
# Edit the following values for the mint. Be sure to triple check your edits.
csv_file="mint_data.csv" # Filename of csv file in the same directory as this minting script.
# ---- DO NOT EDIT BELOW THIS LINE ---
# Problem: on macOS .csv files don't have a newline so the bash script doesn't read the last row of the .csv. Manually opening the .csv file in a plaintext editor and adding a new line and saving it fixes this.
# Attemptes at solving .csv newline issue:
#[ -n "$(tail -c1 file)" ] && echo >> $csv_file
# sed -i''-e $a\ mint_data.csv
#sed -i ' ' '$a\
#' $csv_file
# sed -i'' -n $csv_file
# -----
total_mint_quantity=$(wc -l < $csv_file) # Total number of NFTs that will be minted
echo "Total number to mint: " $(($total_mint_quantity - 1))
{
read
while IFS=, read -r number wallet_fingerprint wallet_id royalty_address target_address file_hash file_uri metadata_hash metadata_uri license_hash license_uri edition_count edition_number fee royalty_percentage; do
echo "NFT #: "$number
chia wallet nft mint -f $wallet_fingerprint -i $wallet_id -ra $royalty_address -ta $target_address -nh $file_hash -u $file_uri -mh $metadata_hash -mu $metadata_uri -lh $license_hash -lu $license_uri -m $fee -rp $royalty_percentage
sleep 75
done
} < $csv_file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment