<p>Comment converted into answer:</p>
<p>I'm not familiar with that code, but in general moving native assets needs to go along with some ADA eg 1 or 2 ADA. Does your input UTxO have enough ADA balance to cover everything eg fees and output ADA? If not then you can add a second input UTxO that has more ADA into the transaction.</p>

CC BY-SA 4.0
2022-03-19T23:00:53.977Z
2022-03-19T23:00:53.977Z
MC_Brisbane - JUST Pool
<p>(1) Make sure you have enough ADA in your wallet that can be used to pay for transaction fees. Transaction fees are increasing the more native assets you add to the transaction.</p>
<p>(2) If you use <code>add_change_if_needed</code> make sure to add enough inputs before calling this method that can cover the transaction fees.</p>
<p>(3) If you hardcode your input UTxO like you probably did with <code>278ad827cb923ed800fcb2028114ee8e9bca875059e1389ca1f49755c1c9a629</code> then running your code multiple time with of course fail, because you've consumed the unspent output with your first execution. Any second try won't be able  to spend this output again, since it's already been spent.</p>
<p>You will need to update your code manually or write some logic to select the new UTxO.</p>

CC BY-SA 4.0
2022-05-14T08:22:23.870Z
2022-05-14T08:22:23.870Z
Will
<p>I am getting the error when using @emurgo\cardano-serialization-lib-asmjs</p>
<p>txBuilder.add_change_if_needed(shelleyChangeAddress)</p>
<p>throws an exception
Not enough ADA leftover to include non-ADA assets in a change address</p>

CC BY-SA 4.0
2022-03-19T04:32:46.247Z
I'm not familiar with that code, but in general moving native assets needs to go along with some ADA eg 1 or 2 ADA.
Does your input UTxO have enough ADA balance to cover everything eg fees and output ADA?
If not then you can add a second input UTxO that has more ADA into the transaction.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-03-19T05:29:02.007Z
thanks, its a stange issue. if i execute couple of time the same code it work after couple of retries. but I have a different problem in submitting the transaction. Sign the tx is fine Error: submit tx failed: Error: 400:
0: "278ad827cb923ed800fcb2028114ee8e9bca875059e1389ca1f49755c1c9a629"

    at checkResponseNoError (apiDom.ts:334:1)
    at Object.submitTx (apiDom.ts:270:1)
Hemendra Singh
CC BY-SA 4.0
2022-03-19T07:53:28.940Z
Can you post the full input code, and response output/errors/messages. There are often multiple messages in the output which give better clues.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-03-20T04:00:07.087Z
Posting an alternative where you don't need to build a transaction in front-end https://cardano.stackexchange.com/a/7658/117
Mehul Prajapati
CC BY-SA 4.0
2022-04-13T16:12:06.137Z
Unexpected error value: "Not enough ADA leftover to include non-ADA assets in a change address" I am getting this error, using nami, I have 5+ ada as collateral. I get the message when I try to harvest in the farm.
dsmith7666
CC BY-SA 4.0
2022-04-13T23:23:36.003Z
If you have a question then please raise it as a new question with full details of what you were trying to do and how, and what errors/output to received. The Answers space here is intended for answers to the question above about the library cardano-serialization-lib-asmjs, not for a new question. We're happy to help but as a new question, cheers.
MC_Brisbane - JUST Pool
<cardano-serialization-lib>
Not enough ADA leftover to include non-ADA assets in a change address
# Not enough ADA leftover to include non-ADA assets in a change address

(Asked by: username_0 on 2022-03-19)

I am getting the error when using @emurgo\cardano-serialization-lib-asmjs

txBuilder.add\_change\_if\_needed(shelleyChangeAddress)

throws an exception
Not enough ADA leftover to include non-ADA assets in a change address

**Tags:** cardano-serialization-lib
> **Comments:**
> **username_1**: I'm not familiar with that code, but in general moving native assets needs to go along with some ADA eg 1 or 2 ADA. Does your input UTxO have enough ADA balance to cover everything eg fees and output ADA? If not then you can add a second input UTxO that has more ADA into the transaction.  
> **username_0**: thanks, its a stange issue. if i execute couple of time the same code it work after couple of retries. but I have a different problem in submitting the transaction. Sign the tx is fine Error: submit tx failed: Error: 400: 0: "278ad827cb923ed800fcb2028114ee8e9bca875059e1389ca1f49755c1c9a629"      at checkResponseNoError (apiDom.ts:334:1)     at Object.submitTx (apiDom.ts:270:1)  
> **username_1**: Can you post the full input code, and response output/errors/messages. There are often multiple messages in the output which give better clues.  
> **username_2**: Posting an alternative where you don't need to build a transaction in front-end https://cardano.stackexchange.com/a/7658/117  
> **username_3**: Unexpected error value: "Not enough ADA leftover to include non-ADA assets in a change address" I am getting this error, using nami, I have 5+ ada as collateral. I get the message when I try to harvest in the farm.  
> **username_1**: If you have a question then please raise it as a new question with full details of what you were trying to do and how, and what errors/output to received. The Answers space here is intended for answers to the question above about the library cardano-serialization-lib-asmjs, not for a new question. We're happy to help but as a new question, cheers.  

---

## 2 answers

### Answer by username_1 on 2022-03-19. Score: 0

Comment converted into answer:

I'm not familiar with that code, but in general moving native assets needs to go along with some ADA eg 1 or 2 ADA. Does your input UTxO have enough ADA balance to cover everything eg fees and output ADA? If not then you can add a second input UTxO that has more ADA into the transaction.


---

### Answer by username_4 on 2022-05-14. Score: 0

(1) Make sure you have enough ADA in your wallet that can be used to pay for transaction fees. Transaction fees are increasing the more native assets you add to the transaction.

(2) If you use `add_change_if_needed` make sure to add enough inputs before calling this method that can cover the transaction fees.

(3) If you hardcode your input UTxO like you probably did with `278ad827cb923ed800fcb2028114ee8e9bca875059e1389ca1f49755c1c9a629` then running your code multiple time with of course fail, because you've consumed the unspent output with your first execution. Any second try won't be able to spend this output again, since it's already been spent.

You will need to update your code manually or write some logic to select the new UTxO.


---

