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.

v1 source pure

Package genesis is the platform's first engine: a pure p/ port of the prototype's gen1 engine. The RNG stream, trait ...

Overview

Package genesis is the platform's first engine: a pure p/ port of the prototype's gen1 engine. The RNG stream, trait tables, draw order and SVG drawing are byte-for-byte nftgen1's, so a seed renders the same artwork here as there; genesis_test.gno pins trait vectors computed independently from the same algorithm.

What changed is only the packaging (RA L-7): it is a stateless p/ package implementing engine/v1, the seed comes from core's commit–reveal (so the salt/seed helpers and the gnoweb Render of nftgen1 are gone), and the engine takes no params.

Constants 1

const MaxSVGBytes

1const MaxSVGBytes = 32768
source

MaxSVGBytes: 8 symmetry x 14 elements of the widest primitive plus the densest ground and frame stays well under this (gen1 tested < 32,000).

Functions 6

func Manifest

1func Manifest() engine.Manifest
source

Manifest describes the engine. Author is left empty: the adapter realm that registers this engine sets the address that will ClaimEngine.

func Render

1func Render(in engine.Input) string
source

Render returns the raw SVG for in.Seed.

func SVG

1func SVG(seed string) string
source

SVG renders the artwork for a seed as a standalone SVG document.

func Traits

1func Traits(in engine.Input) []engine.Trait
source

Traits returns the ten traits of in.Seed in TraitTypes order.

func ValidateParams

1func ValidateParams(params string) error
source

ValidateParams: genesis has no parameters.

func TraitsOf

1func TraitsOf(seed string) TraitSet
source

TraitsOf returns the decoded traits for a seed.

Types 1

type TraitSet

struct
 1type TraitSet struct {
 2	Palette  string
 3	Shape    string
 4	Ground   string
 5	Frame    string
 6	Finish   string
 7	Aura     string
 8	Elements int
 9	Symmetry int
10	Score    int
11	Rarity   string
12}
source

TraitSet is the decoded properties of a seed. The SVG builder and the trait list both read this one struct, so picture and metadata cannot describe different artwork.

Dependencies

Source Files 2