You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.
Is there any way to convert evmos address to evmosvaloper address?
In cli we use evmosd debug addr .... which gives us valoper address.
Can we do the same thing using evmosjs?
Any help will be appreciated.
The text was updated successfully, but these errors were encountered:
@aramakam3505
You can try this code to convert addresses.
Just change prefix argument.
import{bech32}from'bech32';exportfunctionbech32Encode(address: string,prefix='evmos'){constwords=bech32.toWords(Buffer.from(address.replace('0x',''),'hex'));returnbech32.encode(prefix,words);}exportfunctionbech32Decode(address: string){const{ words }=bech32.decode(address);consthex=Buffer.from(bech32.fromWords(words)).toString('hex');return`0x${hex}`.toLowerCase();}
Hope it's help
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there any way to convert evmos address to evmosvaloper address?
In cli we use evmosd debug addr .... which gives us valoper address.
Can we do the same thing using evmosjs?
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: