# Inconsistent bech32/hex address format in API calls

**URL:** <https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458>\
**Category:** Developers\
**Created:** [February 24, 2022, 4:12pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458 "2022-02-24T16:12:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KidA001](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@KidA001](https://talk.harmony.one/u/KidA001)\
**Post date:** [February 24, 2022, 4:12pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458/1 "2022-02-24T16:12:43Z")

</div>

I’m using the `https://rpc.s0.t.hmny.io` API to get transaction data from blocks. I use the `hmyv2_getBlockByNumber` to get top-level transaction data and then `hmy_getLogs` to LogEvents.

In responses from `hmyv2_getBlockByNumber` the to/from addresses are in the bech32 format (`one...`), but all addresses in the logs are hex (`0x...`).

Will this always be the case or does Harmony plan to convert all addresses to bech32 format?

---

<div class="post-metadata">

**Author:** ![Maffaz](https://yyz1.discourse-cdn.com/flex035/user_avatar/talk.harmony.one/maffaz/32/646_2.png) [@Maffaz](https://talk.harmony.one/u/Maffaz)\
**Post date:** [February 24, 2022, 4:40pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458/2 "2022-02-24T16:40:52Z")

</div>

Not sure what the plans for the future are but I wrote a docker service to convert addresses.

The code for the conversion is here but you will also require the bech32.py module included or just boot up the service and call via API…

> <https://github.com/johnashu/harmony_convert_address/blob/main/src/app/core/convert.py>

---

<div class="post-metadata">

**Author:** ![KidA001](https://avatars.discourse-cdn.com/v4/letter/k/8e8cbc/32.png) [@KidA001](https://talk.harmony.one/u/KidA001)\
**Post date:** [February 24, 2022, 5:19pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458/3 "2022-02-24T17:19:12Z")

</div>

Thank you. Converting it is no problem, I’m already doing that with this [npm package](https://www.npmjs.com/package/bech32-converting). I’m just wondering if there will be breaking changes in the future. I don’t quite understand why top level addresses in the `from/to` of `hmyv2_getBlockByNumber` are bech32 but everything else is hex. We just convert to hex for our own sanity/ease 🙂

---

<div class="post-metadata">

**Author:** ![Maffaz](https://yyz1.discourse-cdn.com/flex035/user_avatar/talk.harmony.one/maffaz/32/646_2.png) [@Maffaz](https://talk.harmony.one/u/Maffaz)\
**Post date:** [February 24, 2022, 5:39pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458/4 "2022-02-24T17:39:03Z")

</div>

I was just about to post the js version 😆 🤣

I’m the same, don’t care what format but i generally stick to one or the other.

It would be nice to have some consistency api wise.

@giv @rongjian do we have any plans to align this in the future?

---

<div class="post-metadata">

**Author:** ![marku01](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@marku01](https://talk.harmony.one/u/marku01)\
**Post date:** [February 25, 2022, 9:34pm UTC](https://talk.harmony.one/t/inconsistent-bech32-hex-address-format-in-api-calls/12458/5 "2022-02-25T21:34:10Z")

</div>

I haven’t tested this myself. But you can check if eth\_/hmy\_/hmyv2\_ methods give different results. AFAIK that’s what they are intended for
