nd

package
v1.3.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: GPL-3.0 Imports: 7 Imported by: 1

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 Wallet added in v1.0.1

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

Wallet is hierarchical deterministic wallet

func NewWallet added in v1.0.1

func NewWallet(context *core.WalletContext) *Wallet

NewWallet is the constructor of Wallet

func (*Wallet) AccountByID added in v1.0.1

func (wallet *Wallet) 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 (*Wallet) AccountByPublicKey added in v1.0.1

func (wallet *Wallet) 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 (*Wallet) Accounts added in v1.0.1

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

Accounts provides all accounts in the wallet.

func (*Wallet) AddValidatorAccount added in v1.0.1

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

AddValidatorAccount adds the given account

func (*Wallet) CreateValidatorAccount added in v1.0.1

func (wallet *Wallet) CreateValidatorAccount(_ []byte, _ *int) (core.ValidatorAccount, error)

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

func (*Wallet) CreateValidatorAccountFromPrivateKey added in v1.0.8

func (wallet *Wallet) CreateValidatorAccountFromPrivateKey(_ []byte, _ *int) (core.ValidatorAccount, error)

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

func (*Wallet) DeleteAccountByPublicKey added in v1.0.1

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

DeleteAccountByPublicKey deletes account by public key

func (*Wallet) GetNextAccountIndex added in v1.0.1

func (wallet *Wallet) GetNextAccountIndex() int

GetNextAccountIndex provides next index to create account at.

func (*Wallet) ID added in v1.0.1

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

ID provides the ID for the wallet.

func (*Wallet) MarshalJSON added in v1.0.1

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

MarshalJSON is the custom JSON marshaler

func (*Wallet) SetContext added in v1.0.1

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

SetContext is the context setter

func (*Wallet) Type added in v1.0.1

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

Type provides the type of the wallet.

func (*Wallet) UnmarshalJSON added in v1.0.1

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

UnmarshalJSON is the custom JSON unmarshaler

Jump to

Keyboard shortcuts

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