Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateMnemonic() (string, error)
- func IsMnemonicValid(mnemonic string) bool
- func MnemonicToBech32Address(hrp, mnemonic string, addressType AddressType) (string, error)
- func MnemonicToBech32AddressWithCoinType(hrp, mnemonic string, coinType int) (string, error)
- func PubKeyToBech32Address(pubKeyHex string) (string, error)
- type AddressType
Constants ¶
View Source
const ( CosmosHDPath string = "m/44'/118'/0'/0/0" EVMHDPath string = "m/44'/60'/0'/0/0" HardenedOffset int = 0x80000000 InitHRP string = "init" )
Variables ¶
View Source
var EnglishWordList = strings.Split(strings.TrimSpace(englishWordList), "\n")
EnglishWordList Language-specific wordlists
View Source
var ReverseWordMap = map[string]int{}
View Source
var WordList = EnglishWordList
WordList is the wordlist to use
Functions ¶
func GenerateMnemonic ¶
GenerateMnemonic generates new fresh mnemonic
func IsMnemonicValid ¶
IsMnemonicValid attempts to verify that the provided mnemonic is valid. Validity is determined by both the number of words being appropriate, and that all the words in the mnemonic are present in the word list.
func MnemonicToBech32Address ¶
func MnemonicToBech32Address(hrp, mnemonic string, addressType AddressType) (string, error)
MnemonicToBech32Address converts a mnemonic to a Cosmos SDK Bech32 address.
func MnemonicToBech32AddressWithCoinType ¶ added in v0.3.6
MnemonicToBech32AddressWithCoinType converts a mnemonic to a Cosmos SDK Bech32 address using a custom coin type.
func PubKeyToBech32Address ¶ added in v0.3.1
PubKeyToBech32Address converts a hex string public key to a Cosmos SDK Bech32 address.
Types ¶
type AddressType ¶ added in v0.3.4
type AddressType int
const ( CosmosAddressType AddressType = iota EVMAddressType )
Click to show internal directories.
Click to hide internal directories.