Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

avatar state

Back to all declarations

MinSize

untyped bigint

Value

(32 <untyped> bigint)

MaxSize

untyped bigint

Value

(2048 <untyped> bigint)

Notice

string

Value

""

NoticeType

v0.Type

Value

<zero>

RealmPath

string

Value

"/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar"

goSnippet

string

Value

"import \"gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar\"\n\nfunc RenderUser(addr address) string {\n\treturn avatar.Markdown(addr, 32, true) + \" \" + addr.String()\n}\n"

gnokeySnippet

string

Value

"gnokey query vm/qrender \\\n -remote <remote> \\\n -data \"gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar:svg/{address}?size=256\" \\\n | tail -n +2 | sed '1s/^data: //' > settler.svg\n"

TransferAdmin

func(newAdmin .uverse.address)

TransferAdmin makes another account the admin. Only the admin can call it.

Open
OID
0d4f58…3f89:12
TransferAdmin details

Inspect func

SetNotice

func(alertType v0.Type, msg string)

SetNotice posts a realm-wide message, shown at the top of the page.

Open
OID
0d4f58…3f89:13
SetNotice details

Inspect func

ClearNotice

func()

ClearNotice removes the current notice.

Open
OID
0d4f58…3f89:14
ClearNotice details

Inspect func

SVG

func(addr .uverse.address, size int, transparent bool) string

SVG returns the SVG document of the Settler of an address, or an empty text if it has none. The size is the width and height in pixels of the square image, from 32 to 2048 (multiples of 32 keep every art pixel as a whole number of screen pixels). A size of 0 or less leaves out the width and the height, so that the image scales to its container. If transparent is true, the image has no background.

Open
OID
0d4f58…3f89:15
SVG details

Inspect func

URI

func(addr .uverse.address, size int, transparent bool) string

URI returns the image of the Settler of an address as a "data:image/svg+xml;charset=utf-8," URI, that can be used as the source of an image or as the address of a Markdown image, or an empty text if it has none. The size and transparent are the same as in SVG.

Open
OID
0d4f58…3f89:16
URI details

Inspect func

Markdown

func(addr .uverse.address, size int, transparent bool) string

Markdown returns the avatar of an address as a Markdown image, or an empty text if it has none: ![Settler #12](data:image/svg+xml;charset=utf-8,...) The size and transparent are the same as in SVG.

Open
OID
0d4f58…3f89:17
Markdown details

Inspect func

lookup

func(addr .uverse.address) (v0.TokenID, v0.Traits)

lookup returns the ID and traits of the Settler of an address, or an empty ID and a zero-value Traits if it has none.

Open
OID
0d4f58…3f89:18
lookup details

Inspect func

options

func(size int, transparent bool) v0.Options

options builds the nft.Options for an image; size is clamped between MinSize and MaxSize (0 or less is left as 0, so the image has no fixed size and scales to its container), and transparent controls whether the background is drawn.

Open
OID
0d4f58…3f89:19
options details

Inspect func

assertIsValidAlertType

func(t v0.Type)
Open
OID
0d4f58…3f89:21
assertIsValidAlertType details

Inspect func

sampleSize

untyped bigint

Value

(48 <untyped> bigint)

samples

untyped bigint

Value

(6 <untyped> bigint)

Render

func(path string) string

Render renders the realm. By default renders what this realm is, how to use it, and some avatars. Paths: - \`svg/{address}\`: The SVG of the Settler of an address. - \`md/{address}\`: The Markdown that Markdown returns for an address, rendered, with the same parameters.

Open
OID
0d4f58…3f89:22
Render details

Inspect func

renderHome

func(res *v0.ResponseWriter, *v0.Request)
Open
OID
0d4f58…3f89:24
renderHome details

Inspect func

renderSVG

func(res *v0.ResponseWriter, req *v0.Request)
Open
OID
0d4f58…3f89:25
renderSVG details

Inspect func

renderMarkdown

func(res *v0.ResponseWriter, req *v0.Request)
Open
OID
0d4f58…3f89:26
renderMarkdown details

Inspect func

sizeParam

func(req *v0.Request) int
Open
OID
0d4f58…3f89:27
sizeParam details

Inspect func

transparentParam

func(req *v0.Request) bool
Open
OID
0d4f58…3f89:28
transparentParam details

Inspect func
MinSize : untyped bigint =(32 <untyped> bigint)
MaxSize : untyped bigint =(2048 <untyped> bigint)
Notice : string =""
NoticeType : v0.Type =<zero>
RealmPath : string ="/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar"
admin : *v0.Ownable Inspect
goSnippet : string ="import \"gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar\"\n\nfunc RenderUser(addr address) string {\n\treturn avatar.Markdown(addr, 32, true) + \" \" + addr.String()\n}\n"
gnokeySnippet : string ="gnokey query vm/qrender \\\n -remote <remote> \\\n -data \"gno.land/r/g17khqpukees4237dtn3astzapmp462vjhsz6st4/settlers/avatar:svg/{address}?size=256\" \\\n | tail -n +2 | sed '1s/^data: //' > settler.svg\n"
init.8 : func() Inspect
Admin : func() .uverse.address Inspect
TransferAdmin : func(newAdmin .uverse.address) Inspect
SetNotice : func(alertType v0.Type, msg string) Inspect
ClearNotice : func() Inspect
SVG : func(addr .uverse.address, size int, transparent bool) string Inspect
URI : func(addr .uverse.address, size int, transparent bool) string Inspect
Markdown : func(addr .uverse.address, size int, transparent bool) string Inspect
lookup : func(addr .uverse.address) (v0.TokenID, v0.Traits) Inspect
options : func(size int, transparent bool) v0.Options Inspect
assertIsCurrent : func() Inspect
assertIsValidAlertType : func(t v0.Type) Inspect
sampleSize : untyped bigint =(48 <untyped> bigint)
samples : untyped bigint =(6 <untyped> bigint)
Render : func(path string) string Inspect
renderHome : func(res *v0.ResponseWriter, *v0.Request) Inspect
renderSVG : func(res *v0.ResponseWriter, req *v0.Request) Inspect
renderMarkdown : func(res *v0.ResponseWriter, req *v0.Request) Inspect
sizeParam : func(req *v0.Request) int Inspect
transparentParam : func(req *v0.Request) bool Inspect