walletapp

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PromptResultEvent  string = "promptResult"
	PromptDataEvent    string = "promptData"
	PromptRequestEvent string = "promptRequest"
)

Variables

This section is empty.

Functions

func IsTestMode

func IsTestMode() bool

Types

type BaseMessage added in v0.3.2

type BaseMessage struct {
	CorrelationID string
}

BaseMessage contains the common CorrelationID attribute

func (*BaseMessage) GetCorrelationID added in v0.3.2

func (m *BaseMessage) GetCorrelationID() string

GetCorrelationID retrieves the CorrelationID from the BaseMessage struct

type CorrelationIdentifier added in v0.3.2

type CorrelationIdentifier interface {
	GetCorrelationID() string
}

CorrelationIdentifier interface that all message types will implement

type EventData

type EventData struct {
	Success     bool
	CodeMessage string
	Data        interface{}
}

type ImportPKeyPromptInput added in v0.3.2

type ImportPKeyPromptInput struct {
	BaseMessage
	PrivateKey *memguard.LockedBuffer
	Password   *memguard.LockedBuffer
	Nickname   string
}

type PromptCtrl

type PromptCtrl int
const (
	Cancel PromptCtrl = iota
)

type PromptRequestAction

type PromptRequestAction int
const (
	Delete PromptRequestAction = iota
	NewPassword
	Sign
	Import
	Backup
	TradeRolls
	Unprotect
)

type SignPromptInput added in v0.2.9

type SignPromptInput struct {
	BaseMessage
	Password string
	Fees     string
}

type SignPromptOutput added in v0.2.9

type SignPromptOutput struct {
	Password *memguard.LockedBuffer
	Fees     uint64
}

type StringPromptInput added in v0.3.2

type StringPromptInput struct {
	BaseMessage
	Message string
}

type WalletApp

type WalletApp struct {
	Ctx         context.Context
	CtrlChan    chan PromptCtrl
	PromptInput chan CorrelationIdentifier
	Wallet      *wallet.Wallet
	Shutdown    bool
	IsListening bool
}

func NewWalletApp

func NewWalletApp(wallet *wallet.Wallet) *WalletApp

func (*WalletApp) AbortAction

func (a *WalletApp) AbortAction()

AbortAction sends a cancel message to the prompt

func (*WalletApp) BeforeClose

func (a *WalletApp) BeforeClose(ctx context.Context) bool

func (*WalletApp) Hide

func (a *WalletApp) Hide()

func (*WalletApp) IsNicknameUnique

func (a *WalletApp) IsNicknameUnique(nickname string) bool

func (*WalletApp) IsNicknameValid

func (a *WalletApp) IsNicknameValid(nickname string) bool

func (*WalletApp) SelectAccountFile

func (a *WalletApp) SelectAccountFile() selectFileResult

func (*WalletApp) SendPKeyPromptInput added in v0.3.2

func (a *WalletApp) SendPKeyPromptInput(privateKeyText string, nickname string, password string, correlationID string)

func (*WalletApp) SendPromptInput

func (a *WalletApp) SendPromptInput(input string, correlationID string)

func (*WalletApp) SendSignPromptInput added in v0.2.9

func (a *WalletApp) SendSignPromptInput(password string, fees string, correlationID string)

func (*WalletApp) Show

func (a *WalletApp) Show()

func (*WalletApp) Startup

func (a *WalletApp) Startup(ctx context.Context)

startup is called when the app starts. The context is saved so we can call the runtime methods

Jump to

Keyboard shortcuts

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