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.

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.

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

1const (
2	MaxCards       = 50
3	MaxTraitCounts = 500
4	MaxStudio      = 200
5)
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 6

func Art

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

Art is one token's data URI (placeholder before Final).

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. Burned tokens are skipped; listing is {id, price} or null.

func Profile

Action
1func Profile(addr address) string
source

Profile is {address, name, collections, listings} for one address.

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.

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}}}. Rarity % for a 1000-token collection takes two calls. Before Final every token reports Status=Unrevealed.

Dependencies

Source Files 2