nd

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAccountNotFound is the error when account not found
	ErrAccountNotFound = errors.New("account not found")
)

Predefined errors

Functions

This section is empty.

Types

type NDWallet

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

an hierarchical deterministic wallet

func NewNDWallet

func NewNDWallet(context *core.WalletContext) *NDWallet

func (*NDWallet) AccountByID

func (wallet *NDWallet) AccountByID(id uuid.UUID) (core.ValidatorAccount, error)

AccountByID provides a nd account from the wallet given its ID. This will error if the account is not found.

func (*NDWallet) AccountByPublicKey

func (wallet *NDWallet) AccountByPublicKey(pubKey string) (core.ValidatorAccount, error)

AccountByPublicKey provides a nd account from the wallet given its public key. This will error if the account is not found.

func (*NDWallet) Accounts

func (wallet *NDWallet) Accounts() []core.ValidatorAccount

Accounts provides all accounts in the wallet.

func (*NDWallet) AddValidatorAccount

func (wallet *NDWallet) AddValidatorAccount(account core.ValidatorAccount) error

func (*NDWallet) CreateValidatorAccount

func (wallet *NDWallet) CreateValidatorAccount(seed []byte, indexPointer *int) (core.ValidatorAccount, error)

CreateValidatorKey creates a new validation (validator) key pair in the wallet.

func (*NDWallet) DeleteAccountByPublicKey

func (wallet *NDWallet) DeleteAccountByPublicKey(pubKey string) error

func (*NDWallet) GetNextAccountIndex

func (wallet *NDWallet) GetNextAccountIndex() int

GetNextAccountIndex provides next index to create account at.

func (*NDWallet) ID

func (wallet *NDWallet) ID() uuid.UUID

ID provides the ID for the wallet.

func (*NDWallet) MarshalJSON

func (wallet *NDWallet) MarshalJSON() ([]byte, error)

func (*NDWallet) SetContext

func (wallet *NDWallet) SetContext(ctx *core.WalletContext)

func (*NDWallet) Type

func (wallet *NDWallet) Type() core.WalletType

Type provides the type of the wallet.

func (*NDWallet) UnmarshalJSON

func (wallet *NDWallet) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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