hyperweb-io / hyperweb-io/cosmos-kit

Client-side validation/conversion of chain address

Open
#158 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
201
Forks
159
PR merge metrics
No merged PRs in 30d

Description

[Quote Link](https://discord.com/channels/958479707123355748/1002012738580652132/1062754249605398538)

> hi Dan, can you confirm if there are functions to verify if an address is a valid bech32 address for a particular chain, in chain-registry ? this should ideally be under @chain-registry/utils or @chain-registry/assets.. for each asset, we could provide a verifyAddress() function, where we pass the complete address (human readable prefix + control digit + remaining hash value) and it will return a boolean value.
for e.g. verifyAddress("osmosis", "osmo1egdwq4khcmsyd0tk6mpq28r7eawjpe6nzd9kjd") could give return value - true - since it is a valid address.

> also a function to convert an address represented in one chain to address represented in another chain.. for eg. convertAddress("cosmoshub", "osmosis", "cosmos1egdwq4khcmsyd0tk6mpq28r7eawjpe6n2kkxyl") could give back - "osmo1egdwq4khcmsyd0tk6mpq28r7eawjpe6nzd9kjd"

[DAO DAO Reference](https://github.com/DA0-DA0/dao-dao-ui/blob/development/packages/utils/isValidAddress.ts)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.