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.

v1 source pure

Package sima is a Sinopia engine: an on-chain PFP in the language of a risograph print. Every token is a bust printed...

Overview

Package sima is a Sinopia engine: an on-chain PFP in the language of a risograph print. Every token is a bust printed in three drum inks (two colours and a skin ink) plus a key ink for the line work; each plate is slightly misregistered, shadows are halftone dots and the signature mark is a nose drawn as one broken line. Rare tokens are print accidents.

Overprint is emulated with explicit colour layers: every overlap of two or three plates is drawn again, clipped to the overlap, in the product of the inks (what multiply blending would show). The output never uses mix-blend-mode, so wallets that ignore blending still show the right colours.

It is a port of the Sima prototype in the engine gallery (JavaScript) with curated ink sets, named expressions, one accessory slot, emulated overprint and integer maths. frontend/src/engines/sima.ts is a byte-identical TypeScript twin; sima_test.gno and sima.test.ts pin the same golden vectors.

Pure integer maths: no floats, no time, no block data.

Constants 3

const DefaultParams

1const DefaultParams = `{"inks":"Seeded"}`
source

DefaultParams is the canonical form of the defaults; it renders exactly like "".

const MaxSVGBytes

1const MaxSVGBytes = 12288
source

MaxSVGBytes: the largest output over 10,000 seeds is 5,243 B; more than 2x margin.

const ParamsSchema

1const ParamsSchema = `{"type":"object","properties":{` +
2	`"inks":{"type":"string","title":"Ink set","enum":["Seeded","Pink & Blue","Tangerine & Teal",` +
3	`"Red & Federal Blue","Green & Violet","Sunflower & Blue","Aqua & Burgundy","Pink & Green","Orange & Violet",` +
4	`"Kraft Press","Blue on Blush","Blueprint","Sinopia Earth"],"default":"Seeded"}}}`
source

ParamsSchema is the Studio form. Studio sends JSON.stringify of the values in this property order; ValidateParams accepts exactly that or "".

Functions 8

func Manifest

1func Manifest() engine.Manifest
source

Manifest describes the engine. Author and FeeBps are set by the adapter.

func Render

1func Render(in engine.Input) string
source

Render returns the raw SVG for in.Seed and in.Params.

func SVG

1func SVG(seed string, cfg Config) string
source

SVG renders the artwork for a seed under cfg.

func Traits

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

Traits returns the eight traits of in.Seed in TraitTypes order. It never renders: eight table draws.

func ValidateParams

1func ValidateParams(params string) error
source

ValidateParams accepts "" (the showcase defaults) and the canonical JSON.

func Defaults

1func Defaults() Config
source

Defaults is the showcase look (params "").

func ParseParams

1func ParseParams(params string) (Config, error)
source

ParseParams accepts "" or the canonical JSON Studio produces, nothing else.

func TraitsOf

1func TraitsOf(seed string, cfg Config) TraitSet
source

TraitsOf returns the decoded traits for a seed.

Types 2

type Config

struct
1type Config struct {
2	Inks int // -1: drawn from the seed, else an index into the ink sets
3}
source

Config is a parsed params string.

type TraitSet

struct
1type TraitSet struct {
2	Inks, Backdrop, Head, Hair, Expression, Outfit, Accessory, Print string
3}
source

TraitSet is the decoded properties of a seed under a config.

Dependencies

Source Files 2