admin
.uverse.address// set to the deployer in init
Value
<gnolang.StringValue>
pendingAdmin
.uverse.addressValue
<zero>
paused
boolValue
false
SetPaused
func(value bool)SetPaused stops or resumes new activity.
- OID
- 0ddf2e…ee8b:6
SetPaused details
ProposeAdmin
func(next string)ProposeAdmin names the next admin; the change happens when that address calls AcceptAdmin. Pass "" to withdraw a proposal.
- OID
- 0ddf2e…ee8b:8
ProposeAdmin details
AcceptAdmin
func()AcceptAdmin completes a handover started with ProposeAdmin.
- OID
- 0ddf2e…ee8b:9
AcceptAdmin details
IsPaused
func() boolIsPaused reports whether new activity is stopped.
- OID
- 0ddf2e…ee8b:10
IsPaused details
Admin
func() stringAdmin returns the current admin address, or "" when there is none.
- OID
- 0ddf2e…ee8b:11
Admin details
assertAdmin
func()- OID
- 0ddf2e…ee8b:12
assertAdmin details
assertNotPaused
func()- OID
- 0ddf2e…ee8b:13
assertNotPaused details
DefaultFeeBps
untyped bigintValue
(50 <untyped> bigint)
MaxFeeBps
untyped bigintValue
(100 <untyped> bigint)
feeBps
uint64Value
50
treasury
.uverse.address// set to the deployer in init; fees are off while it is empty
Value
<gnolang.StringValue>
fees
v0.Tree// kind + ":" + denom -> int64 fees collected
- OID
- 0ddf2e…ee8b:17
fees details
SetFee
func(bps uint64)SetFee sets the rate for rooms opened from now on, in basis points (50 is 0.5%), at most MaxFeeBps. Rooms already open keep their rate.
- OID
- 0ddf2e…ee8b:18
SetFee details
SetTreasury
func(to string)SetTreasury names the account that receives fees from now on.
- OID
- 0ddf2e…ee8b:20
SetTreasury details
FeeBps
func() uint64FeeBps returns the rate a room opened now would get.
- OID
- 0ddf2e…ee8b:21
FeeBps details
Treasury
func() stringTreasury returns the account that receives fees, or "" when fees are off.
- OID
- 0ddf2e…ee8b:22
Treasury details
openingFee
func() uint64openingFee is the rate a new room keeps for its whole life.
- OID
- 0ddf2e…ee8b:23
openingFee details
feeOf
func(amount int64, bps uint64) int64feeOf is the fee on amount at bps basis points, rounded down. It never overflows: bps is at most MaxFeeBps.
- OID
- 0ddf2e…ee8b:24
feeOf details
addFee
func(kind string, denom string, amount int64)- OID
- 0ddf2e…ee8b:25
addFee details
jsonString
func(s string) stringjsonString quotes s as a JSON string. Everything outside printable ASCII is written as a \\u escape, so the output is plain ASCII.
- OID
- 0ddf2e…ee8b:26
jsonString details
writeU16
func(b *strings.Builder, r int32)- OID
- 0ddf2e…ee8b:28
writeU16 details
jsonUint
func(v uint64) string- OID
- 0ddf2e…ee8b:29
jsonUint details
jsonInt
func(v int64) string- OID
- 0ddf2e…ee8b:30
jsonInt details
jsonBool
func(v bool) string- OID
- 0ddf2e…ee8b:31
jsonBool details
jsonObject
func(pairs []string) stringjsonObject joins already-encoded key/value pairs.
- OID
- 0ddf2e…ee8b:32
jsonObject details
jsonArray
func(items []string) string- OID
- 0ddf2e…ee8b:33
jsonArray details
MaxTokenIDLen
untyped bigintMaxTokenIDLen bounds what a room stores per NFT.
Value
(64 <untyped> bigint)
collection
typeValue
rooms.collection
collections
v0.Tree// "\<realm path>.\<symbol>" -> \*collection
- OID
- 0ddf2e…ee8b:35
collections details
RegisterCollection
func(token *v0.Token, list *v0.Enumerable) stringRegisterCollection makes a GRC721 collection tradable in rooms and returns its key. Only the collection's own realm can register it, once; list is its enumerable view, or nil. A collection's realm also lets owners approve this realm (see Address) for one token id, as its own Approve does; DepositNFT spends that approval. key := rooms.RegisterCollection(cross(cur), Token, List)
- OID
- 0ddf2e…ee8b:36
RegisterCollection details
DepositNFT
func(roomID uint64, collectionKey string, tokenID string)DepositNFT moves one NFT of a registered collection from the caller to this realm and adds it to the caller's side. The caller must first approve this realm's address (see Address) for that token id, in the collection's realm.
- OID
- 0ddf2e…ee8b:38
DepositNFT details
WithdrawNFT
func(roomID uint64, collectionKey string, tokenID string)WithdrawNFT returns one NFT from the caller's side to the caller. Same rules as WithdrawCoins: it works while the room is open, also after it has expired or while the realm is paused.
- OID
- 0ddf2e…ee8b:39
WithdrawNFT details
sendNFT
func(to .uverse.address, denom string)sendNFT pays one NFT out of this realm's custody.
- OID
- 0ddf2e…ee8b:40
sendNFT details
mustCollection
func(key string) *rooms.collection- OID
- 0ddf2e…ee8b:41
mustCollection details
assertTokenID
func(tid string)- OID
- 0ddf2e…ee8b:42
assertTokenID details
Offer
func(roomID uint64, version uint64, want string) uint64Offer turns the room into an offer for exactly want, on the room as it is at version. want lists one asset per line, at most 8: coin <amount> <denom> token <amount> <grc20reg key> nft 1 <collection key>#<token id> Amounts are in base units. Returns the new version, which the taker fills.
- OID
- 0ddf2e…ee8b:43
Offer details
Fill
func(roomID uint64, version uint64)Fill completes an offer: the caller takes the other seat, puts in exactly what the offer wants, and the room settles in this call. version is the version the caller reviewed. Coins in the offer must be attached to this call, from the caller's own account.
- OID
- 0ddf2e…ee8b:45
Fill details
parseWant
func(want string) []rooms.assetparseWant reads an offer's want list; see Offer.
- OID
- 0ddf2e…ee8b:46
parseWant details
wantString
func(items []rooms.asset) stringwantString writes a want list back in Offer's format.
- OID
- 0ddf2e…ee8b:47
wantString details
assertDenom
func(d string)assertDenom accepts bank denoms: 3 to 128 characters of lowercase letters, digits and / : . \_ -, starting with a letter.
- OID
- 0ddf2e…ee8b:48
assertDenom details
sameCoins
func(a chain.Coins, b chain.Coins) boolsameCoins reports whether a and b hold the same amount of every denom.
- OID
- 0ddf2e…ee8b:49
sameCoins details
maxPage
untyped bigintValue
(50 <untyped> bigint)
Address
func() stringAddress returns this realm's address: the spender to approve before DepositToken, and the account that holds deposits.
- OID
- 0ddf2e…ee8b:50
Address details
RoomJSON
func(id uint64) stringRoomJSON returns one room, or null when it does not exist.
- OID
- 0ddf2e…ee8b:52
RoomJSON details
RoomsOfJSON
func(addr string, offset int, limit int) stringRoomsOfJSON lists the rooms where addr is maker or taker, newest first.
- OID
- 0ddf2e…ee8b:53
RoomsOfJSON details
LatestJSON
func(offset int, limit int) stringLatestJSON lists all rooms, newest first.
- OID
- 0ddf2e…ee8b:54
LatestJSON details
StatsJSON
func() stringStatsJSON returns counters and the settled volume per asset.
- OID
- 0ddf2e…ee8b:55
StatsJSON details
TokensJSON
func(offset int, limit int) stringTokensJSON lists GRC20 tokens from the registry that rooms accept.
- OID
- 0ddf2e…ee8b:56
TokensJSON details
TokenJSON
func(key string, owner string) stringTokenJSON describes one registered token and, when owner is given, the owner's balance and current allowance to this realm.
- OID
- 0ddf2e…ee8b:57
TokenJSON details
BalancesJSON
func(owner string, offset int, limit int) stringBalancesJSON lists the registered GRC20 tokens that owner holds, with the balance and the allowance to this realm: a wallet's inventory in one query. A page covers limit registry entries (at most 50); read on while "more" is true.
- OID
- 0ddf2e…ee8b:58
BalancesJSON details
CollectionsJSON
func(offset int, limit int) stringCollectionsJSON lists the GRC721 collections registered with rooms.
- OID
- 0ddf2e…ee8b:59
CollectionsJSON details
NFTJSON
func(collectionKey string, tokenID string) stringNFTJSON describes one NFT of a registered collection: who owns it, and whether this realm is approved to move it. null when the collection is not registered or the token does not exist.
- OID
- 0ddf2e…ee8b:60
NFTJSON details
maxOwnedPerCollection
untyped bigintmaxOwnedPerCollection bounds one OwnedJSON page.
Value
(20 <untyped> bigint)
OwnedJSON
func(owner string, offset int, limit int) stringOwnedJSON lists the NFTs owner holds in registered collections that can be listed (those registered with their enumerable view), at most 20 per collection, and whether this realm is approved for each. A page covers limit collections; read on while "more" is true.
- OID
- 0ddf2e…ee8b:61
OwnedJSON details
tokenJSON
func(key string, tok *v0.Token) string- OID
- 0ddf2e…ee8b:62
tokenJSON details
assetsJSON
func(list []rooms.asset) string- OID
- 0ddf2e…ee8b:63
assetsJSON details
page
func(offset int, limit int) (int, int)- OID
- 0ddf2e…ee8b:64
page details
Render
func(path string) stringRender shows the realm on gnoweb: the home page lists recent rooms, and room/\<id> shows one room. Every value that comes from a caller goes through sanitize before it reaches the markdown.
- OID
- 0ddf2e…ee8b:65
Render details
renderHome
func() string- OID
- 0ddf2e…ee8b:67
renderHome details
renderRoom
func(r *rooms.room, now int64) string- OID
- 0ddf2e…ee8b:68
renderRoom details
renderSide
func(title string, s *rooms.side, version uint64) string- OID
- 0ddf2e…ee8b:69
renderSide details
sideSummary
func(s *rooms.side) string- OID
- 0ddf2e…ee8b:70
sideSummary details
wugnotKey
untyped stringwugnotKey is wrapped GNOT in the GRC20 registry. Its token declares 0 decimals because one unit is one ugnot, so it is shown in GNOT like the coin, marked as wrapped so the two are never confused.
Value
"gno.land/r/gnoland/wugnot.wugnot"
formatAsset
func(a rooms.asset) stringformatAsset writes an amount in whole units: GNOT for ugnot and wrapped GNOT, the registry's symbol and decimals for other tokens, the raw denom otherwise.
- OID
- 0ddf2e…ee8b:71
formatAsset details
decimal
func(amount int64, decimals int) stringdecimal formats amount with the given number of decimals and no trailing zeros.
- OID
- 0ddf2e…ee8b:72
decimal details
stamp
func(unix int64) stringstamp writes unix seconds as an RFC 3339 time in UTC.
- OID
- 0ddf2e…ee8b:73
stamp details
StatusOpen
untyped stringValue
"open"
StatusSettled
untyped stringValue
"settled"
StatusCancelled
untyped stringValue
"cancelled"
statusFilling
untyped stringValue
"filling"
KindCoin
untyped stringValue
"coin"
KindToken
untyped stringValue
"token"
KindNFT
untyped stringValue
"nft"
MaxAssetsPerSide
untyped bigintValue
(8 <untyped> bigint)
DefaultTTLMinutes
untyped bigintValue
(1440 <untyped> bigint)
MinTTLMinutes
untyped bigintValue
(10 <untyped> bigint)
MaxTTLMinutes
untyped bigintValue
(10080 <untyped> bigint)
asset
typeValue
rooms.asset
side
typeValue
rooms.side
room
typeA room keeps both sides inline and its times as unix seconds: every separate object costs storage deposit, and a room is opened often.
Value
rooms.room
rooms
v0.Tree// padded id -> \*room
- OID
- 0ddf2e…ee8b:75
rooms details
byParty
v0.Tree// address -> \[]uint64 room ids, oldest first
- OID
- 0ddf2e…ee8b:77
byParty details
volume
v0.Tree// kind + ":" + denom -> int64 settled amount; NFTs count per collection
- OID
- 0ddf2e…ee8b:79
volume details
lastID
uint64Value
1
nSettled
uint64Value
1
nCancelled
uint64Value
0
self
.uverse.addressValue
<gnolang.StringValue>
init.90
func()- OID
- 0ddf2e…ee8b:84
init.90 details
Open
func(counterparty string, ttlMinutes int) uint64Open creates a room with the caller as maker and returns its id. The room takes only verified assets (see Verify). counterparty is the taker's address, or "" to leave the seat open for the first account that calls Join. ttlMinutes is how long the room can settle; 0 means 24 hours, and the allowed range is 10 minutes to 7 days.
- OID
- 0ddf2e…ee8b:86
Open details
OpenMarket
func(counterparty string, ttlMinutes int) uint64OpenMarket is Open for a room that takes any registered asset, verified or not. Both parties trade unverified assets at their own risk; the app says so in every view of such a room.
- OID
- 0ddf2e…ee8b:87
OpenMarket details
open
func(counterparty string, ttlMinutes int, openMarket bool) uint64- OID
- 0ddf2e…ee8b:88
open details
Join
func(roomID uint64)Join takes the open taker seat of a room.
- OID
- 0ddf2e…ee8b:89
Join details
DepositCoins
func(roomID uint64)DepositCoins adds the coins sent with this call to the caller's side. It must be called directly from the depositing account (maketx call or a wallet MsgCall), because only then are the sent coins guaranteed to have reached this realm.
- OID
- 0ddf2e…ee8b:90
DepositCoins details
DepositToken
func(roomID uint64, tokenKey string, amount int64)DepositToken moves amount of a registered GRC20 token from the caller to this realm and adds it to the caller's side. The caller must first approve this realm's address (see Address) for at least amount.
- OID
- 0ddf2e…ee8b:91
DepositToken details
WithdrawCoins
func(roomID uint64, denom string, amount int64)WithdrawCoins returns amount of denom from the caller's side to the caller. It works while the room is open, also after it has expired or while the realm is paused.
- OID
- 0ddf2e…ee8b:92
WithdrawCoins details
WithdrawToken
func(roomID uint64, tokenKey string, amount int64)WithdrawToken returns amount of a GRC20 token from the caller's side to the caller. Same rules as WithdrawCoins.
- OID
- 0ddf2e…ee8b:93
WithdrawToken details
withdraw
func(roomID uint64, kind string, denom string, amount int64)- OID
- 0ddf2e…ee8b:94
withdraw details
Lock
func(roomID uint64, version uint64) stringLock records that the caller agrees to swap the room exactly as it is at version. It fails if the room has changed since. When the other side already holds a lock on the same version, this call settles the room and returns "settled"; otherwise it returns "locked".
- OID
- 0ddf2e…ee8b:95
Lock details
Unlock
func(roomID uint64)Unlock withdraws the caller's lock on the current version.
- OID
- 0ddf2e…ee8b:96
Unlock details
Cancel
func(roomID uint64)Cancel closes an open room and returns every deposit to its owner. Either party may cancel at any time before settlement; once the room has expired, anyone may cancel it.
- OID
- 0ddf2e…ee8b:97
Cancel details
send
func(to .uverse.address, a rooms.asset)send pays one asset out of this realm's custody.
- OID
- 0ddf2e…ee8b:98
send details
refuseCoins
func()refuseCoins stops a direct call that carries coins to any function other than DepositCoins. Such coins would reach this realm with nothing recording them; failing the call sends them back.
- OID
- 0ddf2e…ee8b:99
refuseCoins details
callerOf
func() .uverse.address- OID
- 0ddf2e…ee8b:100
callerOf details
mustRoom
func(id uint64) *rooms.room- OID
- 0ddf2e…ee8b:101
mustRoom details
index
func(who .uverse.address, id uint64)index records that who is a party of room id. One growing list per account keeps a returning trader's next room cheap to store.
- OID
- 0ddf2e…ee8b:102
index details
addVolume
func(a rooms.asset)- OID
- 0ddf2e…ee8b:103
addVolume details
roomKey
func(id uint64) stringroomKey zero-pads ids so the tree iterates in numeric order.
- OID
- 0ddf2e…ee8b:104
roomKey details
idString
func(id uint64) string- OID
- 0ddf2e…ee8b:105
idString details
VerifyDelay
untyped bigint// seconds
Value
(86400 <untyped> bigint)
maxReason
untyped bigintmaxReason bounds a verification's public reason.
Value
(280 <untyped> bigint)
verification
typeValue
rooms.verification
verified
v0.Tree// asset class -> \*verification
- OID
- 0ddf2e…ee8b:107
verified details
seedVerified
func()seedVerified verifies GNOT and wrapped GNOT from the start.
- OID
- 0ddf2e…ee8b:108
seedVerified details
Verify
func(kind string, key string, reason string)Verify makes a coin denom, a registered GRC20 token or a registered NFT collection acceptable in ordinary rooms from VerifyDelay from now. kind is coin, token or nft; key is the denom, the registry key or the collection key. reason is public: say why this asset is safe to trade.
- OID
- 0ddf2e…ee8b:110
Verify details
Unverify
func(kind string, key string, reason string)Unverify removes a verification at once. Ordinary rooms stop accepting the asset, and those that hold it can no longer settle; deposits stay withdrawable. reason is public.
- OID
- 0ddf2e…ee8b:111
Unverify details
IsVerified
func(kind string, denom string) boolIsVerified reports whether an asset counts as verified now. denom is a coin denom, a registry key, or a collection key (with or without "#token id").
- OID
- 0ddf2e…ee8b:112
IsVerified details
classOf
func(kind string, denom string) string- OID
- 0ddf2e…ee8b:113
classOf details
isVerified
func(kind string, denom string, now int64) bool- OID
- 0ddf2e…ee8b:114
isVerified details
VerifiedJSON
func(offset int, limit int) stringVerifiedJSON lists verifications, counted or still waiting, with their public reasons.
- OID
- 0ddf2e…ee8b:115