<p>Documentation for getUtxos():</p>
<blockquote>
<p><code>cardano.getUtxos(amount, paginate)</code></p>
<pre><code>cardano.getUtxos(amount?: Value, paginate?: {page: number, limit: number}) : [TransactionUnspentOutput]
</code></pre>
<p>TransactionUnspentOutput is a hex encoded bytes string.</p>
</blockquote>
<p><a href="https://i.sstatic.net/A8FKD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/A8FKD.png" alt="enter image description here" /></a></p>
<p>Now just deserialize the hex-encoded cbor string, for example in Python using the <code>cbor2</code> package:</p>
<pre><code>import cbor2   
                                                                                                                                             
utxos = cbor2.loads(bytes.fromhex(&quot;YOUR_CBOR_STRING&quot;))
                                                                                                                                                                                                                                                                                                      
for k, v in utxos[1][1][1].items():
    print(k.hex(), v)


                                                                                                                          
</code></pre>
<p><a href="https://i.sstatic.net/lvRaf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lvRaf.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-09-20T08:45:12.037Z
Thank you for the reply. I am aware of how to use getUtxos() method. My issue is that Nami wallet returns "undefined" while Eternl returns a correct list of utxos when I use the same code with both.

Looks like Nam's is less efficient in selecting utxos to fulfill the outputs of a transaction. Or is there a different method in Nami other than the default getUtxos()?

For example, try and build a tx where you need 3 or 4 NFTs sent from wallet along with some ADA. You will notice that Eternl has no issue, where Nami tried to include all utxos or none.
Fourzin
CC BY-SA 4.0
2022-09-19T00:17:56.230Z
2022-09-19T00:17:56.230Z
et97
<p>I am building a transaction that includes more than one asset in the output of a transaction. After I set up the output and try to build a transaction using getUtxos(outputValue) I get undefined from Nami while Eternal works fine using the same code.</p>
<p>outputValue contains both ada and several other assets.</p>

<nami-wallet><eternl><lightwallet>
Nami getUtxos() method not as good as Eternl's
# Nami getUtxos() method not as good as Eternl's

(Asked by: username_0 on 2022-09-18)

I am building a transaction that includes more than one asset in the output of a transaction. After I set up the output and try to build a transaction using getUtxos(outputValue) I get undefined from Nami while Eternal works fine using the same code.

outputValue contains both ada and several other assets.

**Tags:** nami-wallet, eternl, lightwallet

---

## 1 answers

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

Documentation for getUtxos():

cardano.getUtxos(amount, paginate)
cardano.getUtxos(amount?: Value, paginate?: {page: number, limit: number}) : [TransactionUnspentOutput]

TransactionUnspentOutput is a hex encoded bytes string.


Now just deserialize the hex-encoded cbor string, for example in Python using the cbor2 package:
import cbor2   
                                                                                                                                             
utxos = cbor2.loads(bytes.fromhex("YOUR_CBOR_STRING"))
                                                                                                                                                                                                                                                                                                      
for k, v in utxos[1][1][1].items():
    print(k.hex(), v)

> **Comments:**
> **username_0**: Thank you for the reply. I am aware of how to use getUtxos() method. My issue is that Nami wallet returns "undefined" while Eternl returns a correct list of utxos when I use the same code with both.  Looks like Nam's is less efficient in selecting utxos to fulfill the outputs of a transaction. Or is there a different method in Nami other than the default getUtxos()?  For example, try and build a tx where you need 3 or 4 NFTs sent from wallet along with some ADA. You will notice that Eternl has no issue, where Nami tried to include all utxos or none.  

---

