2020-07-20 21:05:23 -05:00
|
|
|
package iface
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2020-09-09 20:29:17 +02:00
|
|
|
|
2023-03-17 11:52:56 -07:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/validator/keymanager"
|
|
|
|
remoteweb3signer "github.com/prysmaticlabs/prysm/v4/validator/keymanager/remote-web3signer"
|
2020-07-20 21:05:23 -05:00
|
|
|
)
|
|
|
|
|
2021-02-24 19:05:46 +01:00
|
|
|
// InitKeymanagerConfig defines configuration options for initializing a keymanager.
|
|
|
|
type InitKeymanagerConfig struct {
|
|
|
|
ListenForChanges bool
|
2022-06-27 15:34:38 +02:00
|
|
|
Web3SignerConfig *remoteweb3signer.SetupConfig
|
2021-02-24 19:05:46 +01:00
|
|
|
}
|
|
|
|
|
2020-07-20 21:05:23 -05:00
|
|
|
// Wallet defines a struct which has capabilities and knowledge of how
|
|
|
|
// to read and write important accounts-related files to the filesystem.
|
|
|
|
// Useful for keymanagers to have persistent capabilities for accounts on-disk.
|
|
|
|
type Wallet interface {
|
|
|
|
// Methods to retrieve wallet and accounts metadata.
|
|
|
|
AccountsDir() string
|
2020-08-31 14:46:45 -05:00
|
|
|
Password() string
|
2020-07-20 21:05:23 -05:00
|
|
|
// Read methods for important wallet and accounts-related files.
|
2020-07-21 00:06:11 -05:00
|
|
|
ReadFileAtPath(ctx context.Context, filePath string, fileName string) ([]byte, error)
|
2020-07-20 21:05:23 -05:00
|
|
|
// Write methods to persist important wallet and accounts-related files to disk.
|
|
|
|
WriteFileAtPath(ctx context.Context, pathName string, fileName string, data []byte) error
|
2020-09-09 20:29:17 +02:00
|
|
|
// Method for initializing a new keymanager.
|
2021-02-24 19:05:46 +01:00
|
|
|
InitializeKeymanager(ctx context.Context, cfg InitKeymanagerConfig) (keymanager.IKeymanager, error)
|
2020-07-20 21:05:23 -05:00
|
|
|
}
|