1package nft23import (4 "chain/runtime"56 "gno.land/p/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/nft/v0"7 "gno.land/p/nt/grc721/v0"8)910// TokenURI returns the Settler image as an SVG data URI.11// Wallets such as Adena read TokenURI directly as the token image,12// so this must be the image itself. The metadata lives in TokenMetadata.13func TokenURI(tid grc721.TokenID) (string, error) {14 traits, err := TraitsOf(tid)15 if err != nil {16 return "", err17 }1819 return nft.RenderDataURI(traits, nft.Options{Size: nft.CanonicalSize}), nil20}2122// TokenMetadata returns a JSON string with the metadata of a Settler23// in the format the Adena wallet can understand.24func TokenMetadata(tid grc721.TokenID) (string, error) {25 traits, err := TraitsOf(tid)26 if err != nil {27 return "", err28 }2930 var attrs string31 for i, attr := range traits.Attributes() {32 if i > 0 {33 attrs += ","34 }3536 attrs += `{"traitType":"` + attr.Type + `","value":"` + attr.Value + `"}`37 }3839 return `{"name":"Settler #` + string(tid) + `",` +40 `"description":"Soulbound gnome of the early settlers of Gno.land. ` + nft.Credits + `",` +41 `"image":"` + nft.RenderDataURI(traits, nft.Options{Size: nft.CanonicalSize}) + `",` +42 `"externalUrl":"` + ExternalURL(tid) + `",` +43 `"attributes":[` + attrs + `]}`, nil44}4546// ExternalURL returns the URL to a Settler profile page.47func ExternalURL(tid grc721.TokenID) string {48 return "https://" + runtime.ChainDomain() + RealmPath + ":token/" + string(tid)49}50Admin() string
Approve(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, to string, tid string)
BalanceOf(owner string) (int64, interface {Error func() string})
Cap() int
ClearNotice(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
ExternalURL(tid string) string
GetApproved(tid string) (string, interface {Error func() string})
GetName() string
GetSymbol() string
ID() string
IsApprovedForAll(owner string, operator string) bool
MerkleRoot() string
Mint(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, proof string) string
OwnerOf(tid string) (string, interface {Error func() string})
Render(path string) string
SetApprovalForAll(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, operator string, approved bool)
SetNotice(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, alertType string, msg string)
SetSnapshot(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, rootHex string, count int)
Token() interface {Approve func(int, .uverse.realm, .uverse.address, gno.land/p/nt/grc721/v0.TokenID) .uverse.error; BalanceOf func(.uverse.address) (int64, .uverse.error); GetApproved func(gno.land/p/nt/grc721/v0.TokenID) (.uverse.address, .uverse.error); GetName func() string; GetSymbol func() string; ID func() string; IsApprovedForAll func(.uverse.address, .uverse.address) bool; OwnerOf func(gno.land/p/nt/grc721/v0.TokenID) (.uverse.address, .uverse.error); SetApprovalForAll func(int, .uverse.realm, .uverse.address, bool) .uverse.error; TotalSupply func() int64; TransferFrom func(int, .uverse.realm, .uverse.address, .uverse.address, gno.land/p/nt/grc721/v0.TokenID) .uverse.error}
TokenMetadata(tid string) (string, interface {Error func() string})
TokenOf(addr string) string
TokenURI(tid string) (string, interface {Error func() string})
Total() int
TotalSupply() int64
TraitsOf(tid string) (struct{Skin uint8; Hat uint8; BeardColor uint8; Tunic uint8; Background uint8; HatShape uint8; Flip uint8; Glasses uint8; Beard uint8}, interface {Error func() string})
TransferAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, newAdmin string)
TransferFrom(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, from string, to string, tid string)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.