github.com/prysmaticlabs/prysm@v1.4.4/validator/accounts/iface/wallet.go (about) 1 package iface 2 3 import ( 4 "context" 5 6 "github.com/prysmaticlabs/prysm/validator/keymanager" 7 ) 8 9 // InitKeymanagerConfig defines configuration options for initializing a keymanager. 10 type InitKeymanagerConfig struct { 11 ListenForChanges bool 12 } 13 14 // Wallet defines a struct which has capabilities and knowledge of how 15 // to read and write important accounts-related files to the filesystem. 16 // Useful for keymanagers to have persistent capabilities for accounts on-disk. 17 type Wallet interface { 18 // Methods to retrieve wallet and accounts metadata. 19 AccountsDir() string 20 Password() string 21 // Read methods for important wallet and accounts-related files. 22 ReadFileAtPath(ctx context.Context, filePath string, fileName string) ([]byte, error) 23 // Write methods to persist important wallet and accounts-related files to disk. 24 WriteFileAtPath(ctx context.Context, pathName string, fileName string, data []byte) error 25 // Method for initializing a new keymanager. 26 InitializeKeymanager(ctx context.Context, cfg InitKeymanagerConfig) (keymanager.IKeymanager, error) 27 }