view

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TransactionListLimit is the length limit of transaction list
	TransactionListLimit = 1000
)

Variables

This section is empty.

Functions

func Inc

func Inc(i *int) int

func InitKeymap

func InitKeymap(p KeymapPrimitive, app *App)

func IsControlKey

func IsControlKey(evt *tcell.EventKey) bool

IsControlKey returns true if the key is a control key.

func StyledAccountType

func StyledAccountType(t serv.AccountType) string

func StyledNetworkName

func StyledNetworkName(n serv.Network) string

func StyledTxnDirection

func StyledTxnDirection(base *common.Address, txn common.Transaction) string

Types

type Account

type Account struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(app *App) *Account

func (*Account) Draw

func (a *Account) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*Account) HasFocus

func (a *Account) HasFocus() bool

HasFocus implements tview.Primitive

func (*Account) InputHandler

func (a *Account) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler implements tview.Primitive

func (*Account) KeyMaps

func (a *Account) KeyMaps() util.KeyMaps

func (*Account) SetAccount

func (a *Account) SetAccount(account *serv.Account)

func (*Account) SetRect

func (a *Account) SetRect(x int, y int, width int, height int)

SetRect implements tview.SetRect

func (*Account) ShowImportABIDialog

func (a *Account) ShowImportABIDialog()

func (*Account) ShowMethodCallDialog

func (a *Account) ShowMethodCallDialog()

type AccountInfo

type AccountInfo struct {
	*tview.Flex
	// contains filtered or unexported fields
}

type App

type App struct {
	*tview.Application
	// contains filtered or unexported fields
}

func NewApp

func NewApp(config *conf.Config) *App

func (*App) Start

func (a *App) Start() error

type CallData added in v0.2.0

type CallData struct {
	*tview.Table
	// contains filtered or unexported fields
}

func NewCalldata added in v0.2.0

func NewCalldata(app *App) *CallData

func (*CallData) Clear added in v0.2.0

func (c *CallData) Clear()

func (*CallData) Draw added in v0.2.0

func (c *CallData) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*CallData) LoadAsync added in v0.2.0

func (c *CallData) LoadAsync(address *common.Address, data []byte)

func (*CallData) SetRect added in v0.2.0

func (c *CallData) SetRect(x int, y int, width int, height int)

SetRect implements tview.SetRect

type ChainInfo

type ChainInfo struct {
	*tview.Table
	// contains filtered or unexported fields
}

func NewChainInfo

func NewChainInfo(app *App) *ChainInfo

func (*ChainInfo) SetEthPrice

func (ci *ChainInfo) SetEthPrice(price decimal.Decimal)

func (*ChainInfo) SetGasPrice

func (ci *ChainInfo) SetGasPrice(gasPrice common.BigInt)

func (*ChainInfo) SetHeight

func (ci *ChainInfo) SetHeight(height uint64)

func (*ChainInfo) SetNetwork

func (ci *ChainInfo) SetNetwork(network string)

type Help

type Help struct {
	*tview.Table
	// contains filtered or unexported fields
}

func NewHelp

func NewHelp(app *App) *Help

func (*Help) AddKeyMaps

func (h *Help) AddKeyMaps(keymaps util.KeyMaps)

func (*Help) Clear

func (h *Help) Clear()

func (*Help) SetKeyMaps

func (h *Help) SetKeyMaps(keymaps util.KeyMaps)

type Home

type Home struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewHome

func NewHome(app *App) *Home

func (*Home) KeyMaps

func (h *Home) KeyMaps() util.KeyMaps

KeyMaps implements bodyPage

type ImportABIDialog

type ImportABIDialog struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewImportABIDialog

func NewImportABIDialog(app *App) *ImportABIDialog

func (*ImportABIDialog) Clear

func (d *ImportABIDialog) Clear()

func (*ImportABIDialog) Display

func (d *ImportABIDialog) Display(display bool)

func (*ImportABIDialog) Draw

func (d *ImportABIDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*ImportABIDialog) Hide

func (d *ImportABIDialog) Hide()

func (*ImportABIDialog) IsDisplay

func (d *ImportABIDialog) IsDisplay() bool

