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 state

Back to all declarations

MaxPageSize

untyped bigint

Value

(50 <untyped> bigint)

priceWidth

untyped bigint

// types.MaxUnitPrice has 16 digits

Value

(16 <untyped> bigint)

ListingBytes

untyped bigint

Value

(4077 <untyped> bigint)

sentinel

untyped string

Value

"~"

listing

type

listing is the decoded form of one packed \`listings\` value.

Value

v1.listing

listings

v0.Tree

// cid:tid -> packed listing (encode)

Open
OID
0dd069…75d5:4
listings details

Inspect ref

byCollection

v0.Tree

// cid:paddedPrice:tid -> "" (floor = first key)

Open
OID
0dd069…75d5:6
byCollection details

Inspect ref

nextID

int64

Value

3

selfPath

string

// captured in init for read paths without a cur

Value

"gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1"

List

func(cid string, tid string, price int64) string

List offers a token of a Final collection at price (ugnot). The caller must own it and have approved this realm (Approve or SetApprovalForAll in core). A stale listing of the same token is replaced. Returns the listing's sequence id (events); the listing itself is addressed by (cid, tid).

Open
OID
0dd069…75d5:11
List details

Inspect func

UpdatePrice

func(cid string, tid string, price int64)

UpdatePrice changes the price of a live listing; Buy's expectedPrice protects buyers from a change racing their purchase (RA M-10).

Open
OID
0dd069…75d5:12
UpdatePrice details

Inspect func

Cancel

func(cid string, tid string)

Cancel removes the caller's listing (its storage deposit returns to the caller). Never paused.

Open
OID
0dd069…75d5:13
Cancel details

Inspect func

CancelStale

func(cid string, tid string)

CancelStale lets anyone remove a listing that can no longer be bought; the freed deposit goes to the caller (gno's rule), a cleanup bounty.

Open
OID
0dd069…75d5:14
CancelStale details

Inspect func

Buy

func(cid string, tid string, expectedPrice int64)

Buy pays exactly expectedPrice for the token's listing, plus the listing's deposit return (see the package doc); excess attached ugnot is refunded. Order: checks, remove the listing, move the token, then pay — protocol fee to the treasury, royalty to the collection's sub-treasury (then distributed to its payees), the engine author's fee, the rest plus the deposit return to the seller. I-4: protocol + royalty + engine + seller + refund == attached.

Open
OID
0dd069…75d5:15
Buy details

Inspect func

settlement

type

settlement is how a sale of l is paid now (I-4: protocol + royalty + engine + seller == price + deposit).

Value

v1.settlement

settle

func(l *v1.listing) v1.settlement
Open
OID
0dd069…75d5:16
settle details

Inspect func

Listing

func(cid string, tid string) string

Listing is the token's listing as JSON, stale ones included with "live":false, or "null".

Open
OID
0dd069…75d5:17
Listing details

Inspect func

ListingOf

func(cid string, tid string) string

ListingOf is the live listing of a token as JSON, or "null".

Open
OID
0dd069…75d5:18
ListingOf details

Inspect func

ActiveListing

func(cid string, tid string) (id string, price int64, ok bool)

ActiveListing is the typed read for other realms: the live listing of a token, if any (id is the sequence id).

Open
OID
0dd069…75d5:19
ActiveListing details

Inspect func

Quote

func(cid string, tid string) string

Quote is what Buy(cid, tid, price) costs and pays now, as JSON: {live, id, seller, price, deposit, total (attach this), protocolFee, royalty, royaltyTo, engineFee, engineAuthor, sellerProceeds}; "null" if unlisted.

Open
OID
0dd069…75d5:20
Quote details

Inspect func

ListingsByCollection

func(cid string, offset int64, limit int64) string

ListingsByCollection lists by ascending price. Stale listings are included with "live":false so pages stay stable; frontends hide them. Listings by seller: use the indexer (Listed / Cancelled events).

Open
OID
0dd069…75d5:21
ListingsByCollection details

Inspect func

Floor

func(cid string) int64

Floor is the lowest live price in cid, or -1. It inspects at most MaxPageSize listings from the cheapest, so spam cannot make it unbounded.

Open
OID
0dd069…75d5:22
Floor details

Inspect func

live

func(l *v1.listing, market .uverse.address) bool

live: still owned by the seller, not moved since listing, and the approval it was listed under is still in place and untouched since: a per-token listing dies with any later Approve of that token, an approval-for-all listing with any later SetApprovalForAll of the market by the seller — even one that approves again (SA-L3).

Open
OID
0dd069…75d5:24
live details

Inspect func

approvals

func(cid string, tid string, owner .uverse.address, market .uverse.address) (viaToken bool, viaAll bool)

approvals reports whether market is approved for this token, and whether it is approved for all of owner's tokens.

Open
OID
0dd069…75d5:25
approvals details

Inspect func

store

func(l *v1.listing)

store writes l and its price-index key.

Open
OID
0dd069…75d5:26
store details

Inspect func

remove

func(l *v1.listing, reason string)

remove deletes a listing and its index key; closed listings are not kept (RA L-6), the "Cancelled" event (reason sold/cancelled/stale) is the record.

Open
OID
0dd069…75d5:27
remove details

Inspect func

encode

func(l *v1.listing) string

encode packs a listing as one comma-separated string (M1: an inline avl value instead of a \*listing object, ~1.3 KB less per listing): id,seller,price,moves,height,feeBps,engBps,flags,tokenNonce,operatorNonce,deposit with flags = 1 (per-token) | 2 (for-all).

Open
OID
0dd069…75d5:28
encode details

Inspect func

decode

func(cid string, tid string, v string) *v1.listing
Open
OID
0dd069…75d5:29
decode details

Inspect func

lookup

func(cid string, tid string) (*v1.listing, bool)
Open
OID
0dd069…75d5:30
lookup details

Inspect func

mustListing

func(cid string, tid string) *v1.listing
Open
OID
0dd069…75d5:31
mustListing details

Inspect func

writeListingLive

func(w *v1.JSONWriter, l *v1.listing, isLive bool)
Open
OID
0dd069…75d5:32
writeListingLive details

Inspect func

assertSeller

func(l *v1.listing)
Open
OID
0dd069…75d5:33
assertSeller details

Inspect func

assertPrice

func(price int64)
Open
OID
0dd069…75d5:35
assertPrice details

Inspect func

pay

func(to .uverse.address, amount int64)
Open
OID
0dd069…75d5:38
pay details

Inspect func

tokenKey

func(cid string, tid string) string

tokenKey is the listing key. cid and tid are canonical ids (core accepted the token), so the key has one spelling per token.

Open
OID
0dd069…75d5:39
tokenKey details

Inspect func

collectionKey

func(l *v1.listing) string

collectionKey orders a collection's listings by price; the tid is the part after the last ':'.

Open
OID
0dd069…75d5:40
collectionKey details

Inspect func

prefixEnd

func(prefix string) string

prefixEnd is the smallest key greater than every key with this prefix (prefixes here end in ':', so bump it to ';').

Open
OID
0dd069…75d5:42
prefixEnd details

Inspect func

selfAddress

func() .uverse.address
Open
OID
0dd069…75d5:44
selfAddress details

Inspect func
MaxPageSize : untyped bigint =(50 <untyped> bigint)
priceWidth : untyped bigint =(16 <untyped> bigint)
ListingBytes : untyped bigint =(4077 <untyped> bigint)
sentinel : untyped string ="~"
listing : type =v1.listing
listings : v0.Tree Inspect
byCollection : v0.Tree Inspect
nextID : int64 =3
selfPath : string ="gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1"
init.9 : func() Inspect
List : func(cid string, tid string, price int64) string Inspect
UpdatePrice : func(cid string, tid string, price int64) Inspect
Cancel : func(cid string, tid string) Inspect
CancelStale : func(cid string, tid string) Inspect
Buy : func(cid string, tid string, expectedPrice int64) Inspect
settlement : type =v1.settlement
settle : func(l *v1.listing) v1.settlement Inspect
Listing : func(cid string, tid string) string Inspect
ListingOf : func(cid string, tid string) string Inspect
ActiveListing : func(cid string, tid string) (id string, price int64, ok bool) Inspect
Quote : func(cid string, tid string) string Inspect
ListingsByCollection : func(cid string, offset int64, limit int64) string Inspect
Floor : func(cid string) int64 Inspect
Render : func(path string) string Inspect
live : func(l *v1.listing, market .uverse.address) bool Inspect
approvals : func(cid string, tid string, owner .uverse.address, market .uverse.address) (viaToken bool, viaAll bool) Inspect
store : func(l *v1.listing) Inspect
remove : func(l *v1.listing, reason string) Inspect
encode : func(l *v1.listing) string Inspect
decode : func(cid string, tid string, v string) *v1.listing Inspect
lookup : func(cid string, tid string) (*v1.listing, bool) Inspect
mustListing : func(cid string, tid string) *v1.listing Inspect
writeListingLive : func(w *v1.JSONWriter, l *v1.listing, isLive bool) Inspect
assertSeller : func(l *v1.listing) Inspect
assertTradeOpen : func() Inspect
assertPrice : func(price int64) Inspect
received : func() int64 Inspect
assertNoDeposit : func() Inspect
pay : func(to .uverse.address, amount int64) Inspect
tokenKey : func(cid string, tid string) string Inspect
collectionKey : func(l *v1.listing) string Inspect
tidOfKey : func(k string) string Inspect
prefixEnd : func(prefix string) string Inspect
itoa : func(n int64) string Inspect
selfAddress : func() .uverse.address Inspect