lib

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

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

func GenerateRandomString(n int) (string, error)

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

func GenerateRandomStringURLSafe(n int) (string, error)

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

func GetAddressFromExtPubKey(extPubKey string, external bool, addressIndex int) (string, error)

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.

Types

type Error

type Error struct {
	Err            error
	DisplayMessage string
}

func (Error) DisplayError

func (e Error) DisplayError() error

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL