0

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

1 Answer 1

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 on getUsedAddresses() elements.


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

2
  • that file is written in typescript. I have used javascript. should I switch to typescript?
    – WaerWaters
    Commented Nov 29, 2022 at 16:50
  • 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
    Commented Dec 5, 2022 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.