Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

reader source realm

Package reader is the batch JSON read API for the frontend and the aggregator (design §2.5.6). It is private (re-depl...

Overview

Package reader is the batch JSON read API for the frontend and the aggregator (design §2.5.6). It is private (re-deployable in place, no other realm may import it) and holds no state or money: everything comes from core, market and r/sys/users.

sinopia4 (mainnet plan M-30): art, traits and metadata are read through core only — core serves media engines' files and per-collection trait names — so the reader imports no engine or upload realm and ships in the first package wave. Upload-only views (drop table, readiness, storage badge) are read by the frontend from the upload adapter itself.

Every string goes out through safe.JSONWriter, so stored text can never forge a record (RA H-1: the old TSV reader split on tabs and newlines). Art is never batched: one token per Art call, because SVG rendering is what exhausted the query gas in nftread1 (RA L-9).

Constants 1

const MaxCards, MaxTraitCounts, MaxStudio, MaxUploadCards, MaxUploadTraitCounts, MaxKitStudio

 1const (
 2	MaxCards       = 50
 3	MaxTraitCounts = 500
 4	MaxStudio      = 200
 5	// Collections of media engines (uploads: the creator's real trait names,
 6	// up to 8 types of 20 bytes and values of 32, read per token through
 7	// core since sinopia4, M-30) get smaller pages. assets/v1 refuses
 8	// < > & " \ in stored text (WP-Z), so core's JSON escaping of upload
 9	// traits stays cheap; what remains is the per-token fetch through core
10	// (adapter Traits + ValidateTraitsFor, ~11M per token on the worst
11	// store). Worst store (zz_worst_gas_test.gno, run wpz-1): Cards(20)
12	// 629M, TraitCounts(50) 658M (100: 1.18B, 200: 2.26B). The site counts
13	// rarity from Cards pages of 20 (frontend realms.live traitCounts). The
14	// reader is re-deployable in place.
15	MaxUploadCards       = 20
16	MaxUploadTraitCounts = 50
17	// Studio rarity over a Katman store kit: each sample's traits read up
18	// to 8 SlotArtwork + ArtworkMeta from the store (~17.3M on the largest
19	// kit, docs/engines/katman.md), so 200 samples would be ~4B.
20	MaxKitStudio = 50
21)
source

Batch limits. Hypothesis (S-4): sized for the genesis engine under the public qeval gas cap; measure on Onyx and lower if a full page runs out.

Functions 7

func Art

Action
1func Art(cid, tid string) string
source

Art is one token's core.TokenURI (placeholder before Final): an SVG or raster data URI, or the "ipfs://<CIDv1>" of an IPFS-stored file (I-15).

func Card

Action
1func Card(cid, tid string) string
source

Card is one token's checked SVG card data URI (core.TokenCard): the art of an SVG engine, the certificate card of a media engine; never remote.

func Cards

Action
1func Cards(cid string, offset, limit int64) string
source

Cards is one gallery page: [{tid, owner, ownerName, traits, listing}] for tokens offset+1 … offset+limit (limit <= 50; <= 20 for collections of media engines and of the Katman kit engine). Burned tokens are skipped; listing is {id, price} or null. Traits are core.TokenTraitList: checked against the collection's own trait list (an upload's real trait names, sinopia4 M-6).

func Profile

Action
1func Profile(addr address) string
source

Profile is {address, name, collections} for one address. A seller's listings come from the indexer (market "Listed"/"Cancelled" events): market/v1 keeps no per-seller index on chain (storage, M2).

func StudioTraits

Action
1func StudioTraits(engineID, params string, from, n int64) string
source

StudioTraits is TraitCounts for an engine and params over n sample seeds (engine.SampleSeed(from) …), for the Studio's rarity preview (n <= 200; <= 50 for the Katman kit engine).

func TraitCounts

Action
1func TraitCounts(cid string, offset, limit int64) string
source

TraitCounts counts trait values over tokens offset+1 … offset+limit: {"n": tokens counted, "counts": {type: {value: count}}} (limit <= 500; <= 50 for collections of media engines and of the Katman kit engine). Rarity % for a 1000-token collection takes two calls (twenty for an upload). Before Final every token reports Status=Unrevealed. Types and values in first-seen order.

Dependencies

Source Files 2