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 source realm

Package market is the platform's immutable fixed-price market (design §2.5.4). It never holds a token: the seller app...

Overview

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).

Constants 1

Functions 12

func ActiveListing

Action
1func ActiveListing(cid, tid string) (id string, price int64, ok bool)
source

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

func Buy

crossing Action
1func Buy(cur realm, listingID string, expectedPrice int64)
source

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.

func Cancel

crossing Action
1func Cancel(cur realm, listingID string)
source

Cancel removes the caller's listing. Never paused.

func CancelStale

crossing Action
1func CancelStale(cur realm, listingID string)
source

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

func Floor

Action
1func Floor(cid string) int64
source

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.

func List

crossing Action
1func List(cur realm, cid, tid string, price int64) string
source

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.

func ListingOf

Action
1func ListingOf(cid, tid string) string
source

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

func ListingsByCollection

Action
1func ListingsByCollection(cid string, offset, limit int64) string
source

ListingsByCollection lists by ascending price. Stale listings are included with "live":false so pages stay stable; frontends hide them.

func UpdatePrice

crossing Action
1func UpdatePrice(cur realm, listingID string, price int64)
source

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

Dependencies

Source Files 2