func (*ImportABIDialog) KeyMaps

func (d *ImportABIDialog) KeyMaps() util.KeyMaps

KeyMaps implements KeymapPrimitive

func (*ImportABIDialog) SetCentral

func (d *ImportABIDialog) SetCentral(x int, y int, width int, height int)

func (*ImportABIDialog) Show

func (d *ImportABIDialog) Show()

type KeymapPrimitive

type KeymapPrimitive interface {
	SetInputCapture(capture func(event *tcell.EventKey) *tcell.EventKey) *tview.Box

	KeyMaps() util.KeyMaps
}

type MethodCallDialog

type MethodCallDialog struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewMethodCallDialog

func NewMethodCallDialog(app *App) *MethodCallDialog

func (*MethodCallDialog) Clear

func (d *MethodCallDialog) Clear()

func (*MethodCallDialog) Display

func (d *MethodCallDialog) Display(display bool)

func (*MethodCallDialog) Draw

func (d *MethodCallDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*MethodCallDialog) Focus

func (d *MethodCallDialog) Focus(delegate func(p tview.Primitive))

Focus implements tview.Focus

func (*MethodCallDialog) Hide

func (d *MethodCallDialog) Hide()

func (*MethodCallDialog) IsDisplay

func (d *MethodCallDialog) IsDisplay() bool

func (*MethodCallDialog) SetCentral

func (d *MethodCallDialog) SetCentral(x int, y int, width int, height int)

func (*MethodCallDialog) SetContract

func (d *MethodCallDialog) SetContract(contract *service.Contract)

func (*MethodCallDialog) Show

func (d *MethodCallDialog) Show()

type Notification

type Notification struct {
	*tview.TextView
	// contains filtered or unexported fields
}

func NewNotification

func NewNotification(app *App) *Notification

func (*Notification) Display

func (n *Notification) Display(display bool)

func (*Notification) Draw

func (n *Notification) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*Notification) Hide

func (n *Notification) Hide()

func (*Notification) IsDisplay

func (n *Notification) IsDisplay() bool

func (*Notification) KeyMaps

func (n *Notification) KeyMaps() util.KeyMaps

KeyMaps implements KeymapPrimitive

func (*Notification) SetCentral

func (n *Notification) SetCentral(x int, y int, width int, height int)

func (*Notification) SetContent

func (n *Notification) SetContent(title string, text string)

func (*Notification) Show

func (n *Notification) Show()

type QueryDialog

type QueryDialog struct {
	*tview.InputField
	// contains filtered or unexported fields
}

func NewQueryDialog

func NewQueryDialog(app *App) *QueryDialog

func (*QueryDialog) Clear

func (d *QueryDialog) Clear()

func (*QueryDialog) Display

func (d *QueryDialog) Display(display bool)

func (*QueryDialog) Draw

func (d *QueryDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*QueryDialog) Finished

func (d *QueryDialog) Finished()

Finished will stop and hide spinner, as well as close current dialog

func (*QueryDialog) Hide

func (d *QueryDialog) Hide()

func (*QueryDialog) IsDisplay

func (d *QueryDialog) IsDisplay() bool

func (*QueryDialog) Loading

func (d *QueryDialog) Loading()

Loading will set the location of spinner and show it

func (*QueryDialog) SetCentral

func (d *QueryDialog) SetCentral(x int, y int, width int, height int)

func (*QueryDialog) Show

func (d *QueryDialog) Show()

type Root

type Root struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewRoot

func NewRoot(app *App) *Root

func (*Root) Draw

func (r *Root) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*Root) HasFocus

func (r *Root) HasFocus() bool

HasFocus implements tview.Primitive

func (*Root) InputHandler

func (r *Root) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler implements tview.Primitive

func (*Root) KeyMaps

func (r *Root) KeyMaps() util.KeyMaps

func (*Root) NotifyError

func (r *Root) NotifyError(errmsg string)

func (*Root) NotifyInfo

func (r *Root) NotifyInfo(message string)

func (*Root) SetRect

func (r *Root) SetRect(x int, y int, width int, height int)

SetRect implements tview.SetRect

func (*Root) ShowAccountPage

func (r *Root) ShowAccountPage(account *service.Account)

