menu

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 37 Imported by: 11

Documentation

Index

Constants

View Source
const (
	Seals_mint = "dero1qyfq8m3rju62tshju60zuc0ymrajwxqajkdh6pw888ejuv94jlfgjqq58px98"
	Seals_coll = "c6fa9a2c95d97da816eb9689a2fb52be385bb1df9e93abe99373ddbd3407129d"
	ATeam_mint = "dero1qyx9748k9wrt89a6rm0zzlayxgs3ndkmvg6m20shqp8ynh54zf2rgqq8yn9hn"
	ATeam_coll = "bbc357bdfe9fc41128fc11ce555eaadbd9b411eca903008396e0de4cc31821c7"
	Degen_coll = "8edea52b9a8a041e3b579ca2d81ea3d3e87e148ba4409273d53039991afa91be"
	Degen_mint = "dero1qy4e7jj4jaaj66pc0vg8h7l0hqelqjxj9ya9qgal03v0phjaycv5yqq8aqgyg"
)
View Source
const (
	SIX_mint       = "dero1qy4ascka9rtspjvcyj6t8maazaay8t9udtt5nper3mukqkx2qtvyxqgflkpwp"
	AZY_mint       = "dero1qyfk5w2rvqpl9kzfd7fpteyp2k362y6audydcu2qrgcmj6vtasfkgqq9704gn"
	DCB_mint       = "dero1qy02stluwgh5aaawkmugqh47krtfzcq6f88jv2ydf6dkfupjca4gzqqwsmdzf"
	HS_mint        = "dero1qy8p8cw8hr8dlxyg9xjxzlxf2zznwshcxk98ad688csgmk44y9kzyqqt9g2m0"
	Dorbling_mint  = "dero1qy2tkfgpapjsgev8m9rs25209ajc6kcm42vzt2fapgk3ngmtc2guzqq52eq2r"
	Desperado_mint = "dero1qy0ydkcwuf7nvh6938jpalt5snsj2atgmdyms67rd05whuy8a2hvzqg46gh5f"
)

Variables

View Source
var ART_NFA_MS1 string
View Source
var Assets assetObjects
View Source
var Control menuObjects

Control menu indicators, checks, maps and defaults

View Source
var Info dispayObjects
View Source
var Market marketObjects

Market contains widget a list objects for NFA market

Background theme AssetSelect

View Source
var Username string

Functions

func AssetIcon added in v0.11.0

func AssetIcon(icon []byte, name string, size float32) fyne.CanvasObject

Creates framed icon image

func AssetList

func AssetList(icon fyne.Resource, rescan func(), d *dreams.AppObject) fyne.CanvasObject

Owned asset list object

  • Sets Assets.Viewing and buttons visibility on selected
  • rescan is func placed in button to rescan wallet assets

func AssetType added in v0.11.0

func AssetType(collection, typeHdr string) string

Additional asset type info

func AuctionInfo

func AuctionInfo() fyne.Container

Returns container for auction display objects

func BackgroundRast

func BackgroundRast(tag string) *canvas.Raster

Create a new raster from image, looking for dreams.Theme.Img.Resource and will fallback to bundle.ResourceBackgroundPng if err

func BidBuyConfirm

func BidBuyConfirm(scid string, amt uint64, bid bool, d *dreams.AppObject)

Confirm a bid or buy action of listed NFA

  • amt of Dero in atomic units
  • bid true for auction, false for sale

func BuyNowInfo

func BuyNowInfo() fyne.Container

Returns container for NFA buy now display objects

func CheckAllNFAs

func CheckAllNFAs(scids map[string]string)

Check if wallet owns any indexed NFAs

  • Pass scids from db store, can be nil arg to check all from db

func CheckClaimable added in v0.11.0

func CheckClaimable() (claimable []string)

Checks if wallet has any claimable NFAs, looking assets sent with dst uint64(0xA1B2C3D4E5F67890)

