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 types holds the value types shared by core, the minters, the market and the readers. Every type is plain data...

Overview

Package types holds the value types shared by core, the minters, the market and the readers. Every type is plain data (no pointers into realm state), so passing one across a realm boundary hands over a copy and never a capability.

Constants 3

const MaxUnitPrice

1const MaxUnitPrice = 1_000_000_000_000_000
source

MaxUnitPrice caps every price (ugnot) so price*count and fee math stay far from int64 overflow: 1e15 ugnot = 1e9 GNOT.

Types 7

type CollectionInfo

struct
 1type CollectionInfo struct {
 2	ID, Name, Symbol, Description string
 3	Creator                       address
 4	Minter, EngineID, Params      string
 5	State                         State
 6	MaxSupply, Minted, Reserved   int64
 7	StartHeight, EndHeight        int64
 8	RevealDeadline                int64 // 0 before Launch
 9	RoyaltyBps                    int64
10	Badge                         string // provenance badge once Final
11}
source

CollectionInfo is core's typed read model for other realms.

type CollectionSpec

struct
1type CollectionSpec struct {
2	Name, Symbol, Description string
3	EngineID, Params          string
4	MaxSupply, RoyaltyBps     int64
5	PrimaryPayees             string
6	RoyaltyPayees             string
7}
source

CollectionSpec is what a minter asks core to create. Payees travel as "addr:bps,…" strings and are parsed by core, so core never stores a slice allocated by another realm.

type Fees

struct
1type Fees struct {
2	CreateFee    int64 // ugnot per collection
3	PrimaryBps   int64 // of every primary sale
4	SecondaryBps int64 // of every market sale
5	Treasury     address
6}
source

Fees are the protocol's fee parameters; core enforces hard caps.

type LaunchSpec

struct
1type LaunchSpec struct {
2	StartHeight, EndHeight int64
3	RevealWindow           int64 // blocks after close; core bounds it
4	CreatorCommit          string
5	UseBeacon              bool
6}
source

LaunchSpec freezes a collection's sale window and commitments (I-6).

type Payee

struct
1type Payee struct {
2	Addr address
3	Bps  int64
4}
source

Payee receives Bps/10000 of a payment.

type Phase

struct
1type Phase struct {
2	Kind, Set              string
3	StartHeight, EndHeight int64
4	StartPrice, FloorPrice int64
5	StepBlocks, StepAmount int64
6	WalletCap              int64
7}
source

Phase is one sale window. A fixed price has StartPrice == FloorPrice and no steps; a Dutch auction starts at StartPrice and drops StepAmount every StepBlocks until FloorPrice (design §4.5). WalletCap counts lifetime mints of the collection (I-9); 0 means no cap.

Methods on Phase

func Covers

method on Phase
1func (p Phase) Covers(h int64) bool
source

Covers reports whether height h is inside the phase window.

func PriceAt

method on Phase
1func (p Phase) PriceAt(h int64) int64
source

PriceAt is the unit price at height h:

Example
1max(floor, start - floor((h-startH)/stepBlocks) * stepAmount)

computed so that no intermediate value can overflow.

func Validate

method on Phase
1func (p Phase) Validate() error
source

Validate checks a phase in isolation; the minter checks the set grammar and how phases relate to each other.

type State

ident
1type State int
source

State is a collection's lifecycle (design §4.1):

Example
1Draft -> Scheduled -> Minting -> Closed -> Final

Scheduled->Minting and Minting->Closed happen by block height; core reports the effective state and materializes it on the next write.

Methods on State

func String

method on State
1func (s State) String() string
source

Dependencies

Imports 1

/p/g19dzk54hhsdc3gllpksuj6gu4a3e6fl8cr6rn4w/sinopia/types/v1

Imported by indexer

Source Files 2