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.

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

 1const (
 2	MaxCards       = 50
 3	MaxTraitCounts = 500
 4	MaxStudio      = 200
 5	// Uploaded collections carry the creator's real trait names (up to 8 types
 6	// of 32 bytes); pages are smaller so the worst store the asset limits allow
 7	// stays <= 1B test gas per read (review UP-M1, zz_worst_gas_test.gno).
 8	MaxUploadCards       = 20
 9	MaxUploadTraitCounts = 200
10)
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 8

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 (limit <= 50; <= 20 for uploaded collections). Burned tokens are skipped; listing is {id, price} or null. Uploaded collections carry the creator's real trait names (upload.TraitLists, one permutation key per page) instead of core's fixed engine slots.

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 SetComposition

Action
1func SetComposition(cid string) string
source

SetComposition passes upload.SetComposition through: slots per creator-assigned tier and trait value over an uploaded collection's set.

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}}} (limit <= 500; <= 200 for uploaded collections). Rarity % for a 1000-token collection takes two calls (five for an uploaded one). Before Final every token reports Status=Unrevealed.

func UploadStatus

Action
1func UploadStatus(cid string) string
source

UploadStatus passes upload.Status through (mint gating, storage badge).

Dependencies

Source Files 2