func CheckNFAListingType

func CheckNFAListingType(scid string) (list int, addr string)

Check NFA listing type and return owner address

  • Auction returns 1
  • Sale returns 2

func CheckWalletNames

func CheckWalletNames(value string)

Get a wallets registered names

func ClaimAll added in v0.11.0

func ClaimAll(title string, d *dreams.AppObject)

Dialogs for claiming all NFAs available to wallet

func ClaimClaimable added in v0.11.0

func ClaimClaimable(title string, claimable []string, d *dreams.AppObject)

Call ClaimOwnership on SC and confirm tx on all claimable SCs

func CoinDecimal

func CoinDecimal(ticker string) int

Used for placing coin decimal, default returns 2 decimal place

func ConfirmCancelClose

func ConfirmCancelClose(scid string, close bool, d *dreams.AppObject)

Confirm a cancel or close action of listed NFA

  • close true to close listing, false to cancel

func CreateNFAContract

func CreateNFAContract(art, royalty, update, name, descrip, typeHdr, icon, tags, fileCheckC, fileCheckS, fileUrl, fileSignUrl, coverURl, collection string) (contract string)

Create a new NFA contract string with passed values

func DappEnabled added in v0.11.0

func DappEnabled(dapp string) bool

Returns if a dApp is enabled

func DefaultThemeResource added in v0.11.0

func DefaultThemeResource() *fyne.StaticResource

Returns default theme resource by Theme.Name

func DisableIndexControls

func DisableIndexControls(d bool)

Disable index objects

func DisplayRating

func DisplayRating(i uint64) fyne.Resource

Display SCID rating from dReams SCID rating system

func EnabledCollections added in v0.10.1

func EnabledCollections(intro bool) (obj fyne.CanvasObject)

Enable asset collection objects

  • intro used to set label if initial boot screen

func EnabledDappCount added in v0.11.0

func EnabledDappCount() (enabled int)

Returns how many dApps are enabled

func FindNFAListings added in v0.11.0

func FindNFAListings(scids map[string]string, progress *widget.ProgressBar)

Scan index for any active auction and buy now NFA listings

  • Pass scids from db store, can be nil arg to check all from db
  • progress widget to update ui

func G45CollectionSC added in v0.11.0

func G45CollectionSC(name string) (collection string)

Returns collection SCID by name

func G45Index

func G45Index()

Manually add G45 collections to Gnomon index

func GetAuctionDetails

func GetAuctionDetails(scid string)

Get auction details for current asset and set display objects

func GetBuyNowDetails

func GetBuyNowDetails(scid string)

Get buy now details for current asset and set display objects

func GetFilters added in v0.11.0

func GetFilters(check string) (filter []string)

Get search filters from on chain store

func GetListingPercents

func GetListingPercents(scid string) (artP float64, royaltyP float64)

Get percentages for a NFA

func GetNFAImages added in v0.11.0

func GetNFAImages(scid string)

Get NFA cover and icon images for scid and set market images

func GetNFAName added in v0.10.1

func GetNFAName(scid string) string

Get the nameHdr of a NFA

func GetPrice

func GetPrice(coin, tag string) (price float64, display string)

Main price fetch, returns float and display string, average from 4 feeds

  • coin, "BTC-USDT", "DERO-USDT", "XMR-USDT", "DERO-BTC", "XMR-BTC"

func GetUnlistedDetails

func GetUnlistedDetails(scid string)

Get details for unlisted NFA and set display objects

func HowToMintNFA

func HowToMintNFA(button *widget.Button) fyne.CanvasObject

Tree object containing NFA minting instructions screen

func InfoDisplay added in v0.11.0

func InfoDisplay() fyne.CanvasObject

Set wallet and chain display content for menu

func IntroTree

func IntroTree(intros []IntroText) fyne.CanvasObject

Menu instruction tree

func IsClosing added in v0.11.0

