Need some help with a transaction to move NFT from one address to another. Keep getting ValueNotConservedUTxO

I’m stuck with this transaction. It doesn’t work for me. Keep getting ValueNotConservedUTxO error… when trying to move NFT from one address to another

Here is my first wallet addr_test1vr4td5a6wthnz3mu7er087fuvjgaz9d58qg243z34pl0g4qrqsh6y

e3dc31edbdda137bd8d7f0f65ec55adefa5c9da2f4b1cdfe37096090e87f3f01 #0
value: {
      lovelace: 997893577,
      '08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.CreateNewTOken': 1,
      '08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.ThisIsNewTOken': 1,
      '08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.hahaDaaddd': 1,
      '08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.mySupperCoolTokenNFT': 1,
      '08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.pokemon': 1,
      '8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.Hololo': 2,
      '8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.MyNewSuperTOken': 1,
      '8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.MyNewToken': 1,
      '8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.asdfasdf': 2,
}

This is My second wallet addr_test1vraext2hgj70q3skgy79p8f4mh47yxwj0e4twvmj7jmmhdcaxama8

   4938035c6898c887171c27ae7aa766207b5e3a54e4b73c7c6462ff1727d88522     0        999473357 lovelace + TxOutDatumHashNone

This the transaction that I’m trying to send:

[
  'cardano-cli',
  'transaction',
  'build-raw',
  '--fee',
  200000,
  '--tx-in e3dc31edbdda137bd8d7f0f65ec55adefa5c9da2f4b1cdfe37096090e87f3f01#0',
  '--tx-out',
  'addr_test1vr4td5a6wthnz3mu7er087fuvjgaz9d58qg243z34pl0g4qrqsh6y+996693577+"1 08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.ThisIsNewTOken"+"1 08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.hahaDaaddd"+"1 08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.mySupperCoolTokenNFT"+"1 08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.pokemon"+"2 8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.Hololo"+"1 8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.MyNewSuperTOken"+"1 8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.MyNewToken"+"2 8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d.asdfasdf"',
  '--tx-out',
  'addr_test1vraext2hgj70q3skgy79p8f4mh47yxwj0e4twvmj7jmmhdcaxama8+1000473357+"1 08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702.CreateNewTOken"',
  '--out-file',
  'policies/tmp/45767a4a-adce-47a9-a6c1-c76511ad2a52.raw'
]

Letter I’m executing it with join(’ '). so believe me the syntax is fine.
regarding the utxos:
my fee is 20000.
so the outputs are

  1. 997893577 - 200,000 - 1,000,000 = 996693577
    and
  2. 999473357 + 1,000,000 = 1000473357

But I keep getting ValueNotConservedUTxO

The full error:

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 997893577 (fromList [(PolicyID {policyID = ScriptHash "08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702"},fromList [("CreateNewTOken",1),("ThisIsNewTOken",1),("hahaDaaddd",1),("mySupperCoolTokenNFT",1),("pokemon",1)]),(PolicyID {policyID = ScriptHash "8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d"},fromList [("Hololo",2),("MyNewSuperTOken",1),("MyNewToken",1),("asdfasdf",2)])])) (Value 1997366934 (fromList [(PolicyID {policyID = ScriptHash "08eec649fbc016d2ddffb7b00ebe5fecca067749448de4f41a9dd702"},fromList [("CreateNewTOken",1),("ThisIsNewTOken",1),("hahaDaaddd",1),("mySupperCoolTokenNFT",1),("pokemon",1)]),(PolicyID {policyID = ScriptHash "8faa81397b2486b11bbf3ed4e71b7c83aaf5559059bf9042469acd2d"},fromList [("Hololo",2),("MyNewSuperTOken",1),("MyNewToken",1),("asdfasdf",2)])])))))])```

Answered this question in another topic:

Not sure where you got 999473357 from. That should be just 1000000 that you are sending with the tokens. But 1000000 is to small i think as you have custom token, go with something like 1.6ADA.

I guess 999473357 is the total funds from that address but you don’t need that here.

Oh… Now it make sense. I tried to add to the same UTXO of the receiver so I added 1000000 to his current balance instead of creating a new UTXO with just 1000000. I should ask that question before. killed about 3 hours trying to find what’s wrong. Thank you so much!

Np… so basically everything that is tx-in must be spent as part of fees and tx-out and you never include any totals from receiving addresses as that is handled by the protocol.