It’s a while that I’m stuck here
I’m trying to perform a simple transaction from this address, which balance looks like:
cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1097911063
TxHash TxIx Amount
--------------------------------------------------------------------------------------
63e9c27e39d07f89e774e8ce67c1dde00960cd0ce8a294446ef6e0710229f9c0 15 1400000 lovelace + 1 65b2b0dd9028c871ac1997399979cfc12a7f05738e1ec8d8a16ea52f.AadaGoldenTicket + TxOutDatumHashNone
67a0902d60e520007ba31046c7eaf2f4ef831d43e64e4dd94ae0417b71f56cb7 0 1000000000 lovelace + TxOutDatumHashNone
7d9ce3aecb2203c7c83277ac56cc910b38db597760a95efe65598bcd75bca838 1 989823279 lovelace + TxOutDatumHashNone
to be honest, I have no idea how to treat the AadaGoldenTicket token which I have here for some reason, so I tried every possible sum to calculate the total value in the address
using:
expr 1000000000 + 989823279
expr 1000000000 + 989823279 + 1400000
or even using cardano scan I should have 1,991.223279 tADA so in Lovelace
1991223279
what do I do:
cardano-cli transaction build-raw \
--tx-in 7d9ce3aecb2203c7c83277ac56cc910b38db597760a95efe65598bcd75bca838#1 \
--tx-out $(cat reciver.addr)+1000000000 \
--tx-out $(cat sender.addr)+0 \
--invalid-hereafter 0 \
--fee 0 \
--out-file toReciver.draft.txn \
#get fee
cardano-cli transaction calculate-min-fee \
--tx-body-file toReciver.draft.txn \
--tx-in-count 1 \
--tx-out-count 2 \
--witness-count 1 \
--byron-witness-count 0 \
--testnet-magic 1097911063 \
--protocol-params-file testnet-protocol-params.json \
176897 Lovelace
#get current slot
cardano-cli query tip --testnet-magic 1097911063
#slot: 42946225
#input transaction params
cardano-cli transaction build-raw \
--tx-in 7d9ce3aecb2203c7c83277ac56cc910b38db597760a95efe65598bcd75bca838#1 \
--tx-out $(cat reciver.addr)+1000000000 \
--tx-out $(cat sender.addr)+$(expr 1000000000 + 989823279 - 1000000000 - 176897) \
--invalid-hereafter 42957225 \
--fee 176897 \
--out-file toReciver.raw.txn \
#sign
cardano-cli transaction sign \
--tx-body-file toReciver.raw.txn \
--signing-key-file sender.skey \
--testnet-magic 1097911063 \
--out-file toReciver.signed.txn \
#submit
cardano-cli transaction submit \
--tx-file toReciver.signed.txn \
--testnet-magic 1097911063
I get any kind of UTxO error, which are not very helpful;
here is as an example the error message of the commands shown above:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 989823279 (fromList [])) (Value 1991223279 (fromList [])))))])
which make me think that I’m getting wrong the way to calculate the total of the address; what should I do to get it right?