Documentation ¶
Index ¶
- Constants
- func CoinImageBySymbol(l *load.Load, assetType libutils.AssetType, isWatchOnly bool) *cryptomaterial.Image
- func ConditionalFlexedRigidLayout(flexWeight float32, isMobileView bool, content layout.Widget) layout.FlexChild
- func ContextDone(ctx context.Context) bool
- func DisableLog()
- func FormatDateOrTime(timestamp int64) string
- func GetBackButton(l *load.Load) cryptomaterial.IconButton
- func GetServerIcon(theme *cryptomaterial.Theme, serverName string) *cryptomaterial.Image
- func GetTicketPurchaseAccount(selectedWallet *dcr.Asset) (acct *sharedW.Account, err error)
- func GoToURL(url string)
- func HorizontalInset(v unit.Dp) layout.Inset
- func IconButton(icon *widget.Icon, txt string, inset layout.Inset, th *cryptomaterial.Theme, ...) func(gtx C) D
- func InputsNotEmpty(editors ...*widget.Editor) bool
- func LayoutBalance(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceColor(gtx layout.Context, l *load.Load, amount string, color color.NRGBA) layout.Dimensions
- func LayoutBalanceColorWithState(gtx layout.Context, l *load.Load, amount string, color color.NRGBA) layout.Dimensions
- func LayoutBalanceColorWithStateUSD(gtx layout.Context, l *load.Load, amount string, color color.NRGBA) layout.Dimensions
- func LayoutBalanceCustom(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Sp, ...) layout.Dimensions
- func LayoutBalanceSize(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Sp) layout.Dimensions
- func LayoutBalanceWithState(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceWithStateSemiBold(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceWithStateUSD(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceWithUnit(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceWithUnitSize(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Sp) layout.Dimensions
- func LayoutBalanceWithUnitSizeBoldText(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Sp) layout.Dimensions
- func LayoutNavigationBar(gtx layout.Context, theme *cryptomaterial.Theme, navItems []NavBarItem) layout.Dimensions
- func LoadOrders(l *load.Load, offset, limit int32, newestFirst bool, server, searchKey string, ...) []*instantswap.Order
- func RetryFunc(retryAttempts int, sleepDur time.Duration, funcDesc string, ...) (int, error)
- func SecondsToDays(totalTimeLeft int64) string
- func SeedWordsToHex(seedWords string) (string, error)
- func SubpageHeaderButtons(l *load.Load) (cryptomaterial.IconButton, cryptomaterial.IconButton)
- func TimeAgo(timestamp int64) string
- func TimeFormat(secs int, long bool) string
- func TruncateString(str string, num int) string
- func TxConfirmations(wallet sharedW.Asset, transaction *sharedW.Transaction) int32
- func TxPageDropDownFields(wType libutils.AssetType, tabIndex int) (mapInfo map[string]int32, keysInfo []string)
- func UseLogger(logger slog.Logger)
- func VerticalInset(v unit.Dp) layout.Inset
- type AssetTypeItem
- type AssetTypeSelector
- func (ats *AssetTypeSelector) AssetTypeSelected(callback func(*AssetTypeItem) bool) *AssetTypeSelector
- func (ats *AssetTypeSelector) DisableBorder() *AssetTypeSelector
- func (ats *AssetTypeSelector) Handle(window app.WindowNavigator)
- func (ats *AssetTypeSelector) Layout(window app.WindowNavigator, gtx C) D
- func (atm AssetTypeSelector) OnDismiss()
- func (atm AssetTypeSelector) OnResume()
- func (ats *AssetTypeSelector) SelectedAssetType() *libutils.AssetType
- func (ats *AssetTypeSelector) SetBackground(background color.NRGBA) *AssetTypeSelector
- func (ats *AssetTypeSelector) SetHint(hint string) *AssetTypeSelector
- func (ats *AssetTypeSelector) SetSelectedAssetType(assetType libutils.AssetType)
- func (ats *AssetTypeSelector) SupportedAssetTypes() []*AssetTypeItem
- func (ats *AssetTypeSelector) Title(title string) *AssetTypeSelector
- type BottomNavigationBar
- type BottomNavigationBarHandler
- type C
- type ConsensusItem
- type Container
- type CreateWallet
- type CummulativeWalletsBalance
- type D
- func AgendaItemWidget(gtx C, l *load.Load, consensusItem *ConsensusItem, hasVotingWallet bool) D
- func BrowserURLWidget(gtx C, l *load.Load, url string, copyRedirect *cryptomaterial.Clickable) D
- func DisablePageWithOverlay(l *load.Load, currentPage app.Page, gtx C, title, subtitle string, ...) D
- func EndToEndRow(gtx C, leftWidget, rightWidget func(C) D) D
- func FlexLayout(gtx C, options FlexOptions, widgets []func(gtx C) D) D
- func LayoutIconAndTextWithSize(l *load.Load, gtx C, text string, col color.NRGBA, size unit.Sp, ...) D
- func LayoutNoAgendasFound(gtx C, l *load.Load, syncing bool) D
- func LayoutNoOrderHistoryWithMsg(gtx C, l *load.Load, syncing bool, msg string) D
- func LayoutNoPoliciesFound(gtx C, l *load.Load, syncing bool) D
- func LayoutNoProposalsFound(gtx C, l *load.Load, syncing bool, category int32) D
- func LayoutOrderAmount(l *load.Load, gtx C, assetType string, amount float64) D
- func LayoutTransactionRow(gtx C, l *load.Load, wal sharedW.Asset, tx *sharedW.Transaction, ...) D
- func OrderItemWidget(gtx C, l *load.Load, orderItem *instantswap.Order) D
- func ProposalsList(gtx C, l *load.Load, prop *ProposalItem) D
- func SetWalletLogo(l *load.Load, gtx C, assetType libutils.AssetType, size unit.Dp) D
- func TreasuryItemWidget(gtx C, l *load.Load, treasuryItem *TreasuryItem) D
- func UniformHorizontalPadding(gtx C, body layout.Widget) D
- func UniformMobile(gtx C, isHorizontal, withList bool, body layout.Widget) D
- func UniformPadding(gtx C, body layout.Widget) D
- func WalletHighlightLabel(theme *cryptomaterial.Theme, gtx C, textSize unit.Sp, content string) D
- type DexServer
- type FeeRateSelector
- func (fs *FeeRateSelector) Layout(gtx C) D
- func (fs *FeeRateSelector) OnEditRateClicked(selectedWallet sharedW.Asset)
- func (fs *FeeRateSelector) SetFeerate(rateInt int64)
- func (fs *FeeRateSelector) ShowSizeAndCost() *FeeRateSelector
- func (fs *FeeRateSelector) UpdatedFeeRate(selectedWallet sharedW.Asset)
- type FlexOptions
- type MixerComponent
- type NavBarItem
- type ProgressInfo
- type ProposalItem
- type ReleaseResponse
- type Reload
- type Restore
- type Scroll
- func (s *Scroll[T]) FetchScrollData(isScrollUp bool, window app.WindowNavigator, isResetList bool)
- func (s *Scroll[T]) FetchedData() []T
- func (s *Scroll[T]) IsLoadingData() bool
- func (s *Scroll[T]) ItemsCount() int
- func (s *Scroll[T]) List() *cryptomaterial.ListStyle
- func (s *Scroll[T]) OnScrollChangeListener(window app.WindowNavigator)
- func (s *Scroll[T]) SetIsHaveKeySearch(isHaveKeySearch bool)
- type ScrollFunc
- type SeedRestore
- func (pg *SeedRestore) HandleKeyPress(evt *key.Event)
- func (pg *SeedRestore) HandleUserInteractions()
- func (pg *SeedRestore) ID() string
- func (pg *SeedRestore) KeysToHandle() key.Set
- func (pg *SeedRestore) Layout(gtx C) D
- func (pg *SeedRestore) OnNavigatedFrom()
- func (pg *SeedRestore) OnNavigatedTo()
- func (pg *SeedRestore) SetParentNav(window app.WindowNavigator)
- type SelectAssetEditor
- type SelectorItem
- type SubPage
- func (sp *SubPage) CombinedLayout(window app.WindowNavigator, gtx C) D
- func (sp *SubPage) EventHandler(window app.WindowNavigator)
- func (sp *SubPage) Header(window app.WindowNavigator, gtx C) D
- func (sp *SubPage) Layout(window app.WindowNavigator, gtx C) D
- func (sp *SubPage) LayoutWithHeadCard(window app.WindowNavigator, gtx C) D
- type TreasuryItem
- type TxStatus
- type VSPSelector
- type VoteBar
- func (v *VoteBar) Layout(gtx C) D
- func (v *VoteBar) SetBottomLayout(lay layout.Widget) *VoteBar
- func (v *VoteBar) SetDisableInfoTitle(isDisable bool) *VoteBar
- func (v *VoteBar) SetProposalDetails(numComment int32, publishedAt int64, token string) *VoteBar
- func (v *VoteBar) SetVoteValidityParams(eligibleVotes, requiredPercentage, passPercentage float32) *VoteBar
- func (v *VoteBar) SetYesNoVoteParams(yesVotes, noVotes float32) *VoteBar
- type WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) AccountSelected(callback func(*sharedW.Account)) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) AccountValidator(accountIsValid func(*sharedW.Account) bool) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) Changed() bool
- func (ws *WalletAndAccountSelector) Clickable() *cryptomaterial.Clickable
- func (sm WalletAndAccountSelector) Count() int
- func (ws *WalletAndAccountSelector) EnableWatchOnlyWallets(isEnable bool) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) Handle(window app.WindowNavigator)
- func (ws *WalletAndAccountSelector) Layout(window app.WindowNavigator, gtx C) D
- func (ws *WalletAndAccountSelector) ListenForTxNotifications(window app.WindowNavigator)
- func (sm WalletAndAccountSelector) OnDismiss()
- func (sm WalletAndAccountSelector) OnResume()
- func (ws *WalletAndAccountSelector) ResetAccount()
- func (ws *WalletAndAccountSelector) SelectAccount(wallet sharedW.Asset, accountNumber int32) error
- func (ws *WalletAndAccountSelector) SelectFirstValidAccount(wallet sharedW.Asset) error
- func (ws *WalletAndAccountSelector) SelectedAccount() *sharedW.Account
- func (ws *WalletAndAccountSelector) SelectedAsset() utils.AssetType
- func (ws *WalletAndAccountSelector) SelectedWallet() sharedW.Asset
- func (ws *WalletAndAccountSelector) SetActionInfoText(text string) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) SetBorder(isHaveBorder bool)
- func (ws *WalletAndAccountSelector) SetError(errMsg string)
- func (ws *WalletAndAccountSelector) SetHideBalance(isHide bool)
- func (ws *WalletAndAccountSelector) SetLeftAlignment(isLeft bool)
- func (ws *WalletAndAccountSelector) SetSelectedAccount(account *sharedW.Account)
- func (ws *WalletAndAccountSelector) SetSelectedAsset(assetType ...utils.AssetType) bool
- func (ws *WalletAndAccountSelector) SetSelectedWallet(wallet sharedW.Asset)
- func (ws *WalletAndAccountSelector) StopTxNtfnListener()
- func (ws *WalletAndAccountSelector) Title(title string) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) WalletSelected(callback func(sharedW.Asset)) *WalletAndAccountSelector
- func (ws *WalletAndAccountSelector) WalletValidator(walletIsValid func(sharedW.Asset) bool) *WalletAndAccountSelector
- type WalletSyncInfo
- func (wsi *WalletSyncInfo) FetchSyncProgress() ProgressInfo
- func (wsi *WalletSyncInfo) GetWallet() sharedW.Asset
- func (wsi *WalletSyncInfo) Init()
- func (wsi *WalletSyncInfo) ListenForNotifications()
- func (wsi *WalletSyncInfo) StopListeningForNotifications()
- func (wsi *WalletSyncInfo) WalletInfoLayout(gtx C) D
Constants ¶
const ( Uint32Size = 32 // 32 or 64 ? shifting 32-bit value by 32 bits will always clear it MaxInt32 = 1<<(Uint32Size-1) - 1 WalletsPageID = "Wallets" )
const ( // MinSeedBytes is the minimum number of bytes allowed for a seed. MinSeedBytes = 16 // MaxSeedBytes is the maximum number of bytes allowed for a seed. MaxSeedBytes = 64 )
const AssetTypeSelectorID = "AssetTypeSelectorID"
const CreateRestorePageID = "Restore"
const (
CreateWalletID = "create_wallet"
)
const (
SeedRestorePageID = "seed_restore"
)
const WalletAndAccountSelectorID = "WalletAndAccountSelector"
const WalletSyncInfoID = "WalletSyncInfo"
Variables ¶
This section is empty.
Functions ¶
func CoinImageBySymbol ¶
func CoinImageBySymbol(l *load.Load, assetType libutils.AssetType, isWatchOnly bool) *cryptomaterial.Image
CoinImageBySymbol returns image widget for supported asset coins.
func ConditionalFlexedRigidLayout ¶ added in v1.1.0
func ConditionalFlexedRigidLayout(flexWeight float32, isMobileView bool, content layout.Widget) layout.FlexChild
ConditionalFlexedRigidLayout decides whether to use layout.Rigid or layout.Flexed
func ContextDone ¶
done returns whether the context's Done channel was closed due to cancellation or exceeded deadline.
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func FormatDateOrTime ¶
func GetBackButton ¶ added in v1.1.0
func GetBackButton(l *load.Load) cryptomaterial.IconButton
func GetServerIcon ¶ added in v1.1.0
func GetServerIcon(theme *cryptomaterial.Theme, serverName string) *cryptomaterial.Image
GetServerIcon returns the icon for the provided server name.
func GetTicketPurchaseAccount ¶
GetTicketPurchaseAccount returns the validly set ticket purchase account if it exists.
func HorizontalInset ¶ added in v1.1.0
HorizontalInset creates an inset with the specified amount applied uniformly to both the left and right edges. This function is useful for ensuring consistent horizontal padding or margin around elements, without affecting the vertical spacing.
func IconButton ¶ added in v1.1.0
func IconButton(icon *widget.Icon, txt string, inset layout.Inset, th *cryptomaterial.Theme, clickable *cryptomaterial.Clickable) func(gtx C) D
IconButton creates the display for an icon button. The default icon and text color is Theme.Color.Primary.
func InputsNotEmpty ¶
InputsNotEmpty checks if all the provided editors have non-empty text.
func LayoutBalance ¶
LayoutBalance aligns the main and sub DCR balances horizontally, putting the sub balance at the baseline of the row.
func LayoutBalanceColor ¶
func LayoutBalanceColorWithState ¶ added in v1.1.0
func LayoutBalanceColorWithStateUSD ¶ added in v1.1.0
func LayoutBalanceCustom ¶ added in v1.1.0
func LayoutBalanceSize ¶
func LayoutBalanceWithState ¶ added in v1.1.0
func LayoutBalanceWithStateSemiBold ¶ added in v1.1.0
func LayoutBalanceWithStateUSD ¶ added in v1.1.0
func LayoutBalanceWithUnit ¶
func LayoutBalanceWithUnitSizeBoldText ¶ added in v1.1.0
func LayoutNavigationBar ¶ added in v1.1.0
func LayoutNavigationBar(gtx layout.Context, theme *cryptomaterial.Theme, navItems []NavBarItem) layout.Dimensions
func LoadOrders ¶
func RetryFunc ¶
func RetryFunc(retryAttempts int, sleepDur time.Duration, funcDesc string, errFunc func() error) (int, error)
RetryFunc implements retry policy for processes that needs to be executed after initial failure.
func SecondsToDays ¶
SecondsToDays takes time in seconds and returns its string equivalent in the format ddhhmm.
func SeedWordsToHex ¶
func SubpageHeaderButtons ¶
func SubpageHeaderButtons(l *load.Load) (cryptomaterial.IconButton, cryptomaterial.IconButton)
func TimeFormat ¶
func TruncateString ¶
func TxConfirmations ¶
func TxConfirmations(wallet sharedW.Asset, transaction *sharedW.Transaction) int32
func TxPageDropDownFields ¶
func TxPageDropDownFields(wType libutils.AssetType, tabIndex int) (mapInfo map[string]int32, keysInfo []string)
TxPageDropDownFields returns the fields for the required drop down with the transactions view page. Since maps access of items order is always random an array of keys is provided to guarantee the dropdown order will always be maintained.
func VerticalInset ¶ added in v1.1.0
VerticalInset creates an inset with the specified amount applied uniformly to both the top and bottom edges. This function is useful for ensuring consistent vetical padding or margin around elements, without affecting the horizontal spacing.
Types ¶
type AssetTypeItem ¶
type AssetTypeItem struct { Type libutils.AssetType Icon *cryptomaterial.Image // contains filtered or unexported fields }
assetTypeItem wraps the asset type in a clickable.
type AssetTypeSelector ¶
type AssetTypeSelector struct {
// contains filtered or unexported fields
}
AssetTypeSelector models a wiget for use for selecting asset types.
func NewAssetTypeSelector ¶
func NewAssetTypeSelector(l *load.Load) *AssetTypeSelector
NewAssetTypeSelector creates an assetType selector component. It opens a modal to select a desired assetType.
func (*AssetTypeSelector) AssetTypeSelected ¶
func (ats *AssetTypeSelector) AssetTypeSelected(callback func(*AssetTypeItem) bool) *AssetTypeSelector
AssetTypeSelected sets the callback executed when an asset type is selected.
func (*AssetTypeSelector) DisableBorder ¶
func (ats *AssetTypeSelector) DisableBorder() *AssetTypeSelector
DisableBorder will disable border on layout selected Asset type.
func (*AssetTypeSelector) Handle ¶
func (ats *AssetTypeSelector) Handle(window app.WindowNavigator)
func (*AssetTypeSelector) Layout ¶
func (ats *AssetTypeSelector) Layout(window app.WindowNavigator, gtx C) D
func (*AssetTypeSelector) SelectedAssetType ¶
func (ats *AssetTypeSelector) SelectedAssetType() *libutils.AssetType
SelectedAssetType returns the currently selected Asset type.
func (*AssetTypeSelector) SetBackground ¶
func (ats *AssetTypeSelector) SetBackground(background color.NRGBA) *AssetTypeSelector
SetBackground sets the asset background colour
func (*AssetTypeSelector) SetHint ¶
func (ats *AssetTypeSelector) SetHint(hint string) *AssetTypeSelector
SetHint sets hint for selector
func (*AssetTypeSelector) SetSelectedAssetType ¶
func (ats *AssetTypeSelector) SetSelectedAssetType(assetType libutils.AssetType)
SetSelectedAssetType sets assetType as the current selected asset type.
func (*AssetTypeSelector) SupportedAssetTypes ¶
func (ats *AssetTypeSelector) SupportedAssetTypes() []*AssetTypeItem
SupportedAssetTypes returns a slice containing all the asset types Currently supported.
func (*AssetTypeSelector) Title ¶
func (ats *AssetTypeSelector) Title(title string) *AssetTypeSelector
Title Sets the title of the asset type list dialog.
type BottomNavigationBar ¶
type BottomNavigationBar struct { // contains filtered or unexported fields }
func (*BottomNavigationBar) LayoutBottomNavigationBar ¶
func (bottomNavigationbar *BottomNavigationBar) LayoutBottomNavigationBar(gtx layout.Context) layout.Dimensions
func (*BottomNavigationBar) LayoutSendReceive ¶
func (bottomNavigationbar *BottomNavigationBar) LayoutSendReceive(gtx layout.Context) layout.Dimensions
func (*BottomNavigationBar) OnViewCreated ¶
func (bottomNavigationbar *BottomNavigationBar) OnViewCreated()
type BottomNavigationBarHandler ¶
type BottomNavigationBarHandler struct {}
type ConsensusItem ¶
type ConsensusItem struct { Agenda *dcr.Agenda VoteButton cryptomaterial.Button }
func LoadAgendas ¶
type Container ¶
Container is simply a wrapper for the Inset type. Its purpose is to differentiate the use of an inset as a padding or margin, making it easier to visualize the structure of a layout when reading UI code.
type CreateWallet ¶ added in v1.1.0
type CreateWallet struct { *load.Load // GenericPageModal defines methods such as ID() and OnAttachedToNavigator() // that helps this Page satisfy the app.Page interface. It also defines // helper methods for accessing the PageNavigator that displayed this page // and the root WindowNavigator. *app.GenericPageModal // contains filtered or unexported fields }
func NewCreateWallet ¶ added in v1.1.0
func NewCreateWallet(l *load.Load, walletCreationSuccessCallback func(), assetType ...libutils.AssetType) *CreateWallet
func (*CreateWallet) HandleUserInteractions ¶ added in v1.1.0
func (pg *CreateWallet) HandleUserInteractions()
HandleUserInteractions is called just before Layout() to determine if any user interaction recently occurred on the page and may be used to update the page's UI components shortly before they are displayed. Part of the load.Page interface.
func (*CreateWallet) Layout ¶ added in v1.1.0
func (pg *CreateWallet) Layout(gtx C) D
Layout draws the page UI components into the provided C to be eventually drawn on screen. Part of the load.Page interface.
func (*CreateWallet) OnNavigatedFrom ¶ added in v1.1.0
func (pg *CreateWallet) OnNavigatedFrom()
OnNavigatedFrom is called when the page is about to be removed from the displayed window. This method should ideally be used to disable features that are irrelevant when the page is NOT displayed. NOTE: The page may be re-displayed on the app's window, in which case OnNavigatedTo() will be called again. This method should not destroy UI components unless they'll be recreated in the OnNavigatedTo() method. Part of the load.Page interface.
func (*CreateWallet) OnNavigatedTo ¶ added in v1.1.0
func (pg *CreateWallet) OnNavigatedTo()
OnNavigatedTo is called when the page is about to be displayed and may be used to initialize page features that are only relevant when the page is displayed. Part of the load.Page interface.
type CummulativeWalletsBalance ¶
type CummulativeWalletsBalance struct { Total sharedW.AssetAmount Spendable sharedW.AssetAmount ImmatureReward sharedW.AssetAmount ImmatureStakeGeneration sharedW.AssetAmount LockedByTickets sharedW.AssetAmount VotingAuthority sharedW.AssetAmount UnConfirmed sharedW.AssetAmount }
CummulativeWalletsBalance defines total balance for all available wallets.
func CalculateMixedAccountBalance ¶
func CalculateMixedAccountBalance(selectedWallet *dcr.Asset) (*CummulativeWalletsBalance, error)
func CalculateTotalWalletsBalance ¶
func CalculateTotalWalletsBalance(wallet sharedW.Asset) (*CummulativeWalletsBalance, error)
type D ¶
type D = layout.Dimensions
func AgendaItemWidget ¶
func BrowserURLWidget ¶
func DisablePageWithOverlay ¶
func DisablePageWithOverlay(l *load.Load, currentPage app.Page, gtx C, title, subtitle string, actionButton *cryptomaterial.Button) D
DisablePageWithOverlay disables the provided page by highlighting a message why the page is disabled and adding a background color overlay that blocks any page event being triggered.
func EndToEndRow ¶
EndToEndRow layouts out its content on both ends of its horizontal layout.
func FlexLayout ¶ added in v1.1.0
func FlexLayout(gtx C, options FlexOptions, widgets []func(gtx C) D) D
func LayoutIconAndTextWithSize ¶ added in v1.1.0
func LayoutNoOrderHistoryWithMsg ¶ added in v1.1.0
func LayoutNoProposalsFound ¶
func LayoutOrderAmount ¶
func LayoutTransactionRow ¶
func LayoutTransactionRow(gtx C, l *load.Load, wal sharedW.Asset, tx *sharedW.Transaction, hideTxAssetInfo bool) D
LayoutTransactionRow is a single transaction row on the transactions and overview page. It lays out a transaction's direction, balance, status. hideTxAssetInfo determines if the transaction should display additional information about the tx such as the wallet the tx belong to etc. This is useful on pages where the tx is displayed from multi wallets.
func OrderItemWidget ¶
func ProposalsList ¶
func ProposalsList(gtx C, l *load.Load, prop *ProposalItem) D
func SetWalletLogo ¶
func TreasuryItemWidget ¶
func TreasuryItemWidget(gtx C, l *load.Load, treasuryItem *TreasuryItem) D
func WalletHighlightLabel ¶ added in v1.1.0
type FeeRateSelector ¶
type FeeRateSelector struct { *load.Load // SaveRate is a material button to trigger save tx fee rate. SaveRate cryptomaterial.Button // EstSignedSize holds the estimated size of signed tx. EstSignedSize string // TxFee stores the estimated transaction fee for a tx. TxFee string // TxFeeUSD stores the estimated tx fee in USD. TxFeeUSD string // USDExchangeSet determines if this component will in addition // to the TxFee show the USD rate of fee. USDExchangeSet bool // contains filtered or unexported fields }
FeeRateSelector represent a tx fee selector UI component.
func NewFeeRateSelector ¶
func NewFeeRateSelector(l *load.Load, callback walletTypeCallbackFunc) *FeeRateSelector
NewFeeRateSelector create and return an instance of FeeRateSelector. Since the feeRate selector can be used before the selected wallet is set a Load independent callback function is provided to help address that case scenario.
func (*FeeRateSelector) Layout ¶
func (fs *FeeRateSelector) Layout(gtx C) D
Layout draws the UI components.
func (*FeeRateSelector) OnEditRateClicked ¶
func (fs *FeeRateSelector) OnEditRateClicked(selectedWallet sharedW.Asset)
OnEditRateCliked is called when the edit feerate button is clicked.
func (*FeeRateSelector) SetFeerate ¶
func (fs *FeeRateSelector) SetFeerate(rateInt int64)
SetFeerate updates the fee rate in use upstream.
func (*FeeRateSelector) ShowSizeAndCost ¶
func (fs *FeeRateSelector) ShowSizeAndCost() *FeeRateSelector
ShowSizeAndCost turns the showSizeAndCost Field to true the component will show the estimated size and Fee when showSizeAndCost is true.backupLaterbackupLater
func (*FeeRateSelector) UpdatedFeeRate ¶ added in v1.1.0
func (fs *FeeRateSelector) UpdatedFeeRate(selectedWallet sharedW.Asset)
FetchFeeRate will fetch the fee rate from the HTTP API.
type FlexOptions ¶ added in v1.1.0
type MixerComponent ¶ added in v1.1.0
type MixerComponent struct { *load.Load WalletName, UnmixedBalance string Width, Height int ForwardButton, InfoButton cryptomaterial.IconButton }
func (MixerComponent) MixerLayout ¶ added in v1.1.0
func (mc MixerComponent) MixerLayout(gtx C) D
type NavBarItem ¶ added in v1.1.0
type NavBarItem struct {}
type ProgressInfo ¶ added in v1.1.0
type ProgressInfo struct { HeadersToFetchOrScan int32 // contains filtered or unexported fields }
type ProposalItem ¶
func LoadProposals ¶
type ReleaseResponse ¶ added in v1.1.2
func CheckForUpdate ¶ added in v1.1.2
func CheckForUpdate(l *load.Load) *ReleaseResponse
CheckForUpdate checks if a new version of the app is available by comparing the current version with the latest release version available on GitHub.
type Restore ¶ added in v1.1.0
type Restore struct { *load.Load // GenericPageModal defines methods such as ID() and OnAttachedToNavigator() // that helps this Page satisfy the app.Page interface. It also defines // helper methods for accessing the ParentNavigator that displayed this page // and the root WindowNavigator. The ParentNavigator is also the root // WindowNavigator if this page is displayed from the StartPage, otherwise // the ParentNavigator is the MainPage. *app.GenericPageModal // contains filtered or unexported fields }
func NewRestorePage ¶ added in v1.1.0
func (*Restore) HandleKeyPress ¶ added in v1.1.0
HandleKeyPress is called when one or more keys are pressed on the current window that match any of the key combinations returned by KeysToHandle(). Satisfies the load.KeyEventHandler interface for receiving key events.
func (*Restore) HandleUserInteractions ¶ added in v1.1.0
func (pg *Restore) HandleUserInteractions()
HandleUserInteractions is called just before Layout() to determine if any user interaction recently occurred on the page and may be used to update the page's UI components shortly before they are displayed. Part of the load.Page interface.
func (*Restore) KeysToHandle ¶ added in v1.1.0
KeysToHandle returns an expression that describes a set of key combinations that this page wishes to capture. The HandleKeyPress() method will only be called when any of these key combinations is pressed. Satisfies the load.KeyEventHandler interface for receiving key events.
func (*Restore) Layout ¶ added in v1.1.0
Layout draws the page UI components into the provided C to be eventually drawn on screen. Part of the load.Page interface.
func (*Restore) OnNavigatedFrom ¶ added in v1.1.0
func (pg *Restore) OnNavigatedFrom()
OnNavigatedFrom is called when the page is about to be removed from the displayed window. This method should ideally be used to disable features that are irrelevant when the page is NOT displayed. NOTE: The page may be re-displayed on the app's window, in which case OnNavigatedTo() will be called again. This method should not destroy UI components unless they'll be recreated in the OnNavigatedTo() method. Part of the load.Page interface.
func (*Restore) OnNavigatedTo ¶ added in v1.1.0
func (pg *Restore) OnNavigatedTo()
OnNavigatedTo is called when the page is about to be displayed and may be used to initialize page features that are only relevant when the page is displayed. Part of the load.Page interface.
type Scroll ¶
type Scroll[T any] struct { // contains filtered or unexported fields }
func (*Scroll[T]) FetchScrollData ¶
func (s *Scroll[T]) FetchScrollData(isScrollUp bool, window app.WindowNavigator, isResetList bool)
FetchScrollData is a mutex protected fetchScrollData function. At the end of the function call a window reload is triggered. Returns that latest records.
func (*Scroll[T]) FetchedData ¶
func (s *Scroll[T]) FetchedData() []T
FetchedData returns the latest queried data.
func (*Scroll[T]) IsLoadingData ¶ added in v1.1.3
fetchScrollData fetchs the scroll data and manages data returned depending on on the up or downwards scrollbar movement. Unless the data fetched is less than the page, all the old data is replaced by the new fetched data making it easier and smoother to scroll on the UI. At the end of the function call a window reload is triggered.
func (*Scroll[T]) ItemsCount ¶
ItemsCount returns the count of the last fetched items.
func (*Scroll[T]) List ¶
func (s *Scroll[T]) List() *cryptomaterial.ListStyle
List returns the list theme already in existence or newly created. Multiple list instances shouldn't exist for a given scroll component.
func (*Scroll[T]) OnScrollChangeListener ¶
func (s *Scroll[T]) OnScrollChangeListener(window app.WindowNavigator)
OnScrollChangeListener listens for the scroll bar movement and update the items list view accordingly. FetchScrollData needs to be invoked first before calling this function.
func (*Scroll[T]) SetIsHaveKeySearch ¶ added in v1.1.0
type ScrollFunc ¶
ScrollFunc is a query function that accepts offset and pagesize parameters and returns data interface, count of the items in the data interface, isReset and an error. isReset is used to reset the offset value.
type SeedRestore ¶ added in v1.1.0
type SeedRestore struct { *load.Load // GenericPageModal defines methods such as ID() and OnAttachedToNavigator() // that helps this Page satisfy the app.Page interface. It also defines // helper methods for accessing the ParentNavigator that displayed this page // and the root WindowNavigator. The ParentNavigator is also the root // WindowNavigator if this page is displayed from the StartPage, otherwise // the ParentNavigator is the MainPage. *app.GenericPageModal // contains filtered or unexported fields }
func NewSeedRestorePage ¶ added in v1.1.0
func (*SeedRestore) HandleKeyPress ¶ added in v1.1.0
func (pg *SeedRestore) HandleKeyPress(evt *key.Event)
HandleKeyPress is called when one or more keys are pressed on the current window that match any of the key combinations returned by KeysToHandle(). Satisfies the load.KeyEventHandler interface for receiving key events.
func (*SeedRestore) HandleUserInteractions ¶ added in v1.1.0
func (pg *SeedRestore) HandleUserInteractions()
HandleUserInteractions is called just before Layout() to determine if any user interaction recently occurred on the page and may be used to update the page's UI components shortly before they are displayed. Part of the load.Page interface.
func (*SeedRestore) ID ¶ added in v1.1.0
func (pg *SeedRestore) ID() string
ID is a unique string that identifies the page and may be used to differentiate this page from other pages. Part of the load.Page interface.
func (*SeedRestore) KeysToHandle ¶ added in v1.1.0
func (pg *SeedRestore) KeysToHandle() key.Set
KeysToHandle returns an expression that describes a set of key combinations that this page wishes to capture. The HandleKeyPress() method will only be called when any of these key combinations is pressed. Satisfies the load.KeyEventHandler interface for receiving key events.
func (*SeedRestore) Layout ¶ added in v1.1.0
func (pg *SeedRestore) Layout(gtx C) D
Layout draws the page UI components into the provided layout context to be eventually drawn on screen. Part of the load.Page interface.
func (*SeedRestore) OnNavigatedFrom ¶ added in v1.1.0
func (pg *SeedRestore) OnNavigatedFrom()
OnNavigatedFrom is called when the page is about to be removed from the displayed window. This method should ideally be used to disable features that are irrelevant when the page is NOT displayed. NOTE: The page may be re-displayed on the app's window, in which case OnNavigatedTo() will be called again. This method should not destroy UI components unless they'll be recreated in the OnNavigatedTo() method. Part of the load.Page interface.
func (*SeedRestore) OnNavigatedTo ¶ added in v1.1.0
func (pg *SeedRestore) OnNavigatedTo()
OnNavigatedTo is called when the page is about to be displayed and may be used to initialize page features that are only relevant when the page is displayed. Part of the load.Page interface.
func (*SeedRestore) SetParentNav ¶ added in v1.1.0
func (pg *SeedRestore) SetParentNav(window app.WindowNavigator)
type SelectAssetEditor ¶
type SelectAssetEditor struct { *load.Load Edit cryptomaterial.Editor AssetTypeSelector *AssetTypeSelector }
func NewSelectAssetEditor ¶
func NewSelectAssetEditor(l *load.Load) *SelectAssetEditor
func (SelectAssetEditor) Layout ¶
func (sae SelectAssetEditor) Layout(window app.WindowNavigator, gtx C) D
type SelectorItem ¶
type SelectorItem struct {
// contains filtered or unexported fields
}
SelectorItem models a wallet or an account along with it's clickable.
type SubPage ¶
type SubPage struct { *load.Load Title string SubTitle string Back func() Body layout.Widget InfoTemplate string ExtraItem *cryptomaterial.Clickable Extra layout.Widget ExtraText string HandleExtra func() ExtraHeader layout.Widget BackButton cryptomaterial.IconButton InfoButton cryptomaterial.IconButton }
func (*SubPage) CombinedLayout ¶
func (sp *SubPage) CombinedLayout(window app.WindowNavigator, gtx C) D
func (*SubPage) EventHandler ¶
func (sp *SubPage) EventHandler(window app.WindowNavigator)
func (*SubPage) LayoutWithHeadCard ¶ added in v1.1.0
func (sp *SubPage) LayoutWithHeadCard(window app.WindowNavigator, gtx C) D
type TreasuryItem ¶
type TreasuryItem struct { Policy dcr.TreasuryKeyPolicy OptionsRadioGroup *widget.Enum VoteChoices [3]string SetChoiceButton cryptomaterial.Button }
func LoadPolicies ¶
func (*TreasuryItem) SetVoteChoices ¶
func (t *TreasuryItem) SetVoteChoices(voteChoices [3]string)
type TxStatus ¶
type TxStatus struct { Title string Icon *cryptomaterial.Image // tx purchase only TicketStatus string Color color.NRGBA ProgressBarColor color.NRGBA ProgressTrackColor color.NRGBA Background color.NRGBA }
func TransactionTitleIcon ¶
type VSPSelector ¶
func NewVSPSelector ¶
func NewVSPSelector(l *load.Load, dcrWallet *dcr.Asset) *VSPSelector
func (*VSPSelector) Changed ¶
func (v *VSPSelector) Changed() bool
func (*VSPSelector) Layout ¶
func (v *VSPSelector) Layout(window app.WindowNavigator, gtx C) D
func (*VSPSelector) SelectVSP ¶
func (v *VSPSelector) SelectVSP(vspHost string)
func (*VSPSelector) SelectedVSP ¶
func (v *VSPSelector) SelectedVSP() *dcr.VSP
func (*VSPSelector) Title ¶
func (v *VSPSelector) Title(title string) *VSPSelector
type VoteBar ¶
type VoteBar struct { *load.Load BottomExtra layout.Widget // contains filtered or unexported fields }
VoteBar widget implements voting stat for proposals. VoteBar shows the range/percentage of the yes votes and no votes against the total required.
func NewVoteBar ¶
func (*VoteBar) SetBottomLayout ¶ added in v1.1.0
func (*VoteBar) SetDisableInfoTitle ¶ added in v1.1.0
func (*VoteBar) SetProposalDetails ¶
func (*VoteBar) SetVoteValidityParams ¶
func (*VoteBar) SetYesNoVoteParams ¶
type WalletAndAccountSelector ¶
type WalletAndAccountSelector struct { HideLogo bool // contains filtered or unexported fields }
func NewWalletAndAccountSelector ¶
func NewWalletAndAccountSelector(l *load.Load, assetType ...utils.AssetType) *WalletAndAccountSelector
NewWalletAndAccountSelector creates a wallet selector component. It opens a modal to select a desired wallet or a desired account.
func (*WalletAndAccountSelector) AccountSelected ¶
func (ws *WalletAndAccountSelector) AccountSelected(callback func(*sharedW.Account)) *WalletAndAccountSelector
func (*WalletAndAccountSelector) AccountValidator ¶
func (ws *WalletAndAccountSelector) AccountValidator(accountIsValid func(*sharedW.Account) bool) *WalletAndAccountSelector
AccountValidator validates an account according to the rules defined to determine a valid a account.
func (*WalletAndAccountSelector) Changed ¶
func (ws *WalletAndAccountSelector) Changed() bool
func (*WalletAndAccountSelector) Clickable ¶
func (ws *WalletAndAccountSelector) Clickable() *cryptomaterial.Clickable
func (WalletAndAccountSelector) Count ¶ added in v1.1.0
func (sm WalletAndAccountSelector) Count() int
return the count of wallets and accounts
func (*WalletAndAccountSelector) EnableWatchOnlyWallets ¶
func (ws *WalletAndAccountSelector) EnableWatchOnlyWallets(isEnable bool) *WalletAndAccountSelector
EnableWatchOnlyWallets enables selection of watchOnly wallets and their accounts.
func (*WalletAndAccountSelector) Handle ¶
func (ws *WalletAndAccountSelector) Handle(window app.WindowNavigator)
func (*WalletAndAccountSelector) Layout ¶
func (ws *WalletAndAccountSelector) Layout(window app.WindowNavigator, gtx C) D
func (*WalletAndAccountSelector) ListenForTxNotifications ¶
func (ws *WalletAndAccountSelector) ListenForTxNotifications(window app.WindowNavigator)
ListenForTxNotifications listens for transaction and block updates and updates the selector modal, if the modal is open at the time of the update. The tx update listener MUST be unregistered using ws.StopTxNtfnListener() when the page using this WalletAndAccountSelector widget is exited.
func (*WalletAndAccountSelector) ResetAccount ¶
func (ws *WalletAndAccountSelector) ResetAccount()
func (*WalletAndAccountSelector) SelectAccount ¶
func (ws *WalletAndAccountSelector) SelectAccount(wallet sharedW.Asset, accountNumber int32) error
func (*WalletAndAccountSelector) SelectFirstValidAccount ¶
func (ws *WalletAndAccountSelector) SelectFirstValidAccount(wallet sharedW.Asset) error
SelectFirstValidAccount transforms this widget into an Account selector and selects the first valid account from the the wallet passed to this method.
func (*WalletAndAccountSelector) SelectedAccount ¶
func (ws *WalletAndAccountSelector) SelectedAccount() *sharedW.Account
SelectedAccount returns the currently selected account.
func (*WalletAndAccountSelector) SelectedAsset ¶
func (ws *WalletAndAccountSelector) SelectedAsset() utils.AssetType
func (*WalletAndAccountSelector) SelectedWallet ¶
func (ws *WalletAndAccountSelector) SelectedWallet() sharedW.Asset
func (*WalletAndAccountSelector) SetActionInfoText ¶
func (ws *WalletAndAccountSelector) SetActionInfoText(text string) *WalletAndAccountSelector
SetActionInfoText sets the text that is shown when the info action icon of the selector modal is is clicked. The {text} is rendered using a html renderer. So HTML text can be passed in.
func (*WalletAndAccountSelector) SetBorder ¶ added in v1.1.0
func (ws *WalletAndAccountSelector) SetBorder(isHaveBorder bool)
func (*WalletAndAccountSelector) SetError ¶
func (ws *WalletAndAccountSelector) SetError(errMsg string)
func (*WalletAndAccountSelector) SetHideBalance ¶ added in v1.1.0
func (ws *WalletAndAccountSelector) SetHideBalance(isHide bool)
func (*WalletAndAccountSelector) SetLeftAlignment ¶ added in v1.1.0
func (ws *WalletAndAccountSelector) SetLeftAlignment(isLeft bool)
func (*WalletAndAccountSelector) SetSelectedAccount ¶
func (ws *WalletAndAccountSelector) SetSelectedAccount(account *sharedW.Account)
func (*WalletAndAccountSelector) SetSelectedAsset ¶
func (ws *WalletAndAccountSelector) SetSelectedAsset(assetType ...utils.AssetType) bool
SetSelectedAsset sets the specified assetType and returns true if the asset has at least one wallet.
func (*WalletAndAccountSelector) SetSelectedWallet ¶
func (ws *WalletAndAccountSelector) SetSelectedWallet(wallet sharedW.Asset)
func (*WalletAndAccountSelector) StopTxNtfnListener ¶ added in v1.1.0
func (ws *WalletAndAccountSelector) StopTxNtfnListener()
func (*WalletAndAccountSelector) Title ¶
func (ws *WalletAndAccountSelector) Title(title string) *WalletAndAccountSelector
func (*WalletAndAccountSelector) WalletSelected ¶
func (ws *WalletAndAccountSelector) WalletSelected(callback func(sharedW.Asset)) *WalletAndAccountSelector
func (*WalletAndAccountSelector) WalletValidator ¶ added in v1.1.0
func (ws *WalletAndAccountSelector) WalletValidator(walletIsValid func(sharedW.Asset) bool) *WalletAndAccountSelector
WalletValidator validates a wallet according to the rules defined to determine a valid a wallet.
type WalletSyncInfo ¶ added in v1.1.0
type WalletSyncInfo struct { *load.Load ForwardButton cryptomaterial.IconButton IsSlider bool // contains filtered or unexported fields }
func NewWalletSyncInfo ¶ added in v1.1.0
func (*WalletSyncInfo) FetchSyncProgress ¶ added in v1.1.0
func (wsi *WalletSyncInfo) FetchSyncProgress() ProgressInfo
func (*WalletSyncInfo) GetWallet ¶ added in v1.1.0
func (wsi *WalletSyncInfo) GetWallet() sharedW.Asset
func (*WalletSyncInfo) Init ¶ added in v1.1.0
func (wsi *WalletSyncInfo) Init()
func (*WalletSyncInfo) ListenForNotifications ¶ added in v1.1.0
func (wsi *WalletSyncInfo) ListenForNotifications()
ListenForNotifications starts a goroutine to watch for sync updates and update the UI accordingly. To prevent UI lags, this method does not refresh the window display every time a sync update is received. During active blocks sync, rescan or proposals sync, the Layout method auto refreshes the display every set interval. Other sync updates that affect the UI but occur outside of an active sync requires a display refresh. The caller of this method must ensure that the StopListeningForNotifications() method is called whenever the the page or modal using these notifications is closed.
func (*WalletSyncInfo) StopListeningForNotifications ¶ added in v1.1.0
func (wsi *WalletSyncInfo) StopListeningForNotifications()
StopListeningForNotifications stops listening for sync progress, tx and block notifications.
func (*WalletSyncInfo) WalletInfoLayout ¶ added in v1.1.0
func (wsi *WalletSyncInfo) WalletInfoLayout(gtx C) D
Source Files ¶
- asset_selector.go
- bottom_nav.go
- coinformat.go
- components.go
- consensus_list.go
- fee_rate_selector.go
- items_scroll.go
- log.go
- mixer_layout.go
- nav_drawer.go
- order_list.go
- proposal_list.go
- restore_page.go
- seed_restore_page.go
- select_asset_editor.go
- sub_page.go
- treasury_list.go
- utils.go
- votebar_widget.go
- vsp_selector.go
- wallet_account_selector.go
- wallet_setup_page.go
- wallet_sync_info.go