prompt

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlreadyListeningErr = "prompter is already listening"
)
View Source
const (
	TIMEOUT = 1 * time.Minute
)

Variables

This section is empty.

Functions

func InputTypeError

func InputTypeError(prompterApp WalletPrompterInterface) error

func NewEnvPrompter

func NewEnvPrompter(app *walletapp.WalletApp) *envPrompter

func WakeUpPrompt

func WakeUpPrompt(
	prompterApp WalletPrompterInterface,
	req PromptRequest,
	acc *account.Account,
) (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
	CorrelationID string
}

type WalletPrompter

type WalletPrompter struct {
	PromptLocker
}

WalletPrompter is a struct that wraps a Wails GUI application and implements the WalletPrompterInterface 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.

Jump to

Keyboard shortcuts

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