Of course! Here we go.
Scenario:
cardano-cli query utxo --address $(cat /home/alessio/cardano-my-node/offline/cold-keys/payment/payment.addr) --mainnet
TxHash TxIx Amount
--------------------------------------------------------------------------------------
2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9 0 1960309531 lovelace + TxOutDatumNone
a28873de50c0edb6a24e294c27a7cb7f3e28d08fbc5432f218be52d5a7f768a1 0 1000000 lovelace + TxOutDatumNone
- Destination wallet from Yoroi:
1) Get the current slot
Current Slot: 107271590
2) Set the amount to lovelace
amountToSend: 1960309531
( it is my whole pledge showed above )
3) Set the destination address
destinationAddress: addr1q8zufyywk0p7uue2jnth23r65ahz3d9pzl74qhs672cmnelh3wg2kjswmapxdemq43rccp9jz4y97ydtutccy798382sp584ar
( pasted from Yoroi showed above )
4) Find your balance and UTXOs
( already showed above but I repeat it again, adding an echo of tx_in variable )
2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9 0 1960309531 lovelace + TxOutDatumNone
a28873de50c0edb6a24e294c27a7cb7f3e28d08fbc5432f218be52d5a7f768a1 0 1000000 lovelace + TxOutDatumNone
TxHash: 2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9#0
ADA: 1960309531
tx_in option means --tx-in 2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9#0
TxHash: a28873de50c0edb6a24e294c27a7cb7f3e28d08fbc5432f218be52d5a7f768a1#0
ADA: 1000000
tx_in option means --tx-in 2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9#0 --tx-in a28873de50c0edb6a24e294c27a7cb7f3e28d08fbc5432f218be52d5a7f768a1#0
Total available ADA balance: 1961309531
Number of UTXOs: 2
5) Run the build-raw transaction command.
cardano-cli transaction build-raw \
--tx-in 2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9#0 \ <-- took from the previous output
--tx-out $(cat /home/alessio/cardano-my-node/offline/cold-keys/payment/payment.addr)+0 \
--tx-out addr1q8zufyywk0p7uue2jnth23r65ahz3d9pzl74qhs672cmnelh3wg2kjswmapxdemq43rccp9jz4y97ydtutccy798382sp584ar+0 \ <-- yoroi wallet
--invalid-hereafter $(( 107271590 + 10000)) \
--fee 0 \
--out-file tx.tmp
6) Calculate the current minimum fee:
fee=$(cardano-cli transaction calculate-min-fee \
--tx-body-file tx.tmp \
--tx-in-count 1 \
--tx-out-count 2 \
--mainnet \
--witness-count 1 \
--byron-witness-count 0 \
--protocol-params-file params.json | awk '{ print $1 }')
echo fee: $fee
it gives the output:
fee: 176765
7) Calculate your change output.
I wanna move all the ADA calculating the fee, so:
$ echo "1960309531-176765" | bc -l
1960132766
I wrote this then
txOut=$((1960309531-176765-1960132766))
echo Change Output: ${txOut}
it gives:
Change Output: 0
8) Build your transaction.
cardano-cli transaction build-raw \
--tx-in 2fe4ed7176a40be687d57ca1ced253231b0b712cc871e5a4baa295753e16ebe9#0 \
--tx-out $(cat /home/alessio/cardano-my-node/offline/cold-keys/payment/payment.addr)+0 \
--tx-out addr1q8zufyywk0p7uue2jnth23r65ahz3d9pzl74qhs672cmnelh3wg2kjswmapxdemq43rccp9jz4y97ydtutccy798382sp584ar+1960132766 \
--invalid-hereafter $(( 107271590 + 10000)) \
--fee 176765 \
--out-file tx.raw
9) Sign the transaction with the payment secret key.
cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file /home/alessio/cardano-my-node/offline/cold-keys/payment/payment.skey \
--mainnet \
--out-file tx.signed
10) Send the signed transaction.
cardano-cli transaction submit \
--tx-file tx.signed \
--mainnet
it gives:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (BabbageOutputTooSmallUTxO [((Addr Mainnet (KeyHashObj (KeyHash "d8ddd3b4508596e0012fab5ed5810faba94314aa7c2d8e9db0036e34")) (StakeRefBase (KeyHashObj (KeyHash "d3d2966bd44716a338fa15d65bd1b3f767dcbb2ba68dd20eb194753a"))),MaryValue 0 (MultiAsset (fromList [])),NoDatum,SNothing),Coin 961130)]))])
If you see some stupid error feel free to insult me ahahah!
I just wanna move my ADA to Yoroi