<p>First, <code>getUsedAddresses()</code> returns a <strong>list</strong> of all used (included in some on-chain transaction) addresses controlled by the wallet<sup>1</sup>.</p>
<p>To decode, can use <a href="https://github.com/cardano-foundation/cardano-connect-with-wallet/blob/main/src/utils/wallet.ts#L19" rel="nofollow noreferrer"><code>decodeHexAddress</code></a> on <code>getUsedAddresses()</code> elements.</p>
<hr />
<p><sup>1</sup> <a href="https://cips.cardano.org/cips/cip30/#apigetusedaddressespaginatepaginateundefinedpromiseaddress" rel="nofollow noreferrer">https://cips.cardano.org/cips/cip30/#apigetusedaddressespaginatepaginateundefinedpromiseaddress</a></p>

CC BY-SA 4.0
2022-11-29T16:50:58.180Z
that file is written in typescript. I have used javascript. should I switch to typescript?
WaerWaters
CC BY-SA 4.0
2022-12-05T07:23:09.770Z
Entirely up to you. You can import this function inside your **JS** project, like so: `import { decodeHexAddress } from '@cardano-foundation/cardano-connect-with-wallet'`.
Sourabh
CC BY-SA 4.0
2022-11-29T04:01:05.473Z
2022-11-29T04:07:38.470Z
2022-11-29T04:07:38.470Z
Sourabh
<p>I'm using nami wallet's api, and if I call cardano.getUsedAddresses() it return a &quot;hex encoded bytes string&quot; and I would like to  know how I can convert that to something readable</p>

<nami-wallet><decode><bytes>
convert hex encoded bytes string to something readable
# convert hex encoded bytes string to something readable

(Asked by: username_0 on 2022-11-28)

I'm using nami wallet's api, and if I call cardano.getUsedAddresses() it return a "hex encoded bytes string" and I would like to know how I can convert that to something readable

**Tags:** nami-wallet, decode, bytes

---

## 1 answers

### Answer by username_1 on 2022-11-29. Score: 0

First, `getUsedAddresses()` returns a **list** of all used (included in some on-chain transaction) addresses controlled by the wallet1.

To decode, can use [`decodeHexAddress`](https://github.com/cardano-foundation/cardano-connect-with-wallet/blob/main/src/utils/wallet.ts#L19) on `getUsedAddresses()` elements.

---

1 <https://cips.cardano.org/cips/cip30/#apigetusedaddressespaginatepaginateundefinedpromiseaddress>

> **Comments:**
> **username_0**: that file is written in typescript. I have used javascript. should I switch to typescript?  
> **username_1**: Entirely up to you. You can import this function inside your **JS** project, like so: `import { decodeHexAddress } from '@cardano-foundation/cardano-connect-with-wallet'`.  

---

