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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

nsview/v2 package

Overview

Package nsview is the human-facing view — the third realm in the split, and the newest (2026-08-21).

It exists because an adversarial review found three defects in the old Render(), which lived inside the permanent `nsdata` vault: unescaped profile text injected into the page markdown, an O(domains × names) home page any user could inflate into a permanent denial of service, and navigation links that 404'd. All three were display bugs, and none of them could ever have been fixed, because that realm is deployed exactly once. The NFT artwork moved here for the same reason.

Display code is swappable now. This realm holds no state, reads everything from nsdata's exported API, and can be redeployed and re-pointed at any time with nothing to migrate.

Functions

BuildSVG

func BuildSVG(tid string) string
Ask AI Claude ChatGPT

BuildSVG renders a token. Everything on the card derives from four stored values — owner, registered, expires, and the domain's drawing — so a renewal moves `expires` and the bar, the time remaining and the years held all follow from it. Nothing is baked at mint: the card is generated on every read, which is what lets a domain's artwork be changed after its names have been sold.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.BuildSVG()"

Result

MarkerCentred

func MarkerCentred(s string, cx, y, size int, colour string, weight int) string
Ask AI Claude ChatGPT

MarkerCentred draws text centred on cx, which is what almost every caller here wants and what the SVG text-anchor attribute would have done for them if a font had been available.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.MarkerCentred(,,,,,)"

Result

MarkerText

func MarkerText(s string, x, y, size int, colour string, weight int) string
Ask AI Claude ChatGPT

MarkerText draws a line of text as stroked paths.

`size` is the CAP HEIGHT in user units, not an em size: it is the height of a capital letter, which is the measurement anybody positioning this by eye is actually thinking in.

`x` is the left edge and `y` is the TOP of the capitals, matching how the rest of this file positions things and unlike SVG's own text baseline, which is a trap when mixing the two.

The jitter is what makes it read as a pen rather than a plotter. It is derived from the character and its position, so it is stable: the same string renders identically on every read, which matters because these cards are regenerated constantly and a letter that wobbled between reads would look like a rendering fault.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.MarkerText(,,,,,)"

Result

MarkerWidth

func MarkerWidth(s string, size int) int
Ask AI Claude ChatGPT

MarkerWidth is what MarkerText will occupy, so a caller can centre it. Counts every character including the ones that draw nothing, because a space still advances.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.MarkerWidth(,)"

Result

NameplateSVG

func NameplateSVG(label, domain, face, pos string, light bool, expires int64) string
Ask AI Claude ChatGPT

NameplateSVG composites the name, the asterisk and the expiry over whatever is already on the card.

Example
1face   "mono" | "serif" | "sans"
2pos    "top" | "middle" | "bottom"
3light  true  = white letters with a black border
4       false = black letters with a white border

Only two ink pairs exist, and that is not a limitation waiting to be lifted. Both read on every background there is; a free colour choice does not, and mid-grey lettering on a mid-grey drawing is exactly what somebody will pick.

`now` is deliberately absent from the signature. Nothing here counts down, so nothing here needs the clock — see the note on the expiry.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.NameplateSVG(,,,,,)"

Result

RegisterWithLedger

func RegisterWithLedger(cur realm)
Ask AI Claude ChatGPT

RegisterWithLedger hands the ledger this realm's renderer. Anyone may call it: it only ever registers THIS realm's own drawing, and the ledger refuses unless this realm is the one it has approved.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsview/v2" -func "RegisterWithLedger" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-mnsrehearsal001/nsview/v2" -func "RegisterWithLedger" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Render

func Render(path string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.Render()"

Result

SkinCardSVG

func SkinCardSVG(name, art, lock string, light bool) string
Ask AI Claude ChatGPT

SkinCardSVG draws a skin token's own listing card.

Example
1name   the skin's name, as the shop shows it
2art    the sprite string
3lock   the extension it is restricted to, or "" for one that goes
4       on any name
5light  true  = pale lettering on a dark matte
6       false = dark lettering on a pale matte

The return is a whole document rather than a fragment, because unlike the nameplate this composites over nothing — it IS the card.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.SkinCardSVG(,,,)"

Result

TokenURI

func TokenURI(tid string) string
Ask AI Claude ChatGPT

TokenURI returns the full data: URI for a token, generated on every read so the image always reflects current state (never baked at mint).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-mnsrehearsal001/nsview/v2.TokenURI()"

Result