v1 source realm
Package market is the platform's immutable fixed-price market (design §2.5.4). It never holds a token: the seller app...
Package market is the platform's immutable fixed-price market (design §2.5.4). It never holds a token: the seller approves this realm in core, the token stays in the seller's wallet, and Buy moves it through core's official grc721 RealmTeller in the same transaction that pays everyone. It never holds coins either (I-3).
Stale listings (RA H-2) cannot be bought: a listing pins the token's move counter at listing time, and Buy requires owner == seller and the counter unchanged (I-8). A listing that went stale never blocks the new owner: List overwrites it and anyone may CancelStale it.
Pause ("trade" in core) stops List and Buy only. Cancel, CancelStale and UpdatePrice are never paused (I-2).
1
12
func ActiveListing
ActionActiveListing is the typed read for other realms: the live listing of a token, if any.
func Buy
crossing ActionBuy 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.
func Cancel
crossing ActionCancel removes the caller's listing. Never paused.
func CancelStale
crossing ActionCancelStale lets anyone remove a listing that can no longer be bought.
func Floor
ActionFloor is the lowest live price in cid, or -1. It inspects at most MaxPageSize listings from the cheapest, so spam cannot make it unbounded.
func List
crossing ActionList 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.
func Listing
Actionfunc ListingOf
ActionListingOf is the live listing of a token as JSON, or "null".
func ListingsByCollection
ActionListingsByCollection lists by ascending price. Stale listings are included with "live":false so pages stay stable; frontends hide them.
func ListingsBySeller
Actionfunc Render
func UpdatePrice
crossing ActionUpdatePrice changes the price of a live listing; Buy's expectedPrice protects buyers from a change racing their purchase (RA M-10).