Documentation ¶
Index ¶
- Variables
- type Wallet
- func (wallet *Wallet) AccountByID(id uuid.UUID) (core.ValidatorAccount, error)
- func (wallet *Wallet) AccountByPublicKey(pubKey string) (core.ValidatorAccount, error)
- func (wallet *Wallet) Accounts() []core.ValidatorAccount
- func (wallet *Wallet) AddValidatorAccount(account core.ValidatorAccount) error
- func (wallet *Wallet) CreateValidatorAccount(_ []byte, _ *int) (core.ValidatorAccount, error)
- func (wallet *Wallet) CreateValidatorAccountFromPrivateKey(_ []byte, _ *int) (core.ValidatorAccount, error)
- func (wallet *Wallet) DeleteAccountByPublicKey(pubKey string) error
- func (wallet *Wallet) GetNextAccountIndex() int
- func (wallet *Wallet) ID() uuid.UUID
- func (wallet *Wallet) MarshalJSON() ([]byte, error)
- func (wallet *Wallet) SetContext(ctx *core.WalletContext)
- func (wallet *Wallet) Type() core.WalletType
- func (wallet *Wallet) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
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
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
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
DeleteAccountByPublicKey deletes account by public key
func (*Wallet) GetNextAccountIndex ¶ added in v1.0.1
GetNextAccountIndex provides next index to create account at.
func (*Wallet) MarshalJSON ¶ added in v1.0.1
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
UnmarshalJSON is the custom JSON unmarshaler