gui

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Unlicense Imports: 57 Imported by: 0

README

gui

This is the Parallelcoin Pod wallet GUI, built on a fork of gio and using a customised set of widgets and layouts from in the layout, widget and widget/material folders of that repository, where several additional widget types have been added, and mostly this is in sync with the mainline of the gio repository, though ultimately either they will be copying this, or gio will be completely forked as it uses a completely different programming idiom that doesn't aim at arbitrary abstract rules about composition of the code versus the state, because of the difficulty that the pure immediate mode programming model requires. This is because that idiom is extremely wordy and long winded and noisy and difficult to read, rearrange, and fix.

It has a run control system to launch the individual modules of the Parallelcoin Pod, including wallet, blockchain node, a CLI interface to these two modules.

Documentation

Index

Constants

View Source
const Break1 = 48
View Source
const ZeroAddress = "1111111111111111111114oLvT2"

Variables

View Source
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)

Functions

func Main

func Main(cx *state.State) (e error)

Main is the entrypoint for the wallet GUI

Types

type AddressEntry

type AddressEntry struct {
	Address  string     `json:"address"`
	Message  string     `json:"message,omitempty"`
	Label    string     `json:"label,omitempty"`
	Amount   amt.Amount `json:"amount"`
	Created  time.Time  `json:"created"`
	Modified time.Time  `json:"modified"`
	TxID     string     `json:txid,omitempty'`
}

type BoolMap

type BoolMap map[string]*gel.Bool

type CategoryFilter

type CategoryFilter struct {
	Send     bool
	Generate bool
	Immature bool
	Receive  bool
	Unknown  bool
}

CategoryFilter marks which transactions to omit from the filtered transaction list

func (*CategoryFilter) Filter

func (c *CategoryFilter) Filter(s string) (include bool)

type CheckableMap

type CheckableMap map[string]*gel.Checkable

type ClickableMap

type ClickableMap map[string]*gel.Clickable

type Console

type Console struct {
	*gel.Window
	// contains filtered or unexported fields
}

func (*Console) Fn

func (c *Console) Fn(gtx l.Context) l.Dimensions

func (*Console) JSONWidget

func (c *Console) JSONWidget(color string, j []byte) (out []l.Widget)

type IncDecMap

type IncDecMap map[string]*gel.IncDec

type Inputs

type Inputs map[string]*gel.Input

type JSONElement

type JSONElement struct {
	// contains filtered or unexported fields
}

type JSONElements

type JSONElements []JSONElement

func GetJSONElements

func GetJSONElements(in map[string]interface{}) (je JSONElements)

func (JSONElements) Len

func (je JSONElements) Len() int

func (JSONElements) Less

func (je JSONElements) Less(i, j int) bool

func (JSONElements) Swap

func (je JSONElements) Swap(i, j int)

type ListMap

type ListMap map[string]*gel.List

type Marshalled

type Marshalled struct {
	LastUpdated        time.Time
	BestBlockHeight    int32
	BestBlockHash      chainhash.Hash
	Balance            float64
	BalanceUnconfirmed float64
	AllTxs             []btcjson.ListTransactionsResult
	Filter             CategoryFilter
	ReceivingAddress   string
	ActivePage         string
	ReceiveAddressBook []AddressEntry
	SendAddressBook    []AddressEntry
}

func (*Marshalled) Unmarshal

func (m *Marshalled) Unmarshal(s *State)

type Passwords

type Passwords map[string]*gel.Password

type ReceivePage

type ReceivePage struct {
	// contains filtered or unexported fields
}

func (*ReceivePage) AddressbookHeader

func (rp *ReceivePage) AddressbookHeader() l.Widget

func (*ReceivePage) AmountInput

func (rp *ReceivePage) AmountInput() l.Widget

func (*ReceivePage) Fn

func (rp *ReceivePage) Fn(gtx l.Context) l.Dimensions

func (*ReceivePage) GetAddressbookHistoryCards

func (rp *ReceivePage) GetAddressbookHistoryCards(bg string) (widgets []l.Widget)

func (*ReceivePage) GetQRText

func (rp *ReceivePage) GetQRText() string

func (*ReceivePage) InputMessage

func (rp *ReceivePage) InputMessage() l.Widget

func (*ReceivePage) MediumList

func (rp *ReceivePage) MediumList(gtx l.Context) l.Dimensions

func (*ReceivePage) MessageInput

func (rp *ReceivePage) MessageInput() l.Widget

func (*ReceivePage) QRButton

func (rp *ReceivePage) QRButton() l.Widget

