You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to mint NFT with the same commands that worked before successfully, but now I am getting Command failed: transaction build Error: Non-Ada assets are unbalanced:
cardano-cli query utxo --address $(cat $ADDRESS) --testnet-magic 1097911063 --out-file utxo-1.json
# Get utxo 0
TXIN=$(jq -r 'keys[0]' utxo-1.json)# Get lovelace value
LOVELACE_TXIN=$(jq -r ".[\"$TXIN\"].value.lovelace" utxo-1.json)# output lovelace (it should be smaller as than utxo value)
LOVELACE_TXIN_DV3=$(expr $LOVELACE_TXIN / 3)# Sot number 100000 slot in the future to give time for our NFT to be minted
SLOTNUMBER=$(expr $(cardano-cli query tip --testnet-magic 1097911063 | jq .slot) + 100000)# Generate hash using the policy verification key, this will be used in the minting policyexport KEYHASH=$(cardano-cli address key-hash --payment-verification-key-file $VKEY)# script name
SCRIPT=policy.script
cat <<EOF > $SCRIPT{ "type": "all", "scripts": [ { "type": "before", "slot": $SLOTNUMBER }, { "type": "sig", "keyHash": "$KEYHASH" } ]}EOF# Script policy ID
POLICICYID=$(cardano-cli transaction policyid --script-file $SCRIPT)# Asset/NFT name export ASSET_NAME="TEST02"# Encode Asset name to HEXexport ASSET_ENC=$(echo -n $ASSET_NAME| basenc --base16 | awk '{print tolower($0)}')echo"Asset name '$ASSET_NAME' encoded as base16: '$ASSET_ENC'"
cardano-cli transaction build \
--testnet-magic 1097911063 \
--alonzo-era \
--tx-in $TXIN \
--tx-out $(cat $ADDRESS)+$LOVELACE_TXIN_DV3+"$TOKENAMOUNT$NFT" \
--change-address $(cat $ADDRESS) \
--mint="$TOKENAMOUNT$SUBJECT" \
--minting-script-file $SCRIPT \
--metadata-json-file $METAFILE \
--invalid-hereafter $SLOTNUMBER \
--witness-override 2 \
--out-file matx.raw
Ok I needed to put the already existing NFT on tx output.
My question is, I thought this is automated once I specify the change address? I should get back whatever exists on the UTXO (ADA change and TOKEN change)
I am trying to mint NFT with the same commands that worked before successfully, but now I am getting
Command failed: transaction build Error: Non-Ada assets are unbalanced:
Error
Command failed: transaction build Error: Non-Ada assets are unbalanced: 221670712 lovelace + 1 286bcf642f7db2247af480fda886c5e783a226c4ac5f316b63464f46.43435954 + 1 39df0587057f77075064fcea7c262d16ac50dc0283f2f1f9e82ebdd9.43727970746f20436174616c797374202d2041444120506f6f6c
Versions:
The text was updated successfully, but these errors were encountered: