Mint token with more than 2 txin?

I have experienced minting token with more than 2 txout. But while minting several tokens, I had the different txin in one UTXO. How can I combine these to make transactions?
it can be fixed by “sed or awk command” in the “UXTO output” to make mutiple line --tx-in
Thanks in advance.


you can define more txin param during minting:
--tx-in ${in_addr}#${idx} --tx-in ${in_addr2}#${idx2}

Thanks very much.
But Can I make this dynamically not static?

As you know, UTXO creates many Txhash whenever building transactions.
it could be better to use string filter command such as “sed, awk or other commands” to make --tx-in dynamically. Hope you can help me.
Thanks .

there is a snippet which collects all txin:

cardano-cli query utxo \
    --address $(cat payment.addr) \
    --mainnet > fullUtxo.out

tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out

cat balance.out

while read -r utxo; do
    in_addr=$(awk '{ print $1 }' <<< "${utxo}")
    idx=$(awk '{ print $2 }' <<< "${utxo}")
    utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
    echo TxHash: ${in_addr}#${idx}
    echo ADA: ${utxo_balance}
    tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
done < balance.out
txcnt=$(cat balance.out | wc -l)
echo Total ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}

cardano-cli transaction build-raw \
    ${tx_in} \

from this guide:

You are great!
I really appreciate you. Thanks very much.
I wonder how you are such kind and expert!

1 Like

Can you please answer me “invalid-hereafter problem”?

I am not an expert just read lot of issues here in the forum… and learning from it:)

I have been developing Android and Web applications for many years, but new in the blockchain.
Hope we can cooperate each other in the future.
please don’t hesitate to contact me if you need my help. :slight_smile:

Thanks! good to know! hope you will find this project suitable for your ideas.

May I ask what --witness-count flag in cardano-cli transaction is?

yes - how many signing keys will be used to sign the transaction.

In common, I used to build one sign key, it is my private address key created by rsa i know

yes, there are other transactions - like pool registration - which needs different singing keys to able to sign it. but for token minting only the signing key of the payment address is needed.

Thanks for your kind explaination.
How can I get transaction id or token detail url after minting native token?

no problem!

I think it is better to open a new topic for this!

Ok. thank you