Denom
untyped stringDenom is the only asset this realm accepts.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.
Value
1000
StatusActive
untyped stringListing status values.
Value
"active"
StatusSold
untyped stringListing status values.
Value
"sold"
StatusCancelled
untyped stringListing status values.
Value
"cancelled"
MaxTitleLen
untyped bigintInput bounds.
Value
(80 <untyped> bigint)
MaxDescLen
untyped bigintInput bounds.
Value
(2000 <untyped> bigint)
MinPrice
int64Input bounds.
Value
1
listing
typeValue
market.listing
admin
.uverse.address// may set fee, fee recipient, stage successor
Value
<gnolang.StringValue>
pendingAdmin
.uverse.address// staged by TransferAdmin, completes via AcceptAdmin
Value
<zero>
feeRecipient
.uverse.address// may withdraw fees and sweep surplus
Value
<gnolang.StringValue>
feeBps
int64// fee snapshotted into NEW listings
Value
0
self
.uverse.address// this realm's address, captured at deploy
Value
<gnolang.StringValue>
nextID
int64Value
2
listings
*v0.Tree// padID(id) -> \*listing
- OID
- 08caff…7a57:10
listings details
ledger
*feeledger.Ledger- OID
- 08caff…7a57:13
ledger details
init.17
func()- OID
- 08caff…7a57:17
init.17 details
CreateListing
func(title string, description string, price int64, maxFeeBps int64) int64CreateListing publishes an immutable listing and returns its id. No coins are accepted (the storage deposit the caller pays is the anti-spam). The current protocol fee is snapshotted into the listing and must not exceed maxFeeBps, the ceiling the seller signed for; pass MaxFeeBps to accept any legal fee. Sellers may be EOAs or realms.
- OID
- 08caff…7a57:19
CreateListing details
Buy
func(id int64)Buy purchases an active listing. The buyer must be a direct EOA caller and attach EXACTLY the listed price in ugnot — any mismatch (including a price the seller changed by cancel-and-relist) aborts and the coins revert with the transaction. Settlement is atomic: the seller's proceeds (price minus the snapshotted fee) become claimable, the fee accrues to the pot, and the buyer is recorded. Terminal.
- OID
- 08caff…7a57:20
Buy details
CancelListing
func(id int64)CancelListing withdraws an active listing. Only the seller may cancel; no funds are involved. Terminal.
- OID
- 08caff…7a57:21
CancelListing details
Claim
func(amount int64)Claim sends amount ugnot of the caller's claimable proceeds back to the caller.
- OID
- 08caff…7a57:22
Claim details
ClaimAll
func()ClaimAll sends the caller's entire claimable proceeds back to the caller. Fails if there is nothing to claim.
- OID
- 08caff…7a57:23
ClaimAll details
WithdrawFees
func()WithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it.
- OID
- 08caff…7a57:24
WithdrawFees details
SweepDenom
func(denom string)SweepDenom sends the surplus of a single denomination to the fee recipient. For ugnot only the excess over Liabilities() moves; other denoms move wholly. Only the fee recipient may call it.
- OID
- 08caff…7a57:25
SweepDenom details
SetFeeBps
func(bps int64)SetFeeBps sets the protocol fee snapshotted into FUTURE listings. Existing listings keep the fee they were created under. Admin only; bounded by \[0, MaxFeeBps].
- OID
- 08caff…7a57:26
SetFeeBps details
SetFeeRecipient
func(next .uverse.address)SetFeeRecipient re-points the fee/surplus role, including the pot accrued so far. Admin only; zero address rejected.
- OID
- 08caff…7a57:27
SetFeeRecipient details
TransferAdmin
func(next .uverse.address)TransferAdmin STAGES a successor admin; the handoff completes only when that address calls AcceptAdmin (2-step, so a typo cannot brick administration — pattern adopted from memba\_appstore\_v2). Admin only; zero address rejected. Re-staging overwrites a previous stage.
- OID
- 08caff…7a57:28
TransferAdmin details
AcceptAdmin
func()AcceptAdmin completes a staged admin handoff. Only the staged address may call it.
- OID
- 08caff…7a57:29
AcceptAdmin details
ListingInfo
func(id int64) (seller .uverse.address, title string, price int64, feeBps int64, status string, buyer .uverse.address)ListingInfo returns a listing's fields by value: seller, title, price, snapshotted fee bps, status, and buyer (zero unless sold).
- OID
- 08caff…7a57:30
ListingInfo details
Description
func(id int64) stringDescription returns a listing's raw description text.
- OID
- 08caff…7a57:31
Description details
Quote
func(id int64) (price int64, fee int64, toSeller int64)Quote returns what a buyer pays and what the seller would receive for a listing, at its SNAPSHOTTED fee — the same arithmetic Buy performs (pattern from nsmarket/v4: a fee discovered after signing is a fee the seller was not told about).
- OID
- 08caff…7a57:32
Quote details
Admin
func() .uverse.address- OID
- 08caff…7a57:33
Admin details
PendingAdmin
func() .uverse.address- OID
- 08caff…7a57:34
PendingAdmin details
FeeRecipient
func() .uverse.address- OID
- 08caff…7a57:35
FeeRecipient details
FeeBps
func() int64FeeBps returns the fee that will be snapshotted into newly created listings (existing listings keep their own snapshot).
- OID
- 08caff…7a57:36
FeeBps details
NumListings
func() int64NumListings returns how many listings have ever been created.
- OID
- 08caff…7a57:37
NumListings details
BalanceOf
func(addr .uverse.address) int64BalanceOf returns addr's claimable proceeds.
- OID
- 08caff…7a57:38
BalanceOf details
UsersTotal
func() int64UsersTotal returns the sum of all claimable proceeds (the U term).
- OID
- 08caff…7a57:39
UsersTotal details
FeesAccrued
func() int64FeesAccrued returns the fee pot (the F term).
- OID
- 08caff…7a57:40
FeesAccrued details
Liabilities
func() int64Liabilities returns everything this realm owes: UsersTotal + FeesAccrued (listings hold no value by construction).
- OID
- 08caff…7a57:41
Liabilities details
Held
func() int64Held returns the ugnot actually held at the realm address (H).
- OID
- 08caff…7a57:42
Held details
Surplus
func() int64Surplus returns Held() - Liabilities() (the S term).
- OID
- 08caff…7a57:43
Surplus details
Address
func() .uverse.address- OID
- 08caff…7a57:44
Address details
Render
func(path string) stringRender shows the market at "" and a listing detail at "\<id>". Titles are charset-restricted; descriptions pass through the ecosystem sanitizer.
- OID
- 08caff…7a57:45
Render details
renderListing
func(path string) string- OID
- 08caff…7a57:46
renderListing details
assertNoSend
func()assertNoSend refuses coins on non-payable entrypoints: an accidental -send would otherwise strand at the realm as sweep-only surplus (pattern from nsmarket/v4). Buy is the only payable function. NOTE: this reads the ORIGIN envelope — for EOA callers that is exactly "coins that landed here"; for realm callers it fails closed whenever the origin tx carried any -send (see the header caveat).
- OID
- 08caff…7a57:47
assertNoSend details
assertAdmin
func(caller .uverse.address)- OID
- 08caff…7a57:48
assertAdmin details
mustGetListing
func(id int64) *market.listing- OID
- 08caff…7a57:49
mustGetListing details
assertValidTitle
func(title string)assertValidTitle bounds length and restricts the charset so titles are list-safe in Render without escaping.
- OID
- 08caff…7a57:50
assertValidTitle details
padID
func(id int64) stringpadID renders an id as a fixed-width key so avl iteration order is numeric order.
- OID
- 08caff…7a57:51
padID details
itoa
func(n int64) string- OID
- 08caff…7a57:52