MaxPageSize
untyped bigintValue
(50 <untyped> bigint)
priceWidth
untyped bigint// types.MaxUnitPrice has 16 digits
Value
(16 <untyped> bigint)
StoragePrice
untyped bigintValue
(100 <untyped> bigint)
ListingBytes
untyped bigint// a listing while others are active (listings + byCollection keys)
Value
(4090 <untyped> bigint)
ApprovalBytes
untyped bigint// grc721 tokenApprovals entry of a per-token Approve, cleared by the transfer
Value
(2044 <untyped> bigint)
ListingDeposit
untyped bigintValue
(409000 <untyped> bigint)
ApprovalDeposit
untyped bigintValue
(204400 <untyped> bigint)
listing
typelisting is the decoded form of one packed \`listings\` value.
Value
v1.listing
listings
v0.Tree// cid:tid -> packed listing (encode)
- OID
- 0f0285…639c:4
listings details
byCollection
v0.Tree// cid:paddedPrice:tid -> "" (floor = first key)
- OID
- 0f0285…639c:6
byCollection details
nextID
int64Value
1
selfPath
string// captured in init for read paths without a cur
Value
"gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia/market/v1"
init.12
func()- OID
- 0f0285…639c:9
init.12 details
List
func(cid string, tid string, price int64) stringList 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).
- OID
- 0f0285…639c:11
List details
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).
- OID
- 0f0285…639c:12
UpdatePrice details
Cancel
func(cid string, tid string)Cancel removes the caller's listing (its storage deposit returns to the caller). Never paused.
- OID
- 0f0285…639c:13
Cancel details
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.
- OID
- 0f0285…639c:14
CancelStale details
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.
- OID
- 0f0285…639c:15
Buy details
settlement
typesettlement 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- OID
- 0f0285…639c:16
settle details
Listing
func(cid string, tid string) stringListing is the token's listing as JSON, stale ones included with "live":false, or "null".
- OID
- 0f0285…639c:17
Listing details
ListingOf
func(cid string, tid string) stringListingOf is the live listing of a token as JSON, or "null".
- OID
- 0f0285…639c:18
ListingOf details
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).
- OID
- 0f0285…639c:19
ActiveListing details
Quote
func(cid string, tid string) stringQuote 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.
- OID
- 0f0285…639c:20
Quote details
ListingsByCollection
func(cid string, offset int64, limit int64) stringListingsByCollection 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).
- OID
- 0f0285…639c:21
ListingsByCollection details
Floor
func(cid string) int64Floor is the lowest live price in cid, or -1. It inspects at most MaxPageSize listings from the cheapest, so spam cannot make it unbounded.
- OID
- 0f0285…639c:22
Floor details
Render
func(path string) string- OID
- 0f0285…639c:23
Render details
live
func(l *v1.listing, market .uverse.address) boollive: 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).
- OID
- 0f0285…639c:24
live details
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.
- OID
- 0f0285…639c:25
approvals details
store
func(l *v1.listing)store writes l and its price-index key.
- OID
- 0f0285…639c:26
store details
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.
- OID
- 0f0285…639c:27
remove details
encode
func(l *v1.listing) stringencode 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 with flags = 1 (per-token) | 2 (for-all); the deposit return follows from the flags (depositOf).
- OID
- 0f0285…639c:28
encode details
decode
func(cid string, tid string, v string) *v1.listing- OID
- 0f0285…639c:29
decode details
depositOf
func(viaToken bool) int64depositOf is a listing's deposit return: its own storage, plus the per-token approval the sale's transfer clears (an approval-for-all stays, so the seller keeps that deposit).
- OID
- 0f0285…639c:30
depositOf details
lookup
func(cid string, tid string) (*v1.listing, bool)- OID
- 0f0285…639c:31
lookup details
mustListing
func(cid string, tid string) *v1.listing- OID
- 0f0285…639c:32
mustListing details
writeListingLive
func(w *v1.JSONWriter, l *v1.listing, isLive bool)- OID
- 0f0285…639c:33
writeListingLive details
assertSeller
func(l *v1.listing)- OID
- 0f0285…639c:34
assertSeller details
assertTradeOpen
func()- OID
- 0f0285…639c:35
assertTradeOpen details
assertPrice
func(price int64)- OID
- 0f0285…639c:36
assertPrice details
received
func() int64- OID
- 0f0285…639c:37
received details
assertNoDeposit
func()- OID
- 0f0285…639c:38
assertNoDeposit details
pay
func(to .uverse.address, amount int64)- OID
- 0f0285…639c:39
pay details
tokenKey
func(cid string, tid string) stringtokenKey is the listing key. cid and tid are canonical ids (core accepted the token), so the key has one spelling per token.
- OID
- 0f0285…639c:40
tokenKey details
collectionKey
func(l *v1.listing) stringcollectionKey orders a collection's listings by price; the tid is the part after the last ':'.
- OID
- 0f0285…639c:41
collectionKey details
tidOfKey
func(k string) string- OID
- 0f0285…639c:42
tidOfKey details
prefixEnd
func(prefix string) stringprefixEnd is the smallest key greater than every key with this prefix (prefixes here end in ':', so bump it to ';').
- OID
- 0f0285…639c:43
prefixEnd details
itoa
func(n int64) string- OID
- 0f0285…639c:44
itoa details
selfAddress
func() .uverse.address- OID
- 0f0285…639c:45