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 state

Back to all declarations

MaxPageSize

untyped bigint

Value

(50 <untyped> bigint)

idWidth

untyped bigint

Value

(12 <untyped> bigint)

priceWidth

untyped bigint

// types.MaxUnitPrice has 16 digits

Value

(16 <untyped> bigint)

listing

type

Value

v1.listing

listings

v0.Tree

// padded id -> \*listing

Open
OID
0a9cb3…ac82:4
listings details

Inspect ref

byToken

v0.Tree

// cid:tid -> id

Open
OID
0a9cb3…ac82:6
byToken details

Inspect ref

byCollection

v0.Tree

// cid:paddedPrice:paddedID -> id (floor = first key)

Open
OID
0a9cb3…ac82:8
byCollection details

Inspect ref

bySeller

v0.Tree

// seller:paddedID -> id

Open
OID
0a9cb3…ac82:10
bySeller details

Inspect ref

nextID

int64

Value

1

selfPath

string

// captured in init for read paths without a cur

Value

"gno.land/r/g19dzk54hhsdc3gllpksuj6gu4a3e6fl8cr6rn4w/minhwa2/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.

Open
OID
0a9cb3…ac82:15
List details

Inspect func

UpdatePrice

func(listingID 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
0a9cb3…ac82:16
UpdatePrice details

Inspect func

Cancel

func(listingID string)

Cancel removes the caller's listing. Never paused.

Open
OID
0a9cb3…ac82:17
Cancel details

Inspect func

CancelStale

func(listingID string)

CancelStale lets anyone remove a listing that can no longer be bought.

Open
OID
0a9cb3…ac82:18
CancelStale details

Inspect func

Buy

func(listingID string, expectedPrice int64)

Buy pays exactly expectedPrice for the listing (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 rest to the seller. I-4: fee + royalty + seller + refund == attached.

Open
OID
0a9cb3…ac82:19
Buy details

Inspect func

Listing

func(listingID string) string
Open
OID
0a9cb3…ac82:20
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
0a9cb3…ac82:21
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.

Open
OID
0a9cb3…ac82:22
ActiveListing 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.

Open
OID
0a9cb3…ac82:23
ListingsByCollection details

Inspect func

ListingsBySeller

func(seller .uverse.address, offset int64, limit int64) string
Open
OID
0a9cb3…ac82:24
ListingsBySeller 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
0a9cb3…ac82:25
Floor details

Inspect func

live

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

live: still owned by the seller, not moved since listing, still approved.

Open
OID
0a9cb3…ac82:27
live details

Inspect func

approved

func(cid string, tid string, owner .uverse.address, market .uverse.address) bool
Open
OID
0a9cb3…ac82:28
approved details

Inspect func

remove

func(l *v1.listing, reason string)

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

Open
OID
0a9cb3…ac82:29
remove details

Inspect func

listPrefix

func(index *v0.Tree, prefix string, offset int64, limit int64) string
Open
OID
0a9cb3…ac82:30
listPrefix details

Inspect func

writeListing

func(w *v1.JSONWriter, l *v1.listing)
Open
OID
0a9cb3…ac82:31
writeListing details

Inspect func

writeListingLive

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

Inspect func

mustListing

func(id int64) *v1.listing
Open
OID
0a9cb3…ac82:33
mustListing details

Inspect func

assertSeller

func(l *v1.listing)
Open
OID
0a9cb3…ac82:34
assertSeller details

Inspect func

assertPrice

func(price int64)
Open
OID
0a9cb3…ac82:36
assertPrice details

Inspect func

pay

func(to .uverse.address, amount int64)
Open
OID
0a9cb3…ac82:39
pay details

Inspect func

tokenKey

func(cid string, tid string) string
Open
OID
0a9cb3…ac82:40
tokenKey details

Inspect func

collectionKey

func(l *v1.listing) string
Open
OID
0a9cb3…ac82:41
collectionKey details

Inspect func

sellerKey

func(l *v1.listing) string
Open
OID
0a9cb3…ac82:42
sellerKey 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
0a9cb3…ac82:43
prefixEnd details

Inspect func

selfAddress

func() .uverse.address
Open
OID
0a9cb3…ac82:46
selfAddress details

Inspect func
MaxPageSize : untyped bigint =(50 <untyped> bigint)
idWidth : untyped bigint =(12 <untyped> bigint)
priceWidth : untyped bigint =(16 <untyped> bigint)
listing : type =v1.listing
listings : v0.Tree Inspect
byToken : v0.Tree Inspect
byCollection : v0.Tree Inspect
bySeller : v0.Tree Inspect
nextID : int64 =1
selfPath : string ="gno.land/r/g19dzk54hhsdc3gllpksuj6gu4a3e6fl8cr6rn4w/minhwa2/market/v1"
init.10 : func() Inspect
List : func(cid string, tid string, price int64) string Inspect
UpdatePrice : func(listingID string, price int64) Inspect
Cancel : func(listingID string) Inspect
CancelStale : func(listingID string) Inspect
Buy : func(listingID string, expectedPrice int64) Inspect
Listing : func(listingID string) string Inspect
ListingOf : func(cid string, tid string) string Inspect
ActiveListing : func(cid string, tid string) (id string, price int64, ok bool) Inspect
ListingsByCollection : func(cid string, offset int64, limit int64) string Inspect
ListingsBySeller : func(seller .uverse.address, 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
approved : func(cid string, tid string, owner .uverse.address, market .uverse.address) bool Inspect
remove : func(l *v1.listing, reason string) Inspect
listPrefix : func(index *v0.Tree, prefix string, offset int64, limit int64) string Inspect
writeListing : func(w *v1.JSONWriter, l *v1.listing) Inspect
writeListingLive : func(w *v1.JSONWriter, l *v1.listing, isLive bool) Inspect
mustListing : func(id int64) *v1.listing 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
sellerKey : func(l *v1.listing) string Inspect
prefixEnd : func(prefix string) string Inspect
parseID : func(s string) int64 Inspect
itoa : func(n int64) string Inspect
selfAddress : func() .uverse.address Inspect