wallet

package
v1.18.0-dev Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntropyBits              = 256
	FileMode                 = 0600
	DefaultNodeKeyPath       = "m/44'/60'/0'/0/%d"
	LedgerLiveNodeKeyPath    = "m/44'/60'/%d/0/0"
	MyEtherWalletNodeKeyPath = "m/44'/60'/0'/%d"
)

Config

View Source
const (
	MaxValidatorKeyRecoverAttempts uint = 1000
)

Config

Variables

View Source
var ErrIsMasquerading = errors.New("The node is currently masquerading. Use the command 'rocketpool wallet end-masquerade' to restore the node wallet, if one is loaded.")

Functions

This section is empty.

Types

type AddressManager added in v1.15.7

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

Simple class to wrap the node's address file

func NewAddressManager added in v1.15.7

func NewAddressManager(path string) *AddressManager

Creates a new address manager

func (*AddressManager) DeleteAddressFile added in v1.15.7

func (m *AddressManager) DeleteAddressFile() error

Delete the saved address file from disk

func (*AddressManager) GetAddress added in v1.15.7

func (m *AddressManager) GetAddress() common.Address

Get the cached address

func (*AddressManager) LoadAddress added in v1.15.7

func (m *AddressManager) LoadAddress() (common.Address, error)

Gets the address saved on disk. Returns false if the address file doesn't exist.

func (*AddressManager) SetAndSaveAddress added in v1.15.7

func (m *AddressManager) SetAndSaveAddress(newAddress common.Address) error

Sets the node address and saves it to disk

type ValidatorKey added in v1.7.0

type ValidatorKey struct {
	PublicKey      types.ValidatorPubkey
	PrivateKey     *eth2types.BLSPrivateKey
	DerivationPath string
	WalletIndex    uint
}

A validator private/public key pair

type Wallet

type Wallet interface {
	AddKeystore(name string, ks keystore.Keystore)
	CreateValidatorKey() (*eth2types.BLSPrivateKey, error)
	Delete() error
	DeleteValidatorStores() error
	GetChainID() *big.Int
	GetInitialized() (bool, error)
	GetNextValidatorKey() (*eth2types.BLSPrivateKey, error)
	GetNodeAccount() (accounts.Account, error)
	GetNodeAccountTransactor() (*bind.TransactOpts, error)
	GetNodePrivateKeyBytes() ([]byte, error)
	GetValidatorKeyAt(index uint) (*eth2types.BLSPrivateKey, error)
	GetValidatorKeyByPubkey(pubkey rptypes.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
	GetValidatorKeyCount() (uint, error)
	GetValidatorKeys(startIndex uint, length uint) ([]ValidatorKey, error)
	Initialize(derivationPath string, walletIndex uint) (string, error)
	IsInitialized() bool
	LoadValidatorKey(pubkey rptypes.ValidatorPubkey) (*eth2types.BLSPrivateKey, error)
	Recover(derivationPath string, walletIndex uint, mnemonic string) error
	RecoverValidatorKey(pubkey rptypes.ValidatorPubkey, startIndex uint) (uint, error)
	Reload() error
	Save() error
	SaveValidatorKey(key ValidatorKey) error
	Sign(serializedTx []byte) ([]byte, error)
	SignMessage(message string) ([]byte, error)
	StoreValidatorKey(key *eth2types.BLSPrivateKey, path string) error
	String() (string, error)
	TestRecoverValidatorKey(pubkey rptypes.ValidatorPubkey, startIndex uint) (uint, error)
	TestRecovery(derivationPath string, walletIndex uint, mnemonic string) error
	MasqueradeAsAddress(address common.Address) error
	EndMasquerade() error
	GetAddress() (common.Address, error)
	IsNodeMasquerading() bool
}

func NewHdWallet added in v1.15.7

func NewHdWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, gasLimit uint64, passwordManager *passwords.PasswordManager, addressManager *AddressManager) (Wallet, error)

Create new hdWallet

func NewMasqueradeWallet added in v1.15.7

func NewMasqueradeWallet(walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, gasLimit uint64, passwordManager *passwords.PasswordManager, addressManager *AddressManager) (Wallet, error)

Create new masqueradeWallet

func NewWallet

func NewWallet(addressPath string, walletPath string, chainId uint, maxFee *big.Int, maxPriorityFee *big.Int, gasLimit uint64, passwordManager *passwords.PasswordManager, addressManager *AddressManager) (Wallet, error)

Create new wallet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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