wallet

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidatorKeyPath               = "m/12381/3600/%d/0/0"
	MaxValidatorKeyRecoverAttempts = 100
)

Config

View Source
const (
	EntropyBits = 256
	FileMode    = 0600
)

Config

View Source
const NodeKeyPath = "m/44'/60'/0'/0/%d"

Config

Variables

This section is empty.

Functions

This section is empty.

Types

type Wallet

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

Wallet

func NewWallet

func NewWallet(walletPath string, passwordManager *passwords.PasswordManager) (*Wallet, error)

Create new wallet

func (*Wallet) AddKeystore

func (w *Wallet) AddKeystore(name string, ks keystore.Keystore)

Add a keystore to the wallet

func (*Wallet) CreateValidatorKey

func (w *Wallet) CreateValidatorKey() (*eth2types.BLSPrivateKey, error)

Create a new validator key

func (*Wallet) GetInitialized

func (w *Wallet) GetInitialized() (bool, error)

Attempt to initialize the wallet if not initialized and return status

func (*Wallet) GetNodeAccount

func (w *Wallet) GetNodeAccount() (accounts.Account, error)

Get the node account

func (*Wallet) GetNodeAccountTransactor

func (w *Wallet) GetNodeAccountTransactor() (*bind.TransactOpts, error)

Get a transactor for the node account

func (*Wallet) GetNodePrivateKeyBytes

func (w *Wallet) GetNodePrivateKeyBytes() ([]byte, error)

Get the node account private key bytes

func (*Wallet) GetValidatorKeyAt

func (w *Wallet) GetValidatorKeyAt(index uint) (*eth2types.BLSPrivateKey, error)

Get a validator key by index

func (*Wallet) GetValidatorKeyByPubkey

func (w *Wallet) GetValidatorKeyByPubkey(pubkey rptypes.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)

Get a validator key by public key

func (*Wallet) GetValidatorKeyCount

func (w *Wallet) GetValidatorKeyCount() (uint, error)

Get the number of validator keys recorded in the wallet

func (*Wallet) Initialize

func (w *Wallet) Initialize() (string, error)

Initialize the wallet from a random seed

func (*Wallet) IsInitialized

func (w *Wallet) IsInitialized() bool

Check if the wallet has been initialized

func (*Wallet) Recover

func (w *Wallet) Recover(mnemonic string) error

Recover a wallet from a mnemonic

func (*Wallet) RecoverValidatorKey

func (w *Wallet) RecoverValidatorKey(pubkey rptypes.ValidatorPubkey) error

Recover a validator key by public key

func (*Wallet) Save

func (w *Wallet) Save() error

Save the wallet store to disk

func (*Wallet) String

func (w *Wallet) String() (string, error)

Serialize the wallet to a JSON string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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