Documentation
¶
Index ¶
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func GenerateRandomStringURLSafe(n int) (string, error)
- func GetAddressFromExtPubKey(extPubKey string, external bool, addressIndex int) (string, error)
- func GetAddressFromXpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
- func GetAddressFromYpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
- func GetAddressFromZpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomStringURLSafe ¶
GenerateRandomStringURLSafe returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GetAddressFromExtPubKey ¶
GetAddressFromExtPubKey now supports zpub, xpub, and ypub.
func GetAddressFromXpub ¶
func GetAddressFromXpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
GetAddressFromXpub derives a legacy P2PKH address from an xpub key.
func GetAddressFromYpub ¶
func GetAddressFromYpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
GetAddressFromYpub derives a nested segwit address (P2SH-P2WPKH) from a ypub key.
func GetAddressFromZpub ¶
func GetAddressFromZpub(key *hdkeychain.ExtendedKey, external bool, index int) (string, error)
GetAddressFromZpub derives a native segwit address (P2WPKH) from a zpub key.