func IsClosing() (close bool)

Check if menu is calling to close

func IsDreamsG45

func IsDreamsG45(check string) bool

dReams G45 collections

func IsDreamsNFACollection added in v0.11.0

func IsDreamsNFACollection(collection string) bool

Check if string is dReams NFA collection

func IsDreamsNFACreator added in v0.11.0

func IsDreamsNFACreator(creator string) bool

Check if string is dReams NFA creator address

func NFACoverImg added in v0.11.0

func NFACoverImg() fyne.CanvasObject

Returns NFA cover image for market display

func NFACreationExists

func NFACreationExists(collection string) bool

Check that all creation directories exists

func NFAIcon added in v0.11.0

func NFAIcon() fyne.CanvasObject

Returns NFA market icon image with frame

func NFAMarketInfo added in v0.11.0

func NFAMarketInfo() fyne.Container

Initialize market display objects

func NameEntry

func NameEntry() fyne.CanvasObject

Dero wallet name entry

func NotListedInfo

func NotListedInfo() fyne.Container

Returns container for unlisted display objects

func ParseURL added in v0.11.0

func ParseURL(url string) string

Parse url for ipfs prefix

func PlaceAssets

func PlaceAssets(tag string, profile fyne.CanvasObject, rescan func(), icon fyne.Resource, d *dreams.AppObject) *fyne.Container

Owned asset tab layout

  • tag for log print
  • profile is canvas object of widgets used to select assets for games, themes, etc
  • rescan is func used to rescan wallet assets
  • icon resources for side menus
  • d for main window dialogs

func PlaceMarket

func PlaceMarket(d *dreams.AppObject) *container.Split

Place NFA market layout

func PlaceNFAMint

func PlaceNFAMint(tag string, window fyne.Window) fyne.CanvasObject

Place objects for NFA minting of collections or single mint

func RateConfirm

func RateConfirm(scid string, d *dreams.AppObject)

Confirmation for a SCID rating

func ReadDeroSignFile added in v0.10.1

func ReadDeroSignFile(tag, sign_path string) (checkC string, checkS string, signer string)

Read a Dero .sign file and return signer, C and S signatures

func ReadDreamsConfig

func ReadDreamsConfig(tag string) (saved dreams.SaveData)

Read dReams platform config.json file

  • tag for log print
  • Sets up directory if none exists

func ResetAuctionInfo

func ResetAuctionInfo()

Reset auction display content to default values

func ResetBuyInfo

func ResetBuyInfo()

Reset buy now display content to default values

func ResetNotListedInfo

func ResetNotListedInfo()

Reset unlisted NFA display content to default values

func RestartGif

func RestartGif(g *xwidget.AnimatedGif)

Main gif seems to stop when hidden for 5min+ will use this for now to check if running and restart

func ReturnAssetCount

func ReturnAssetCount() (count int)

func ReturnEnabledG45s

func ReturnEnabledG45s(assets map[string]bool) (filter []string)

Returns search filter with all enabled G45s

func ReturnEnabledNFAs

func ReturnEnabledNFAs(assets map[string]bool) (filters []string)

Returns search filter with all enabled NFAs

func RunNFAMarket

func RunNFAMarket(d *dreams.AppObject, cont *fyne.Container)

Routine for NFA market, finds listings and disables controls, see PlaceAssets() and PlaceMarket() layouts

func SearchNFAsBy

func SearchNFAsBy(by int, prefix string) (results map[string]string)

Search NFAs in index by name or collection

  • by 0 is collection, 1 is name, 2 is description, 3 is scid

func SendMessageMenu

func SendMessageMenu(dest string, window_icon fyne.Resource)

Send Dero message menu

func SetClose added in v0.11.0

func SetClose(value bool)

Set menu closing bool value

func SetUpNFACreation

func SetUpNFACreation(tag, collection string) (save_path string, sign_path string)

