Documentation
¶
Index ¶
- Constants
- Variables
- type HDWallet
- func (wallet *HDWallet) AccountByID(id uuid.UUID) (core.ValidatorAccount, error)
- func (wallet *HDWallet) AccountByPublicKey(pubKey string) (core.ValidatorAccount, error)
- func (wallet *HDWallet) Accounts() []core.ValidatorAccount
- func (wallet *HDWallet) AddValidatorAccount(account core.ValidatorAccount) error
- func (wallet *HDWallet) CreateValidatorAccount(seed []byte, indexPointer *int) (core.ValidatorAccount, error)
- func (wallet *HDWallet) DeleteAccountByPublicKey(pubKey string) error
- func (wallet *HDWallet) GetNextAccountIndex() int
- func (wallet *HDWallet) ID() uuid.UUID
- func (wallet *HDWallet) MarshalJSON() ([]byte, error)
- func (wallet *HDWallet) SetContext(ctx *core.WalletContext)
- func (wallet *HDWallet) Type() core.WalletType
- func (wallet *HDWallet) UnmarshalJSON(data []byte) error
Constants ¶
View Source
const ( BaseAccountPath = "/%d" WithdrawalKeyPath = BaseAccountPath + "/0" ValidatorKeyPath = WithdrawalKeyPath + "/0" )
according to https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2334.md
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 HDWallet ¶
type HDWallet struct {
// contains filtered or unexported fields
}
an hierarchical deterministic wallet
func NewHDWallet ¶
func NewHDWallet(context *core.WalletContext) *HDWallet
func (*HDWallet) AccountByID ¶
AccountByID provides a nd account from the wallet given its ID. This will error if the account is not found.
func (*HDWallet) AccountByPublicKey ¶
func (wallet *HDWallet) 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 (*HDWallet) Accounts ¶
func (wallet *HDWallet) Accounts() []core.ValidatorAccount
Accounts provides all accounts in the wallet.
func (*HDWallet) AddValidatorAccount ¶
func (wallet *HDWallet) AddValidatorAccount(account core.ValidatorAccount) error
func (*HDWallet) CreateValidatorAccount ¶
func (wallet *HDWallet) CreateValidatorAccount(seed []byte, indexPointer *int) (core.ValidatorAccount, error)
CreateValidatorKey creates a new validation (validator) key pair in the wallet.
func (*HDWallet) DeleteAccountByPublicKey ¶
func (*HDWallet) GetNextAccountIndex ¶
GetNextAccountIndex provides next index to create account at.
func (*HDWallet) MarshalJSON ¶
func (*HDWallet) SetContext ¶
func (wallet *HDWallet) SetContext(ctx *core.WalletContext)
func (*HDWallet) Type ¶
func (wallet *HDWallet) Type() core.WalletType
Type provides the type of the wallet.
func (*HDWallet) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.