Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

market/v1 package

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

A token has at most one listing, addressed by (cid, tid). Stale listings (RA H-2) cannot be bought: a listing pins the token's move counter and core's approval nonces at listing time, and Buy requires owner == seller, the counter unchanged and the approval it was listed under still in place, unchanged (I-8). Once stale, a listing stays dead: approving the market again later never revives it (SA-L3). A stale listing never blocks the new owner: List overwrites it and anyone may CancelStale it.

Storage (storage-cost-analysis M1-M3): a listing is one packed string in `listings` (key cid:tid) plus one key in the price index `byCollection` (floor, collection pages). Per-seller history comes from the indexer ("Listed"/"Cancelled" events), not from an on-chain index.

Deposit return: gno refunds a freed storage deposit to the signer of the transaction that frees it, so a Buy hands the buyer the deposit the seller locked for the listing. Buy therefore charges the buyer that amount on top of the price and pays it to the seller. The amount is core.ListingDeposit() (the measured listing storage x the chain's storage price; admin op listing.deposit, timelocked and capped), pinned into the listing at List, so a later change never alters a listing (CV-L2). It is exact up to a few bytes because every listing costs the same storage objects: a sentinel key keeps both trees non-empty (an avl insert into an empty tree creates one node, any later insert two). Net, the seller is whole and the buyer pays the price (the chain's refund cancels the extra). Not compensated: the deposit of a per-token Approve, which the sale's transfer clears (~0.1-0.2 GNOT to the buyer, depending on the collection's other pending approvals); an approval-for-all is not cleared, so listing under SetApprovalForAll leaves nothing behind.

Pause ("trade" in core) stops List and Buy only. Cancel, CancelStale and UpdatePrice are never paused (I-2).

Functions

ActiveListing

func ActiveListing(cid, tid string) (id string, price int64, ok bool)
Ask AI Claude ChatGPT

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.ActiveListing(,)"

Result

Buy

func Buy(cur realm, cid, tid string, expectedPrice int64)
Ask AI Claude ChatGPT

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.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "Buy" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "Buy" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Cancel

func Cancel(cur realm, cid, tid string)
Ask AI Claude ChatGPT

Cancel removes the caller's listing (its storage deposit returns to the caller). Never paused.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "Cancel" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "Cancel" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

CancelStale

func CancelStale(cur realm, cid, tid string)
Ask AI Claude ChatGPT

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.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "CancelStale" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "CancelStale" -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Floor

func Floor(cid string) int64
Ask AI Claude ChatGPT

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.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.Floor()"

Result

List

func List(cur realm, cid, tid string, price int64) string
Ask AI Claude ChatGPT

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. Returns the listing's sequence id (events); the listing itself is addressed by (cid, tid).

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "List" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "List" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Listing

func Listing(cid, tid string) string
Ask AI Claude ChatGPT

Listing is the token's listing as JSON, stale ones included with "live":false, or "null".

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.Listing(,)"

Result

ListingOf

func ListingOf(cid, tid string) string
Ask AI Claude ChatGPT

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.ListingOf(,)"

Result

ListingsByCollection

func ListingsByCollection(cid string, offset, limit int64) string
Ask AI Claude ChatGPT

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.ListingsByCollection(,,)"

Result

Quote

func Quote(cid, tid string) string
Ask AI Claude ChatGPT

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.Quote(,)"

Result

Render

func Render(path string) string
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1.Render()"

Result

UpdatePrice

func UpdatePrice(cur realm, cid, tid string, price int64)
Ask AI Claude ChatGPT

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

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "UpdatePrice" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1" -func "UpdatePrice" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia3/market/v1, for example a function call with arguments.