func (*ReceivePage) QRMessage

func (rp *ReceivePage) QRMessage() l.Widget

func (*ReceivePage) RegenerateButton

func (rp *ReceivePage) RegenerateButton() l.Widget

func (*ReceivePage) SmallList

func (rp *ReceivePage) SmallList(gtx l.Context) l.Dimensions

func (*ReceivePage) Spacer

func (rp *ReceivePage) Spacer() l.Widget

type SendPage

type SendPage struct {
	// contains filtered or unexported fields
}

func (*SendPage) AddressInput

func (sp *SendPage) AddressInput() l.Widget

func (*SendPage) AddressbookHeader

func (sp *SendPage) AddressbookHeader() l.Widget

func (*SendPage) AmountInput

func (sp *SendPage) AmountInput() l.Widget

func (*SendPage) Fn

func (sp *SendPage) Fn(gtx l.Context) l.Dimensions

func (*SendPage) GetAddressbookHistoryCards

func (sp *SendPage) GetAddressbookHistoryCards(bg string) (widgets []l.Widget)

func (*SendPage) InputMessage

func (sp *SendPage) InputMessage() l.Widget

func (*SendPage) MediumList

func (sp *SendPage) MediumList(gtx l.Context) l.Dimensions

func (*SendPage) MessageInput

func (sp *SendPage) MessageInput() l.Widget

func (*SendPage) PasteButton

func (sp *SendPage) PasteButton() l.Widget

func (*SendPage) SaveButton

func (sp *SendPage) SaveButton() l.Widget

func (*SendPage) SendButton

func (sp *SendPage) SendButton() l.Widget

func (*SendPage) SmallList

func (sp *SendPage) SmallList(gtx l.Context) l.Dimensions

type State

type State struct {
	// contains filtered or unexported fields
}

func GetNewState

func GetNewState(
	params *chaincfg.Params, activePage *uberatomic.String,
) *State

func (*State) ActivePage

func (s *State) ActivePage() string

func (*State) Balance

func (s *State) Balance() float64

func (*State) BalanceUnconfirmed

func (s *State) BalanceUnconfirmed() float64

func (*State) BestBlockHash

func (s *State) BestBlockHash() *chainhash.Hash

func (*State) BestBlockHeight

func (s *State) BestBlockHeight() int32

func (*State) BumpLastUpdated

func (s *State) BumpLastUpdated()

func (*State) Goroutines

func (s *State) Goroutines() []l.Widget

func (*State) IsReceivingAddress

func (s *State) IsReceivingAddress() bool

func (*State) LastUpdated

func (s *State) LastUpdated() time.Time

func (*State) Load

func (s *State) Load(filename string, pass []byte) (e error)

Load in the configuration from the specified file and decrypt using the given password

func (*State) Marshal

func (s *State) Marshal() (out *Marshalled)

func (*State) Save

func (s *State) Save(filename string, pass []byte, debug bool) (e error)

Save the state to the specified file

func (*State) SetActivePage

func (s *State) SetActivePage(page string)

func (*State) SetAllTxs

func (s *State) SetAllTxs(atxs []btcjson.ListTransactionsResult)

func (*State) SetBalance

func (s *State) SetBalance(total float64)

func (*State) SetBalanceUnconfirmed

func (s *State) SetBalanceUnconfirmed(unconfirmed float64)

func (*State) SetBestBlockHash

func (s *State) SetBestBlockHash(h *chainhash.Hash)

func (*State) SetBestBlockHeight

func (s *State) SetBestBlockHeight(height int32)

func (*State) SetGoroutines

func (s *State) SetGoroutines(gr []l.Widget)

func (*State) SetReceivingAddress

func (s *State) SetReceivingAddress(addr btcaddr.Address)

type WalletGUI

type WalletGUI struct {
	State *State

	ChainMutex, WalletMutex   sync.Mutex
	ChainClient, WalletClient *rpcclient.Client
	WalletWatcher             qu.C
	*gel.Window
	Size    *uberatomic.Int32
	MainApp *gel.App

	RecentTxsWidget, TxHistoryWidget l.Widget

	// ReceiveAddressbook l.Widget
	// SendAddressbook    l.Widget
	ReceivePage *ReceivePage
	SendPage    *SendPage
	// contains filtered or unexported fields
}

func (*WalletGUI) Advertise

func (wg *WalletGUI) Advertise() (e error)

func (*WalletGUI) ChainNotifications

func (wg *WalletGUI) ChainNotifications() *rpcclient.NotificationHandlers

