Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ConfigPath the path of the Keystore V3 wallet path ConfigPath = "path" // ConfigFilenamesWith0xPrefix whether or not to use the 0x prefix on filenames, when using passwordExt password ConfigFilenamesWith0xPrefix = "filenames.with0xPrefix" // ConfigFilenamesPrimaryExt extension to append to the "from" address string to find the file (see metadata section for file types). All filenames must be lower case on disk. ConfigFilenamesPrimaryExt = "filenames.primaryExt" // ConfigFilenamesPrimaryMatchRegex allows filenames where the address can be extracted with a regular expression. Takes precedence over primaryExt ConfigFilenamesPrimaryMatchRegex = "filenames.primaryMatchRegex" // ConfigFilenamesPasswordExt extension to append to the "from" address string to find the password file (if not using a metadata file to specify the password file) ConfigFilenamesPasswordExt = "filenames.passwordExt" // ConfigFilenamesPasswordPath directory path where the password files should be found - default is the same path as the primary file ConfigFilenamesPasswordPath = "filenames.passwordPath" // ConfigFilenamesPasswordTrimSpace whether to trim whitespace from passwords loaded from files (such as trailing newline characters) ConfigFilenamesPasswordTrimSpace = "filenames.passwordTrimSpace" // ConfigDefaultPasswordFile default password file to use if neither the metadata, or passwordExtension find a password ConfigDefaultPasswordFile = "defaultPasswordFile" // ConfigDisableListener disable the filesystem listener that detects newly added keys automatically ConfigDisableListener = "disableListener" // ConfigSignerCacheSize the number of signing keys to keep in memory ConfigSignerCacheSize = "signerCacheSize" // ConfigSignerCacheTTL the time to keep an unused signing key in memory ConfigSignerCacheTTL = "signerCacheTTL" // ConfigMetadataFormat format to parse the metadata - supported: auto (from extension) / filename / toml / yaml / json (please quote "0x..." strings in YAML) ConfigMetadataFormat = "metadata.format" // ConfigMetadataKeyFileProperty use for toml/yaml/json to find the name of the file containing the keystorev3 file ConfigMetadataKeyFileProperty = "metadata.keyFileProperty" // ConfigMetadataPasswordFileProperty use for toml/yaml to find the name of the file containing the keystorev3 file ConfigMetadataPasswordFileProperty = "metadata.passwordFileProperty" )
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
Types ¶
type Config ¶
type Config struct {
Path string
DefaultPasswordFile string
SignerCacheSize string
SignerCacheTTL string
DisableListener bool
Filenames FilenamesConfig
Metadata MetadataConfig
}
func ReadConfig ¶
type ConfigGeneric ¶
type FilenamesConfig ¶
type MetadataConfig ¶
type SyncAddressCallback ¶
type SyncAddressCallback func(context.Context, ethtypes.Address0xHex) error
type Wallet ¶
type Wallet interface {
ethsigner.WalletTypedData
GetWalletFile(ctx context.Context, addr ethtypes.Address0xHex) (keystorev3.WalletFile, error)
SetSyncAddressCallback(SyncAddressCallback)
AddListener(listener chan<- ethtypes.Address0xHex)
}
This is a wrapper on the WalletStrIDs capability, that requires all lookups to keys to be ethereum addresses, and adds some other ethereum specific functionality.
Originally this library only provided this utility, and later we made the concept of an address more generic.
func NewFilesystemWallet ¶
type WalletGeneric ¶
type WalletGeneric interface {
Initialize(ctx context.Context) error
Refresh(ctx context.Context) error
Close() error
GetAccounts(ctx context.Context) ([]string, error)
GetWalletFile(ctx context.Context, addr string) (keystorev3.WalletFile, error)
SetSyncCallback(SyncCallback)
AddListener(listener chan<- string)
}
Wallet is a directory containing a set of KeystoreV3 files, conforming to the ethsigner.Wallet interface and providing notifications when new keys are added to the wallet (via FS listener).
func NewFilesystemWalletGeneric ¶
func NewFilesystemWalletGeneric(ctx context.Context, conf *ConfigGeneric, initialListeners ...chan<- string) (ww WalletGeneric, err error)
Click to show internal directories.
Click to hide internal directories.