func (*Root) ShowHomePage

func (r *Root) ShowHomePage()

func (*Root) ShowNotification

func (r *Root) ShowNotification(title string, text string)

func (*Root) ShowQueryDialog

func (r *Root) ShowQueryDialog()

func (*Root) ShowSignInDialog

func (r *Root) ShowSignInDialog()

func (*Root) ShowTransactionPage

func (r *Root) ShowTransactionPage(transaction common.Transaction)

func (*Root) ShowTransferDialog

func (r *Root) ShowTransferDialog()

func (*Root) SignIn

func (r *Root) SignIn(signer *service.Signer)

type SenderFormItem

type SenderFormItem struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewSenderFormItem

func NewSenderFormItem(app *App) *SenderFormItem

func (*SenderFormItem) Focus

func (s *SenderFormItem) Focus(delegate func(p tview.Primitive))

Focus implements tview.Primitive

func (*SenderFormItem) GetFieldHeight

func (s *SenderFormItem) GetFieldHeight() int

GetFieldHeight implements tview.FormItem

func (*SenderFormItem) GetFieldWidth

func (s *SenderFormItem) GetFieldWidth() int

GetFieldWidth implements tview.FormItem

func (*SenderFormItem) GetLabel

func (s *SenderFormItem) GetLabel() string

GetLabel implements tview.FormItem

func (*SenderFormItem) SetFinishedFunc

func (s *SenderFormItem) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc implements tview.FormItem

func (*SenderFormItem) SetFormAttributes

