Created
February 15, 2023 14:45
-
-
Save Reecepbcups/f9f8e713cb98da51dc6cec014ea7e62b to your computer and use it in GitHub Desktop.
Convert a HexAddress to the nodes signing address (valcons)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ex: "GetBlockByHeightRequest" grpc call returns the validatorAddress as hex | |
// npm i '@cosmjs/encoding | |
import {fromHex, toBech32} from '@cosmjs/encoding' | |
// where junovalcons is the prefix for the chain. It MUST be valcons, you can not convert to valoper or normal address from here | |
const prefix = "junovalcons" | |
let addr = toBech32(prefix, fromHex("80F24BFDA3E6A8C1BAC0517E7665AC9145D609F7")) | |
// here this addr is for SG-1 on juno, which matches their signer address of junovalcons1sreyhldru65vrwkq29l8vedvj9zavz0hxyeejf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment