Hi guys, i’ve retired my pool, i get back the 500 ADA.
Yesterday tried to send back the ada from the stake address to my yoroi wallet, but i got this error:
this is the stake address: stake1u9g74srl3hkfjtnxdfzl997xpq0snytj9mr7395d29mp04grkt8r0
i’ve done a transaction with this size of lovelance: 1486886455, so i should be able to do it and pay the transaztion fee.
Can someone explain me why is not working?
I’ve just tried again removing the tx-out as suggested here:
but it gives me this: Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (ValueNotConservedUTxO (MaryValue (Coin 1487066455) (MultiAsset (fromList []))) (MaryValue (Coin 1487058732) (MultiAsset (fromList []))))))])
Greetings Simone, Apologies for the inconvenience. I’ve forwarded this to our development team to take a look at. One thing you can try in the meantime is to just be sure the wallet is in sync. You can do this by heading to Settings > Wallet > Resync, and retry. This could remedy the issue. Please let me know if it does not while I await their reply.
So, that all has nothing to do with Yoroi, but with how you build the transaction with cardano-cli.
Without seeing the commands it’s a bit hard to guess what exactly went wrong there.
The first error is that one of the outputs was too small which is surprising if you want to move everything including the 500 ADA deposit over to the Yoroi wallet.
The second error is that the sum of the inputs is slightly different than the sum of the outputs. So, maybe you did not recalculate the output value after calculating the fee?
cardano-cli query utxo \
--address $(cat payment.addr) \
--mainnet > fullUtxo.out
tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
cat balance.out
tx_in=""
total_balance=0
while read -r utxo; do
type=$(awk '{ print $6 }' <<< "${utxo}")
if [[ ${type} == 'TxOutDatumNone' ]]
then
in_addr=$(awk '{ print $1 }' <<< "${utxo}")
idx=$(awk '{ print $2 }' <<< "${utxo}")
utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
total_balance=$((${total_balance}+${utxo_balance}))
echo TxHash: ${in_addr}#${idx}
echo ADA: ${utxo_balance}
tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
fi
done < balance.out
txcnt=$(cat balance.out | wc -l)
echo Total available ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}
cb69a180b10a2a7525dc73d0e24ae0edc71e7158149fa743a2b501bb779df913 0 1487066455 lovelace + TxOutDatumNone
TxHash: cb69a180b10a2a7525dc73d0e24ae0edc71e7158149fa743a2b501bb779df913#0
ADA: 1487066455
Total available ADA balance: 1487066455
Number of UTXOs: 1
That you still use --tx-out-count 2 although you only have one output left will lead to a fee that is a little more than necessary.
You don’t even use what you are calculating here in:
You should use something like amountToSend=$((${total_balance}-${fee})) to calculate the correct amount that should go on the only output before building the transaction.
I am not a big fan of these copy and paste guides that help so little in understanding what is happening there.
If you just want to send everything on your pool address addr1q9ktqu85xr7hnmt9heczclcpnaazrsth0xn4hc3ehlz9dvj3atq8lr0vnyhxv6j972tuvzqlpxghytk8aztg65tkzl2sf5yvay to your Yoroi address addr1q946anf8fee9tajfw0h7ulh6r9935psa4uzh467zntx86uwj9jnglwap04ass6xzessaf3h38yagkd6l0nnwwj5f5knqd83llr, there is an even simpler way:
You just look up all UTxOs on the source address. The code you executed already did that, but you could also do a plain cardano-cli query utxo --mainnet --address addr1q9ktqu85xr7hnmt9heczclcpnaazrsth0xn4hc3ehlz9dvj3atq8lr0vnyhxv6j972tuvzqlpxghytk8aztg65tkzl2sf5yvay or just look it up on an explorer like https://adastat.net/addresses/addr1q9ktqu85xr7hnmt9heczclcpnaazrsth0xn4hc3ehlz9dvj3atq8lr0vnyhxv6j972tuvzqlpxghytk8aztg65tkzl2sf5yvay. All lead to the same result: There is a single UTxO that you want to spend: cb69a180b10a2a7525dc73d0e24ae0edc71e7158149fa743a2b501bb779df913#0