func (s *SenderFormItem) SetFormAttributes(labelWidth int, labelColor tcell.Color, bgColor tcell.Color, fieldTextColor tcell.Color, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes implements tview.FormItem

func (*SenderFormItem) SetSender

func (s *SenderFormItem) SetSender(account *service.Signer)

type SignInDialog

type SignInDialog struct {
	*tview.InputField
	// contains filtered or unexported fields
}

func NewSignInDialog

func NewSignInDialog(app *App) *SignInDialog

func (*SignInDialog) Clear

func (d *SignInDialog) Clear()

func (*SignInDialog) Display

func (d *SignInDialog) Display(display bool)

func (*SignInDialog) Draw

func (d *SignInDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*SignInDialog) Finished

func (d *SignInDialog) Finished()

Finished will stop and hide spinner, as well as close current dialog

func (*SignInDialog) Hide

func (d *SignInDialog) Hide()

func (*SignInDialog) IsDisplay

func (d *SignInDialog) IsDisplay() bool

func (*SignInDialog) Loading

func (d *SignInDialog) Loading()

Loading will set the location of spinner and show it

func (*SignInDialog) SetCentral

func (d *SignInDialog) SetCentral(x int, y int, width int, height int)

func (*SignInDialog) Show

func (d *SignInDialog) Show()

type Signer

type Signer struct {
	tview.Primitive
	// contains filtered or unexported fields
}

func NewSigner

func NewSigner(app *App) *Signer

func (*Signer) GetSigner

func (si *Signer) GetSigner() *service.Signer

func (*Signer) HasSignedIn

func (si *Signer) HasSignedIn() bool

func (*Signer) SetSigner

func (si *Signer) SetSigner(signer *service.Signer)

type TransactionDetail

type TransactionDetail struct {
	*tview.Flex
	// contains filtered or unexported fields
}

func NewTransactionDetail

func NewTransactionDetail(app *App) *TransactionDetail

func (*TransactionDetail) KeyMaps

func (t *TransactionDetail) KeyMaps() util.KeyMaps

func (*TransactionDetail) SetTransaction

func (t *TransactionDetail) SetTransaction(transaction common.Transaction)

func (*TransactionDetail) ViewReceiver added in v0.2.0

func (t *TransactionDetail) ViewReceiver()

func (*TransactionDetail) ViewSender added in v0.2.0

func (t *TransactionDetail) ViewSender()

type TransactionList

type TransactionList struct {
	*tview.Table
	// contains filtered or unexported fields
}

func NewTransactionList

func NewTransactionList(app *App, showInOut bool) *TransactionList

func (*TransactionList) Clear

func (t *TransactionList) Clear()

func (*TransactionList) Draw

func (t *TransactionList) Draw(screen tcell.Screen)

Draw implements tview.Draw

func (*TransactionList) FilterAndPrependTransactions

func (t *TransactionList) FilterAndPrependTransactions(txns common.Transactions)

FilterAndPrependTransactions is like PrependTransactions, but filters out transactions that are not related to the base account

func (*TransactionList) HasFocus added in v0.2.0

func (t *TransactionList) HasFocus() bool

HasFocus implements tview.Primitive

func (*TransactionList) InputHandler added in v0.2.0

func (t *TransactionList) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler implements tview.Primitive

func (*TransactionList) KeyMaps added in v0.2.0

func (t *TransactionList) KeyMaps() util.KeyMaps

func (*TransactionList) LoadAsync

func (t *TransactionList) LoadAsync(loader func() (common.Transactions, error))

LoadAsync loads transactions asynchronously

func (*TransactionList) PrependTransactions

func (t *TransactionList) PrependTransactions(txns common.Transactions)

PrependTransactions prepends transactions to existing transactions

func (*TransactionList) SetBaseAccount

func (t *TransactionList) SetBaseAccount(account *common.Address)

SetBaseAccount sets the base account to determine whether a transaction is inflow or outflow

func (*TransactionList) SetRect

func (t *TransactionList) SetRect(x, y, width, height int)

SetRect implements tview.SetRect

func (*TransactionList) SetTransactions

func (t *TransactionList) SetTransactions(txns common.Transactions)

SetTransactions sets a transaction list

func (*TransactionList) ViewReceiver added in v0.2.0

func (t *TransactionList) ViewReceiver()

ViewReceiver jumps to the receiver's account page

func (*TransactionList) ViewSender added in v0.2.0

func (t *TransactionList) ViewSender()

ViewSender jumps to the sender's account page

type TransferDialog

type TransferDialog struct {
	*tview.Form
	// contains filtered or unexported fields
}

func NewTransferDialog

func NewTransferDialog(app *App) *TransferDialog

func (*TransferDialog) ClearAndRefresh

func (d *TransferDialog) ClearAndRefresh()

func (*TransferDialog) Display

func (d *TransferDialog) Display(display bool)

func (*TransferDialog) Draw

func (d *TransferDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*TransferDialog) Hide

func (d *TransferDialog) Hide()

func (*TransferDialog) IsDisplay

func (d *TransferDialog) IsDisplay() bool

func (*TransferDialog) KeyMaps

func (d *TransferDialog) KeyMaps() util.KeyMaps

KeyMaps implements KeymapPrimitive

func (*TransferDialog) SetCentral

func (d *TransferDialog) SetCentral(x int, y int, width int, height int)

func (*TransferDialog) SetSender

func (d *TransferDialog) SetSender(account *service.Signer)

func (*TransferDialog) Show

func (d *TransferDialog) Show()

type TxnPreviewDialog added in v0.2.0

type TxnPreviewDialog struct {
	*TransactionDetail
	// contains filtered or unexported fields
}

func NewTxnPreviewDialog added in v0.2.0

func NewTxnPreviewDialog(app *App) *TxnPreviewDialog

func (*TxnPreviewDialog) Display added in v0.2.0

func (d *TxnPreviewDialog) Display(display bool)

func (*TxnPreviewDialog) Draw added in v0.2.0

func (d *TxnPreviewDialog) Draw(screen tcell.Screen)

Draw implements tview.Primitive

func (*TxnPreviewDialog) Hide added in v0.2.0

func (d *TxnPreviewDialog) Hide()

func (*TxnPreviewDialog) IsDisplay added in v0.2.0

func (d *TxnPreviewDialog) IsDisplay() bool

func (*TxnPreviewDialog) KeyMaps added in v0.2.0

func (d *TxnPreviewDialog) KeyMaps() util.KeyMaps

KeyMaps implements KeymapPrimitive

func (*TxnPreviewDialog) SetCentral added in v0.2.0

func (d *TxnPreviewDialog) SetCentral(x int, y int, width int, height int)

func (*TxnPreviewDialog) Show added in v0.2.0

func (d *TxnPreviewDialog) Show()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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