How to send multiple transactions from a single wallet address to a single wallet?

I have just installed the Cardano Node and CLI to play with it and followed some instructions at How to run cardano-node | Cardano Developer Portal.

I guess what Im trying to find out is how to do this in command line in one go:

  • Send 10 tADA from Wallet 1 to Wallet X
  • Send 10 tADA from Wallet 1 to Wallet X
  • Send 10 tADA from Wallet 1 to Wallet X
  • Send 10 tADA from Wallet 1 to Wallet X
    .
    .
  • Send 10 tADA from Wallet 1 to Wallet X

It’s like sending multiple same amount of ADA from a single Wallet 1 to a single Wallet X. Obviously you cannot do that with Yoroi or Daedalus.

You can use cardano-cli transaction build with multiple --tx-out. Your --tx-in(s) must cover the sum of all --tx-out(s) + fees.

1 Like

Thanks but do you have a sample to code? I’ve been following the tutorial but couldn’t find how to do it the way I want it.

Sure, how about this …

Note, I only use transaction build-raw because of the metadata part (at least I think that is why transaction build does not work). In your case transaction build might work just fine, so you would not have to compute fees+refund

2 Likes

Can I see a sample content of the $TX_IN1 variable?

Every --tx-in is a reference to a UTxO that you get from cardano-cli query utxo ... of the form …

"TxHash#TxIx"

1 Like

Thanks man I think I finally understand how to build --tx-in, --tx-out and calculate fees! :slight_smile:

Is there any cardano-cli function that I can use to automatically grab the TxHash, TxIx, and Amount? Or do i really need to build a custom script for that?

  cardano-cli query utxo \
    --testnet-magic $TESTNET_MAGIC \
    --address $addr

Yes I know that but what I mean is to get only the values I need like the TxHash , TxIx , and Amount so i don’t need to manually extract them the above command you just posted.

No matter what data source you use, the thing that builds your Tx will have to do some sort of utxo parsing either from txt as above or from json if you use wallet or blockfrost. I guess that is an integral part of the layer above cardano-cli.

1 Like