marketPath
untyped stringValue
"gno.land/r/samcrew/launchpad/market/v1"
StatusFilled
untyped stringValue
"filled"
StatusCancelled
untyped stringValue
"cancelled"
StatusReplaced
untyped stringValue
"replaced"
StatusExpired
untyped stringValue
"expired"
maxSecondaryFeeBPS
untyped bigint// 2% of a sale price
Value
(200 <untyped> bigint)
maxLifetime
untyped bigintValue
(7776000 <untyped> bigint)
graceToClose
untyped bigintValue
(604800 <untyped> bigint)
maxOrders
untyped bigintValue
(9999999999 <untyped> bigint)
Listing
typeListing offers one token at a fixed price. The seller keeps the token and approves this realm; nothing is held here. A listing exists while it is open and no longer, and can be bought only within the token's custody epoch it was made in.
Value
v1.Listing
lastListing
v0.IDValue
<zero>
listings
v0.Tree// listing key -> \*Listing, in creation order
- OID
- 0af88e…5f22:5
listings details
listed
v0.Tree// "\<collection>/\<token number key>" -> \*Listing
- OID
- 0af88e…5f22:7
listed details
bySeller
v0.Tree// "\<seller>/\<listing key>" -> \*Listing
- OID
- 0af88e…5f22:9
bySeller details
directCaller
func() .uverse.address- OID
- 0af88e…5f22:10
directCaller details
orderKey
func(prefix uint8, id string) (string, bool)orderKey reads an order ID, its prefix ('L' listing, 'O' offer) then its number, as its tree key.
- OID
- 0af88e…5f22:12
orderKey details
nextOrder
func(last *v0.ID, prefix string) (string, string)- OID
- 0af88e…5f22:13
nextOrder details
findListing
func(id string) *v1.ListingfindListing returns an open listing, or nil: a closed one is gone.
- OID
- 0af88e…5f22:14
findListing details
mustListing
func(id string) *v1.Listing- OID
- 0af88e…5f22:15
mustListing details
tokenKey
func(collection string, number int64) stringtokenKey sorts a collection's tokens in number order.
- OID
- 0af88e…5f22:16
tokenKey details
listingOf
func(collection string, number int64) *v1.ListinglistingOf returns the open listing of a token, or nil.
- OID
- 0af88e…5f22:17
listingOf details
sellable
func(collection string, number int64, seller .uverse.address) boolsellable reports whether seller owns the active token and has approved this realm for that token. Only a single-token approval counts, as an approval for all would outlive the token's moves.
- OID
- 0af88e…5f22:18
sellable details
pinned
func(collection string, price int64, expiresAt int64, currencyKey string, maxFeeBPS int64) int64pinned checks what every new order needs (a collection that can be sold, a price, a lifetime of at most 90 days) and returns the protocol fee to pin on it: the current one, which must not exceed what its owner accepts nor this realm's cap.
- OID
- 0af88e…5f22:19
pinned details
List
func(collection string, number int64, price int64, expiresAt int64, currencyKey string, maxFeeBPS int64) stringList offers the caller's token for sale and returns the listing ID. The caller must first approve this realm in the NFT ledger, and names the highest protocol fee it accepts; the fee in force is pinned on the listing. A new listing replaces the token's previous one.
- OID
- 0af88e…5f22:20
List details
closeListing
func(l *v1.Listing, status string)closeListing deletes a listing and says why in its closing event.
- OID
- 0af88e…5f22:21
closeListing details
live
func(l *v1.Listing) boollive reports whether a listing can be bought right now. A move or an approval change starts a new custody epoch, so a listing never comes back to life when a token that left the seller returns or the market is approved again: the seller lists anew.
- OID
- 0af88e…5f22:22
live details
Cancel
func(id string)Cancel withdraws a listing. The seller can always do it, paused market or not. Anyone can clear a listing whose seller no longer owns the token, or one that expired more than graceToClose ago; the chain returns the storage deposit of what a call frees to its caller, so clearing pays whoever does it.
- OID
- 0af88e…5f22:23
Cancel details
Buy
func(id string, currencyKey string, price int64)Buy pays a listing's exact price and moves the token to the caller. currencyKey and price are the terms the buyer read: a listing on other terms, such as an ID the buyer never saw, takes nothing.
- OID
- 0af88e…5f22:24
Buy details
GetListing
func(id string) v1.ListingGetListing returns an open listing; a closed or unknown ID aborts.
- OID
- 0af88e…5f22:25
GetListing details
Render
func(path string) string- OID
- 0af88e…5f22:26
Render details
OfferToken
untyped string// one named token
Value
"token"
OfferCollection
untyped string// any token of the collection
Value
"collection"
OfferTrait
untyped string// any token proven to carry a trait
Value
"trait"
StatusAccepted
untyped stringValue
"accepted"
StatusSuperseded
untyped stringValue
"superseded"
maxTraitBytes
untyped bigintValue
(100 <untyped> bigint)
Offer
typeOffer is a bid whose full price sits in this realm until it is accepted, cancelled by its buyer or returned after expiry. An offer exists while it is open and no longer.
Value
v1.Offer
lastOffer
v0.IDValue
<zero>
offers
v0.Tree// offer key -> \*Offer, in creation order
- OID
- 0af88e…5f22:29
offers details
open
v0.Tree// "\<collection>/\<offer key>" -> \*Offer
- OID
- 0af88e…5f22:31
open details
byBuyer
v0.Tree// "\<buyer>/\<offer key>" -> \*Offer
- OID
- 0af88e…5f22:33
byBuyer details
findOffer
func(id string) (*v1.Offer, string)findOffer returns an open offer and its key, or nil: a closed one is gone.
- OID
- 0af88e…5f22:34
findOffer details
mustOffer
func(id string) (*v1.Offer, string)- OID
- 0af88e…5f22:36
mustOffer details
TraitLeaf
func(collection string, number int64, trait string) [32]uint8TraitLeaf is the Merkle leaf that proves a token carries a trait, as committed by the collection's creator in the NFT ledger.
- OID
- 0af88e…5f22:37
TraitLeaf details
MakeOffer
func(kind string, collection string, number int64, trait string, price int64, expiresAt int64, currencyKey string, maxFeeBPS int64) stringMakeOffer escrows price and returns the offer ID. kind selects what the offer is for: number is set for a token offer, trait for a trait offer, and both are zero and empty otherwise. A trait offer needs a collection whose creator committed its traits. The protocol fee in force is pinned on the offer; it comes out of what the seller receives, never on top of the price, and maxFeeBPS is the highest the buyer lets a seller be charged.
- OID
- 0af88e…5f22:38
MakeOffer details
release
func(o *v1.Offer, key string, status string)release deletes an offer, takes its price out of escrow and says why in its closing event; the caller then pays the price out. Every exit goes through here, and an offer leaves escrow once, by its own key: with \`settled\`, an exit pays out exactly the price of the one offer it closed, so a fault in one offer's exit can never spend another offer's escrow.
- OID
- 0af88e…5f22:39
release details
refund
func(o *v1.Offer, key string, status string)refund returns an open offer's escrow to its buyer. Refunds never consult the config realm: no pause or policy change can hold a buyer's funds.
- OID
- 0af88e…5f22:40
refund details
CancelOffer
func(id string)CancelOffer takes back the caller's own open offer, expired or not.
- OID
- 0af88e…5f22:41
CancelOffer details
ExpireOffer
func(id string)ExpireOffer returns to its buyer the escrow of an offer that expired more than graceToClose ago. Anyone may call it: the price goes to the buyer, and the chain pays the caller the storage deposit of the bytes the offer occupied, so for a week after expiry only the buyer, with CancelOffer, takes its own offer back.
- OID
- 0af88e…5f22:42
ExpireOffer details
AcceptOffer
func(id string, number int64, proof string, currencyKey string, price int64)AcceptOffer sells the caller's token number to an open offer. proof is the comma-separated Merkle path of the token's trait for a trait offer, and empty otherwise. currencyKey and price are the terms the seller read: an offer on other terms, such as an ID the seller never saw, buys nothing. The caller must first approve this realm in the NFT ledger.
- OID
- 0af88e…5f22:43
AcceptOffer details
GetOffer
func(id string) v1.OfferGetOffer returns an open offer; a closed or unknown ID aborts.
- OID
- 0af88e…5f22:44
GetOffer details
EscrowOf
func(currencyKey string) int64EscrowOf is the total of open offers in a currency.
- OID
- 0af88e…5f22:45
EscrowOf details
escrow
map[string]int64escrow is, per currency, the total of open offers: everything this realm owes. Currencies are few (config allows sixteen), so a map is enough.
- OID
- 0af88e…5f22:47
escrow details
terms
typeterms is what this realm needs from config.
Value
v1.terms
policy
func(currencyKey string) v1.termspolicy returns the current terms after checking that the market 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.
- OID
- 0af88e…5f22:49
policy details
balance
func(key string) int64- OID
- 0af88e…5f22:50
balance details
surplus
func(key string) int64surplus is what the realm holds beyond its open offers. Every entry point must leave it exactly as it found it.
- OID
- 0af88e…5f22:52
surplus details
take
func(key string, amount int64) int64take collects exactly amount from the direct caller, attached for native coins and pulled for a token, and returns the surplus before the payment.
- OID
- 0af88e…5f22:53
take details
untouched
func(key string) int64untouched is take for an entry point that receives nothing.
- OID
- 0af88e…5f22:54
untouched details
pay
func(key string, to .uverse.address, amount int64)- OID
- 0af88e…5f22:55
pay details
settle
func(key string, collection string, price int64, feeBPS int64, seller .uverse.address, treasury .uverse.address)settle splits a sale price: the protocol fee to the treasury, each royalty to its receiver, the rest, rounding included, to the seller.
- OID
- 0af88e…5f22:56
settle details
settled
func(key string, before int64)settled aborts the transaction unless the realm holds exactly its open offers plus the surplus it had before the call: nothing taken is left behind, and nothing owed has been spent.
- OID
- 0af88e…5f22:57
settled details
num
func(n int64) string- OID
- 0af88e…5f22:58
num details
splitJSON
func(collection string, price int64, feeBPS int64) stringsplitJSON is how a price would be divided at a protocol fee: what the seller keeps, the treasury's fee and each royalty.
- OID
- 0af88e…5f22:60
splitJSON details
listingJSON
func(l *v1.Listing) string- OID
- 0af88e…5f22:61
listingJSON details
offerJSON
func(o *v1.Offer) string- OID
- 0af88e…5f22:62
offerJSON details
ListingJSON
func(id string) stringListingJSON is an open listing, or "null" once it is closed.
- OID
- 0af88e…5f22:63
ListingJSON details
OfferJSON
func(id string) stringOfferJSON is an open offer, or "null" once it is closed. An open offer can be past its expiry: it then only waits for its refund.
- OID
- 0af88e…5f22:64
OfferJSON details
maxSlice
untyped bigintLists are read in slices of 1 to maxSlice entries that start after a cursor: what identifies the last entry already read, or nothing to start from the beginning. Orders come and go between two reads, and a cursor never skips or repeats one that stayed. A slice costs the same wherever it starts.
Value
(50 <untyped> bigint)
sliceJSON
func(tree *v0.Tree, from string, to string, reverse bool, size int64, render func(...)) stringsliceJSON renders up to size entries of tree whose keys lie in \[from, to), in key order, or from the last key down when reverse.
- OID
- 0af88e…5f22:65
sliceJSON details
cursorKey
func(prefix uint8, cursor string) v0.IDcursorKey reads an order cursor: the ID of the last order already read.
- OID
- 0af88e…5f22:66
cursorKey details
after
func(prefix uint8, cursor string) stringafter is the first key an oldest-first slice may hold: the one following the cursor, or "" with no cursor.
- OID
- 0af88e…5f22:67
after details
below
func(prefix uint8, cursor string) stringbelow is the last key a newest-first slice may hold: the one preceding the cursor, or "" with no cursor. No order has key zero, so the first order's ID leaves nothing below it.
- OID
- 0af88e…5f22:68
below details
renderListing
func(v interface{...}) string- OID
- 0af88e…5f22:69
renderListing details
renderOffer
func(v interface{...}) string- OID
- 0af88e…5f22:70
renderOffer details
ListingsJSON
func(before string, size int64) stringListingsJSON reads every open listing, newest first, starting below the listing ID before ("" starts from the newest).
- OID
- 0af88e…5f22:71
ListingsJSON details
CollectionListingsJSON
func(collection string, afterNumber int64, size int64) stringCollectionListingsJSON reads a collection's open listings in token number order, starting after the token number afterNumber (0 starts from the first).
- OID
- 0af88e…5f22:72
CollectionListingsJSON details
account
func(who string) stringaccount checks an address argument of a view.
- OID
- 0af88e…5f22:73
account details
SellerListingsJSON
func(seller string, afterID string, size int64) stringSellerListingsJSON reads an account's open listings, oldest first, starting after the listing ID afterID ("" starts from the oldest).
- OID
- 0af88e…5f22:74
SellerListingsJSON details
OffersJSON
func(before string, size int64) stringOffersJSON reads every open offer, newest first, starting below the offer ID before ("" starts from the newest).
- OID
- 0af88e…5f22:75
OffersJSON details
CollectionOffersJSON
func(collection string, afterID string, size int64) stringCollectionOffersJSON reads a collection's open offers of every kind, oldest first, starting after the offer ID afterID ("" starts from the oldest).
- OID
- 0af88e…5f22:76
CollectionOffersJSON details
BuyerOffersJSON
func(buyer string, afterID string, size int64) stringBuyerOffersJSON reads an account's open offers, oldest first, starting after the offer ID afterID ("" starts from the oldest).
- OID
- 0af88e…5f22:77
BuyerOffersJSON details
TokenListingJSON
func(collection string, number int64) stringTokenListingJSON is the open listing of a token, or "null".
- OID
- 0af88e…5f22:78
TokenListingJSON details
TermsJSON
func(collection string, price int64) stringTermsJSON is what a sale costs now: the protocol fee a new listing would pin, and how a price would split for the collection. A fee of -1 means the lane is closed; config's ActionStatusJSON tells whether the market lane accepts new orders right now.
- OID
- 0af88e…5f22:79