hyperweb-io / hyperweb-io/chain-registry

utils functions for validating address of a chain and convert address between chains

Open
#27 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
70
Forks
39
PR merge metrics
No merged PRs in 30d

Description

we require some crucial functions to be made part of the utils library of chain-registry, such as validating an address of a particular chain. This should be a 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"

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.