Set up NFA-Creation directory with sub directory for collection or single asset, which contains sub directories for asset, bas, icon, cover and sign files

func ShowConfirmDialog added in v0.11.0

func ShowConfirmDialog(done chan struct{}, confirm interface{})

Shows a passed Fyne CustomDialog or ConfirmDialog and closes it if connection is lost

func ShowMessageDialog added in v0.11.0

func ShowMessageDialog(title, message string, delay time.Duration, w fyne.Window)

Create and show dialog for general messages

func ShowTxDialog added in v0.10.1

func ShowTxDialog(title, tag, txid string, delay time.Duration, w fyne.Window)

Create and show dialog for sent TX, dismiss copies txid to clipboard, dialog will hide after delay

func StartDreamsIndicators

func StartDreamsIndicators(add []DreamsIndicator) fyne.CanvasObject

dReams app status indicators for wallet, daemon, Gnomon and services

  • Pass further DreamsIndicators to add

func StartIndicators

func StartIndicators() fyne.CanvasObject

Dero status indicators for wallet, daemon and Gnomon

func StopIndicators

func StopIndicators(these []DreamsIndicator)

Stop dReams app status indicators

func SwitchProfileIcon added in v0.11.0

func SwitchProfileIcon(collection, name, url string, size float32) (icon *canvas.Image)

func ThemeSelect added in v0.11.0

func ThemeSelect(d *dreams.AppObject) fyne.CanvasObject

App theme selection object

  • If image is not present locally, it is downloaded

func ToolsBadge

func ToolsBadge() fyne.CanvasObject

Returns badge for dReam Tools enabled assets

func TrimStringLen

func TrimStringLen(str string, l int) string

Trim input string to specified len

func ValidNFA added in v0.11.0

func ValidNFA(file string) bool

Check if SCID is a valid NFA

  • file != "-"

func WriteDreamsConfig

func WriteDreamsConfig(u dreams.SaveData)

Save dReams config.json file for platform wide dApp use

Types

type Agent

type Agent struct {
	Attributes struct {
		Color  string `json:"Color"`
		IChing string `json:"I-ching"`
	} `json:"attributes"`
	ID    int    `json:"id"`
	Image string `json:"image"`
	Name  string `json:"name"`
}

Dero A-Team metadata struct

type Asset added in v0.11.0

type Asset struct {
	Name       string `json:"name"`
	Collection string `json:"collection"`
	SCID       string `json:"scid"`
	Type       string `json:"type"`
	Image      []byte `json:"image"`
}

Asset info

type Degen

type Degen struct {
	Attributes struct {
	} `json:"attributes"`
	ID    int    `json:"id"`
	Image string `json:"image"`
	Name  string `json:"name"`
}

type DreamsIndicator

type DreamsIndicator struct {
	Img       *canvas.Image
	Rect      *canvas.Rectangle
	Animation *fyne.Animation
}

type IntroText

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

Menu tree items for dApp intros

func MakeMenuIntro

func MakeMenuIntro(items map[string][]string) (entries []IntroText)

Create menu tree items for dApps

type NFAListing added in v0.11.0

type NFAListing struct {
	Name        string `json:"name"`
	Collection  string `json:"collection"`
	Description string `json:"description"`
	SCID        string `json:"scid"`
	Icon        []byte `json:"icon"`
	IconURL     string `json:"iconURL"`
}

NFA listing data

type Seal

type Seal struct {
	Attributes struct {
		Eyes        string `json:"Eyes"`
		FacialHair  string `json:"Facial Hair"`
		HairAndHats string `json:"Hair And Hats"`
		Shirts      string `json:"Shirts"`
	} `json:"attributes"`
	ID    int     `json:"id"`
	Image string  `json:"image"`
	Name  string  `json:"name"`
	Score float64 `json:"score"`
}

Dero Seals metadata struct

Jump to

Keyboard shortcuts

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