util

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Words12 = 12
	Words15 = 15
	Words18 = 18
	Words21 = 21
	Words24 = 24
)

Variables

View Source
var (
	ErrInputValidationFailed       = errors.New("input validation failed")
	ErrInvalidMnemonicWordsCount   = errors.New("provided mnemonic words count is not supported")
	ErrInvalidBIP39Seed            = errors.New("provided seed is not valid")
	ErrInvalidRootKey              = errors.New("root key is invalid")
	ErrInvalidRangeProvided        = errors.New("range provided is invalid")
	ErrUnSupportedPurposePath      = errors.New("unsupported purpose path")
	ErrCoinTypeIsRequired          = errors.New("coin type is required")
	ErrAccountPathShouldBeHardened = errors.New("account path should be hardened")
	ErrChangeIsRequired            = errors.New("change is required")
	ErrUnsupportedCoinType         = errors.New("coin type is not supported")
	ErrUnSupportedOrInvalidPath    = errors.New("path is unsupported and/or invalid")
	ErrPathDepthNeedGreaterThanOne = errors.New("path depth must be greater than or equal to one")
)

Functions

func DeriveSeedFromMnemonic

func DeriveSeedFromMnemonic(mnemonic string, mnemonicPassphrase string) (string, error)

func RootKeyFromSeed

func RootKeyFromSeed(seed string) (*bip32.Key, error)

RootKeyFromSeed seed usually derived from bip39.NewSeed

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

func (*Generator) DeriveBIP32Result

func (g *Generator) DeriveBIP32Result(p bip32.Path) ([]KeyPath, error)

func (*Generator) RootKey

func (g *Generator) RootKey() *bip32.Key

func (*Generator) SetRootKey

func (g *Generator) SetRootKey(k bip32.Key)

type KeyPath

type KeyPath struct {
	Path bip32.Path
	Key  bip32.Key
}

func (KeyPath) AddrHex

func (b KeyPath) AddrHex() string

func (KeyPath) AddrP2SH

func (b KeyPath) AddrP2SH(verPrefix byte) string

type KeyPathRange

type KeyPathRange struct {
	StartIndex uint32
	EndIndex   uint32
	KeyPath
	KeyPaths []KeyPath
}

func (*KeyPathRange) GenerateRange

func (b *KeyPathRange) GenerateRange() error

type Path

type Path = bip32.Path

Jump to

Keyboard shortcuts

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