func (*WalletGUI) ConsolePage

func (wg *WalletGUI) ConsolePage() *Console

func (*WalletGUI) CreateWalletPage

func (wg *WalletGUI) CreateWalletPage(gtx l.Context) l.Dimensions

func (*WalletGUI) GetAppWidget

func (wg *WalletGUI) GetAppWidget() (a *gel.App)

func (*WalletGUI) GetBools

func (wg *WalletGUI) GetBools() BoolMap

func (*WalletGUI) GetButtons

func (wg *WalletGUI) GetButtons()

func (*WalletGUI) GetCheckables

func (wg *WalletGUI) GetCheckables() CheckableMap

func (*WalletGUI) GetClickables

func (wg *WalletGUI) GetClickables() ClickableMap

func (*WalletGUI) GetIncDecs

func (wg *WalletGUI) GetIncDecs() IncDecMap

func (*WalletGUI) GetInputs

func (wg *WalletGUI) GetInputs() Inputs

func (*WalletGUI) GetLists

func (wg *WalletGUI) GetLists() (o ListMap)

func (*WalletGUI) GetNewReceivingAddress

func (wg *WalletGUI) GetNewReceivingAddress()

func (*WalletGUI) GetNewReceivingQRCode

func (wg *WalletGUI) GetNewReceivingQRCode(qrText string)

func (*WalletGUI) GetPasswords

func (wg *WalletGUI) GetPasswords() (passwords Passwords)

GetPasswords returns the passwords used in the wallet GUI

func (*WalletGUI) GetReceivePage

func (wg *WalletGUI) GetReceivePage() (rp *ReceivePage)

func (*WalletGUI) GetRunUnit

func (wg *WalletGUI) GetRunUnit(
	name string, before, after func(), args ...string,
) *rununit.RunUnit

func (*WalletGUI) GetSendPage

func (wg *WalletGUI) GetSendPage() (sp *SendPage)

func (*WalletGUI) HelpPage

func (wg *WalletGUI) HelpPage() func(gtx l.Context) l.Dimensions

func (*WalletGUI) HistoryPage

func (wg *WalletGUI) HistoryPage() l.Widget

func (*WalletGUI) HistoryPageStatusFilter

func (wg *WalletGUI) HistoryPageStatusFilter() l.Widget

func (*WalletGUI) HistoryPageView

func (wg *WalletGUI) HistoryPageView() l.Widget

func (*WalletGUI) OverviewPage

func (wg *WalletGUI) OverviewPage() l.Widget

func (*WalletGUI) Page

func (wg *WalletGUI) Page(
	title string, widget gel.Widgets,
) func(gtx l.Context) l.Dimensions

func (*WalletGUI) PageTopBarButton

func (wg *WalletGUI) PageTopBarButton(
	name string, index int, ico *[]byte, onClick func(string), app *gel.App,
	highlightColor string,
) func(gtx l.Context) l.Dimensions

func (*WalletGUI) RecentTransactions

func (wg *WalletGUI) RecentTransactions(n int, listName string) l.Widget

RecentTransactions generates a display showing recent transactions

fields to use: Address, Amount, BlockIndex, BlockTime, Category, Confirmations, Generated

func (*WalletGUI) Run

func (wg *WalletGUI) Run() (e error)

func (*WalletGUI) RunStatusPanel

func (wg *WalletGUI) RunStatusPanel(gtx l.Context) l.Dimensions

func (*WalletGUI) SetNodeRunState

func (wg *WalletGUI) SetNodeRunState(b bool)

func (*WalletGUI) SetWalletRunState

func (wg *WalletGUI) SetWalletRunState(b bool)

func (*WalletGUI) ShuffleSeed

func (wg *WalletGUI) ShuffleSeed()

func (*WalletGUI) SideBarButton

func (wg *WalletGUI) SideBarButton(
	title, page string, index int,
) func(gtx l.Context) l.Dimensions

func (*WalletGUI) StatusBarButton

func (wg *WalletGUI) StatusBarButton(
	name string,
	index int,
	ico *[]byte,
	onClick func(string),
	app *gel.App,
) func(gtx l.Context) l.Dimensions

func (*WalletGUI) WalletAndClientRunning

func (wg *WalletGUI) WalletAndClientRunning() bool

func (*WalletGUI) WalletNotifications

func (wg *WalletGUI) WalletNotifications() *rpcclient.NotificationHandlers

func (*WalletGUI) Watcher

func (wg *WalletGUI) Watcher() qu.C

Watcher keeps the chain and wallet and rpc clients connected

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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