Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

KindFixed

untyped string

// one price, open to every wallet

Value

"fixed"

KindAllowlist

untyped string

// only addresses under a Merkle root, each with its own allowance

Value

"allowlist"

KindHolder

untyped string

// one mint per token held in another collection

Value

"holder"

KindDutch

untyped string

// the price falls in a straight line until the stage ends

Value

"dutch"

maxPrimaryFeeBPS

untyped bigint

// 5% of a mint price

Value

(500 <untyped> bigint)

maxStages

untyped bigint

Value

(10 <untyped> bigint)

maxStageSeconds

untyped bigint

Value

(31536000 <untyped> bigint)

maxPerWallet

untyped bigint

Value

(1000000 <untyped> bigint)

stage

type

stage is one mint window of a collection, open during \[Start, End).

Value

v1.stage

stages

v0.Tree

// collection ID -> \[]stage, at most maxStages

Open
OID
04d01e…0246:4
stages details

Inspect ref

minted

v0.Tree

// "\<collection>/\<stage>/\<address>" -> int64

Open
OID
04d01e…0246:6
minted details

Inspect ref

gated

v0.Tree

// "\<collection>/\<stage>/\<gate token number>" -> true

Open
OID
04d01e…0246:8
gated details

Inspect ref

directCaller

func() .uverse.address
Open
OID
04d01e…0246:9
directCaller details

Inspect func

CreateCollection

func(name string, symbol string, description string, image string, banner string, website string, mode string, revocable bool, maxSupply int64, metadataMode string, baseURI string, placeholderURI string, commitment string, provenance string, royalties string, currencyKey string, maxFee int64) string

CreateCollection registers the caller's collection in the NFT ledger and pays the collection fee to the treasury. maxFee is the highest fee the caller accepts: a fee above it aborts before anything is taken, whatever the caller's allowance. Native coins are attached for exactly the fee; a token is pulled for exactly the fee. The collection terms are documented on nft.Create.

Open
OID
04d01e…0246:11
CreateCollection details

Inspect func

stagesOf

func(id string) []v1.stage
Open
OID
04d01e…0246:12
stagesOf details

Inspect func

requireCreator

func(id string)

requireCreator aborts unless the caller is the collection's creator. The creator may be a realm, a DAO for instance: what it signs here moves no funds. Coins attached to a user's call would stay in this realm, so they are refused; coins a realm's transaction carries belong to that realm.

Open
OID
04d01e…0246:13
requireCreator details

Inspect func

emitStage

func(id string, index int, s v1.stage)

emitStage publishes every term of a stage, so a reader of events alone knows what each stage sells.

Open
OID
04d01e…0246:14
emitStage details

Inspect func

newStage

func(id string, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string) v1.stage

newStage validates a stage of collection id that has not started. Fields a kind does not use must be zero, so a stage reads the same to everyone. A holder stage is gated on another collection, and only on the tokens that collection had minted when the stage was placed: gated on its own, or on a collection gated on it in turn, every token minted would open one more mint.

Open
OID
04d01e…0246:16
newStage details

Inspect func

place

func(id string, index int, s v1.stage, maxFeeBPS int64)

place writes s at index (len(list) appends) after checking that the caller is the collection's creator, the mint lane accepts the currency, the protocol fee is within what the creator accepts and no other stage overlaps. The fee is pinned on the stage: a later change does not reach it.

Open
OID
04d01e…0246:17
place details

Inspect func

AddStage

func(id string, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string, maxFeeBPS int64) int

AddStage schedules a mint window and returns its index. The arguments are the terms of the stage, then the highest protocol fee the creator accepts. A collection has ten stages for its whole life: a stage that ended keeps its slot.

Open
OID
04d01e…0246:18
AddStage details

Inspect func

EditStage

func(id string, index int, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string, maxFeeBPS int64)

EditStage replaces a stage that has not started. Once a stage has opened its terms are final, whatever the replacement would have been: it can only be ended.

Open
OID
04d01e…0246:19
EditStage details

Inspect func

EndStage

func(id string, index int)

EndStage closes an open stage at once and for good. It asks no lane: a creator stops its own sale whatever is paused.

Open
OID
04d01e…0246:20
EndStage details

Inspect func

priceAt

func(s v1.stage, now int64) int64

priceAt is the stage price at a time inside its window.

Open
OID
04d01e…0246:21
priceAt details

Inspect func

stageKey

func(id string, index int) string
Open
OID
04d01e…0246:22
stageKey details

Inspect func

AllowlistLeaf

func(id string, index int, who .uverse.address, allowance int64) [32]uint8

AllowlistLeaf is the Merkle leaf that lets who mint up to allowance tokens in one stage: sha256(0x00 || "launchpad-drop-v1|\<collection>|\<stage>|\<address>|\<allowance>"). Only the chain's spelling of an address makes a leaf: a list written in capitals would name accounts that can never claim.

Open
OID
04d01e…0246:23
AllowlistLeaf details

Inspect func

entitled

func(s v1.stage, id string, index int, buyer .uverse.address, allowance int64, proof string, gateNumber int64) (limit int64, gateKey string)

entitled checks what the stage's kind requires of the buyer and returns how many tokens that wallet may mint in the stage. For a holder stage it also returns the key under which the gate token must be recorded as used.

Open
OID
04d01e…0246:24
entitled details

Inspect func

Mint

func(id string, index int, currencyKey string, offered int64, allowance int64, proof string, gateNumber int64) int64

