Documentation ¶
Index ¶
- Constants
- func InputTypeError(prompterApp WalletPrompterInterface) error
- func NewEnvPrompter(app *walletapp.WalletApp) *envPrompter
- func WakeUpPrompt(prompterApp WalletPrompterInterface, req PromptRequest, wallet *wallet.Wallet) (interface{}, error)
- type BackupMethod
- type PromptLocker
- type PromptRequest
- type WalletPrompter
- type WalletPrompterInterface
Constants ¶
View Source
const ( InvalidAccountFileErr = "invalid account file" AccountLoadErr = "unable to load account file" ImportPrivateKeyErr = "unable to import private key" ActionCanceledErr = "Action canceled by user" TimeoutErr = "Password prompt reached timeout" PasswordLengthErr = "password length must be %d characters minimum" UnprotectErr = "error unprotecting wallet" InputTypeErr = "Invalid prompt input type" AlreadyListeningErr = "prompter is already listening" )
View Source
const PASSWORD_MIN_LENGTH = 5
View Source
const TIMEOUT = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
func InputTypeError ¶
func InputTypeError(prompterApp WalletPrompterInterface) error
func NewEnvPrompter ¶
func WakeUpPrompt ¶
func WakeUpPrompt( prompterApp WalletPrompterInterface, req PromptRequest, wallet *wallet.Wallet, ) (interface{}, error)
Types ¶
type BackupMethod ¶
type BackupMethod string
const ( YamlFileBackup BackupMethod = "yaml" PrivateKeyBackup BackupMethod = "privateKey" )
type PromptLocker ¶
type PromptLocker struct { PromptApp *walletapp.WalletApp // contains filtered or unexported fields }
func (*PromptLocker) App ¶
func (w *PromptLocker) App() *walletapp.WalletApp
func (*PromptLocker) IsListening ¶
func (w *PromptLocker) IsListening() bool
func (*PromptLocker) Lock ¶
func (w *PromptLocker) Lock()
func (*PromptLocker) Unlock ¶
func (w *PromptLocker) Unlock()
type PromptRequest ¶
type PromptRequest struct { Action walletapp.PromptRequestAction Msg string Data interface{} CodeMessage string }
type WalletPrompter ¶
type WalletPrompter struct {
PromptLocker
}
WalletPrompter is a struct that wraps a Fyne GUI application and implements the delete.Confirmer interface.
func NewWalletPrompter ¶
func NewWalletPrompter(app *walletapp.WalletApp) *WalletPrompter
func (*WalletPrompter) EmitEvent ¶
func (w *WalletPrompter) EmitEvent(eventId string, data walletapp.EventData)
func (*WalletPrompter) PromptRequest ¶
func (w *WalletPrompter) PromptRequest(req PromptRequest)
func (*WalletPrompter) SelectBackupFilepath ¶
func (w *WalletPrompter) SelectBackupFilepath(nickname string) (string, error)
type WalletPrompterInterface ¶
type WalletPrompterInterface interface { PromptRequest(req PromptRequest) EmitEvent(eventId string, data walletapp.EventData) App() *walletapp.WalletApp IsListening() bool Unlock() Lock() SelectBackupFilepath(nickname string) (string, error) }
WalletPrompterInterface is used to mock the WalletPrompter struct in tests.
Click to show internal directories.
Click to hide internal directories.