Mint sells the caller one token of an open stage and returns its number. currencyKey and offered are what the caller accepts to pay: the stage must be priced in that currency, and offered is the most it will take. Native coins are attached for exactly offered and the difference with the price comes back, which is what makes a falling price payable; a token is pulled for exactly the price. The price is split between the treasury (the fee pinned on the stage) and the creator. allowance and proof are for an allowlist stage, gateNumber for a holder stage; elsewhere they are zero and empty.

Open
OID
04d01e…0246:25
Mint details

Inspect func

terms

type

terms is what this realm needs from config.

Value

v1.terms

termsOf

func(currencyKey string) v1.terms

termsOf reads the terms in force. The collection fee is -1 for a currency that has none.

Open
OID
04d01e…0246:27
termsOf details

Inspect func

policy

func(lane string, currencyKey string) v1.terms

policy returns the terms in force after checking that the lane is open for the currency. It is a variable only so that unit tests can stand in for the config realm, whose admin cannot be set from another package's tests.

Open
OID
04d01e…0246:30
policy details

Inspect func

balance

func(key string) int64

balance reads one denomination, so coins of other denominations sent to the realm never add to the cost of a payment.

Open
OID
04d01e…0246:31
balance details

Inspect func

take

func(key string, price int64, offered int64) int64

take collects price from the direct caller and returns what the realm held before. Native coins come attached: the caller attaches exactly offered, at least the price, and the difference goes straight back. A token is pulled for exactly the price.

Open
OID
04d01e…0246:32
take details

Inspect func

pay

func(key string, to .uverse.address, amount int64)
Open
OID
04d01e…0246:33
pay details

Inspect func

settled

func(key string, held int64)

settled aborts the transaction unless everything taken has been paid out: the realm must hold exactly what it held before the call.

Open
OID
04d01e…0246:34
settled details

Inspect func

StagesJSON

func(id string) string

StagesJSON lists a collection's stages in index order. "currentPrice" is the price a mint would pay now, and is only meaningful while "open" is true.

Open
OID
04d01e…0246:37
StagesJSON details

Inspect func

MintedBy

func(id string, index int, who string) int64

MintedBy is how many tokens who has minted in a stage. Only the chain's spelling of an address is an account: any other is refused, never read as 0.

Open
OID
04d01e…0246:38
MintedBy details

Inspect func

GateUsed

func(id string, index int, gateNumber int64) bool

GateUsed reports whether a gate token has already paid for a mint in a holder stage.

Open
OID
04d01e…0246:39
GateUsed details

Inspect func

TermsJSON

func(currencyKey string) string

TermsJSON is what creating a collection and scheduling a stage cost now: the collection fee in a currency and the protocol fee a new stage would pin. A value of -1 means the lane is closed; config's ActionStatusJSON tells whether a lane accepts new actions right now.

Open
OID
04d01e…0246:40
TermsJSON details

Inspect func
KindFixed : untyped string ="fixed"
KindAllowlist : untyped string ="allowlist"
KindHolder : untyped string ="holder"
KindDutch : untyped string ="dutch"
maxPrimaryFeeBPS : untyped bigint =(500 <untyped> bigint)
maxStages : untyped bigint =(10 <untyped> bigint)
maxStageSeconds : untyped bigint =(31536000 <untyped> bigint)
maxPerWallet : untyped bigint =(1000000 <untyped> bigint)
stage : type =v1.stage
stages : v0.Tree Inspect
minted : v0.Tree Inspect
gated : v0.Tree Inspect
directCaller : func() .uverse.address Inspect
CreateCollection : func(name string, symbol string, description string, image string, banner string, website string, mode string, revocable bool, maxSupply int64, metadataMode string, baseURI string, placeholderURI string, commitment string, provenance string, royalties string, currencyKey string, maxFee int64) string Inspect
stagesOf : func(id string) []v1.stage Inspect
requireCreator : func(id string) Inspect
emitStage : func(id string, index int, s v1.stage) Inspect
validRoot : func(s string) bool Inspect
newStage : func(id string, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string) v1.stage Inspect
place : func(id string, index int, s v1.stage, maxFeeBPS int64) Inspect
AddStage : func(id string, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string, maxFeeBPS int64) int Inspect
EditStage : func(id string, index int, kind string, start int64, end int64, price int64, floor int64, supplyCap int64, perWallet int64, root string, gate string, currencyKey string, maxFeeBPS int64) Inspect
EndStage : func(id string, index int) Inspect
priceAt : func(s v1.stage, now int64) int64 Inspect
stageKey : func(id string, index int) string Inspect
AllowlistLeaf : func(id string, index int, who .uverse.address, allowance int64) [32]uint8 Inspect
entitled : func(s v1.stage, id string, index int, buyer .uverse.address, allowance int64, proof string, gateNumber int64) (limit int64, gateKey string) Inspect
Mint : func(id string, index int, currencyKey string, offered int64, allowance int64, proof string, gateNumber int64) int64 Inspect
Render : func(path string) string Inspect
terms : type =v1.terms
termsOf : func(currencyKey string) v1.terms Inspect
policy : func(lane string, currencyKey string) v1.terms Inspect
balance : func(key string) int64 Inspect
take : func(key string, price int64, offered int64) int64 Inspect
pay : func(key string, to .uverse.address, amount int64) Inspect
settled : func(key string, held int64) Inspect
num : func(n int64) string Inspect
StagesJSON : func(id string) string Inspect
MintedBy : func(id string, index int, who string) int64 Inspect
GateUsed : func(id string, index int, gateNumber int64) bool Inspect
TermsJSON : func(currencyKey string) string Inspect