order
typeValue
game31.order
padU
func(n uint64, w int) string- OID
- 0a9dd2…b5d8:3
padU details
hexDigits
untyped stringValue
"0123456789abcdef"
priceKey
func(wantAmt uint64, giveAmt uint64) stringpriceKey = want-per-give × 1e12 as a fixed-width 24-hex-digit number (96 bits; amounts ≤ 1e15 keep it \< 2^90). Lexicographic = numeric order, so ascending book keys are the cheapest asks first for takers.
- OID
- 0a9dd2…b5d8:5
priceKey details
sideEntryLen
untyped bigint// priceKey(24) + id(12) + maker address(40)
Value
(76 <untyped> bigint)
sideSortLen
untyped bigint// entries sort by priceKey then id (FIFO within a price)
Value
(36 <untyped> bigint)
maxSideOrders
untyped bigint// open orders per book side; bounds every string we rewrite
Value
(256 <untyped> bigint)
encodeOrder
func(o *game31.order) stringmaker record: id12|give|want|remGive|remWant|expiry|pk
- OID
- 0a9dd2…b5d8:6
encodeOrder details
decodeOrder
func(maker string, rec string) *game31.order- OID
- 0a9dd2…b5d8:7
decodeOrder details
makerRecs
func(maker string) []string- OID
- 0a9dd2…b5d8:8
makerRecs details
setMakerRecs
func(maker string, recs []string)- OID
- 0a9dd2…b5d8:9
setMakerRecs details
loadOrderOf
func(maker string, id uint64) *game31.orderloadOrderOf finds one of maker's open orders (≤ 20 records scanned).
- OID
- 0a9dd2…b5d8:10
loadOrderOf details
saveOrder
func(o *game31.order)- OID
- 0a9dd2…b5d8:11
saveOrder details
sideKey
func(want string, give string) string- OID
- 0a9dd2…b5d8:12
sideKey details
sideEntry
func(o *game31.order) string- OID
- 0a9dd2…b5d8:13
sideEntry details
sideStr
func(k string) string- OID
- 0a9dd2…b5d8:14
sideStr details
sideSearch
func(s string, key string) intsideSearch returns the index of the first entry whose sort key is ≥ key.
- OID
- 0a9dd2…b5d8:15
sideSearch details
sideInsert
func(o *game31.order)- OID
- 0a9dd2…b5d8:16
sideInsert details
sideRemove
func(o *game31.order)- OID
- 0a9dd2…b5d8:17
sideRemove details
iterSide
func(pay string, get string, fn func(...))iterSide walks a taker's side (pays \`pay\`, gets \`get\`) best price first.
- OID
- 0a9dd2…b5d8:18
iterSide details
sideCount
func(pay string, get string) int- OID
- 0a9dd2…b5d8:19
sideCount details
grinValueMilli
func(coin string, amt uint64) uint64grinValueMilli = amt × reference value (milli-grin), saturating at 2^64-1.
- OID
- 0a9dd2…b5d8:20
grinValueMilli details
openOrderCount
func(maker string) uint64- OID
- 0a9dd2…b5d8:21
openOrderCount details
PlaceOrder
func(give string, giveAmt uint64, want string, wantAmt uint64, expirySecs int64) uint64PlaceOrder escrows giveAmt of \`give\` and lists it for wantAmt of \`want\` (any pair). No upfront posting fee — the 0.90% maker fee is deducted from the maker's proceeds at fill time. Returns the order id. expirySecs 0 = 72 h; max 7 days.
- OID
- 0a9dd2…b5d8:22
PlaceOrder details
closeOrder
func(o *game31.order, reason string)closeOrder refunds the remaining escrow to the MAKER (never anyone else) and deletes the order. Every close path goes through here.
- OID
- 0a9dd2…b5d8:23
closeOrder details
CancelOrder
func(id uint64)CancelOrder: the maker gets the remaining escrow back. Works while paused and for banned makers; only the maker can cancel.
- OID
- 0a9dd2…b5d8:24
CancelOrder details
SweepExpiredOrders
func(pay string, get string) intSweepExpiredOrders closes up to maxScanPerTx expired orders of one book side, refunding each maker. Anyone may call it (also while paused).
- OID
- 0a9dd2…b5d8:25
SweepExpiredOrders details
fillStep
typeValue
game31.fillStep
planFills
func(caller string, pay string, get string, budget uint64, maxFills int, now int64) ([]game31.fillStep, []*game31.order, uint64, uint64)planFills walks the book for a taker (read-only). budget is the most the taker will spend INCLUDING the taker fee. Own orders are skipped (no self-match); expired orders are returned for closing.
- OID
- 0a9dd2…b5d8:26
planFills details
executeFills
func(caller string, pay string, steps []game31.fillStep) uint64executeFills applies a plan: the taker pays each maker x (plus taker fee), receives g from escrow. The maker receives x minus the 0.90% maker fee (deducted from proceeds, not from escrow). Returns total received by taker.
- OID
- 0a9dd2…b5d8:27
executeFills details
FillOrders
func(pay string, get string, payAmt uint64, minGet uint64, maxFills int, deadline int64) uint64FillOrders: spend at most payAmt of \`pay\` (taker fee included) on the best-priced orders that give \`get\`; receive at least minGet or revert. ≤ 10 fills and ≤ 20 scanned entries per call.
- OID
- 0a9dd2…b5d8:28
FillOrders details
orderJSON
func(o *game31.order) string- OID
- 0a9dd2…b5d8:29
orderJSON details
Order
func(maker string, id uint64) stringOrder shows one open order of \`maker\` (lookups are per maker by design).
- OID
- 0a9dd2…b5d8:30
Order details
OrdersOf
func(addr string) stringOrdersOf lists an address's open orders (≤ 20 by construction).
- OID
- 0a9dd2…b5d8:31
OrdersOf details
BookDepth
func(pay string, get string, limit int, offset int) stringBookDepth lists asks for a taker who pays \`pay\` and gets \`get\`, best price first (≤ 50 rows; offset \< maxSideOrders).
- OID
- 0a9dd2…b5d8:32
BookDepth details
QuoteFill
func(caller string, pay string, get string, payAmt uint64, maxFills int) stringQuoteFill previews FillOrders for a budget (fee included): {"spent","got"}.
- OID
- 0a9dd2…b5d8:33
QuoteFill details
hubCoin
untyped stringValue
"grin"
poolFeeBps
uint64Value
50
protoFeeBps
uint64Value
15
minLiquidity
uint64// first-deposit shares burned forever
Value
1000
minOpenDepthGrin
uint64// a pool takes swaps only once rGrin ≥ this
Value
2000
warmupSecs
int64// LP fee warm-up (principal always instant)
Value
600
rootKScale
uint64Value
1000000000
takerFeeBps
uint64Value
50
makerFeeBps
uint64Value
90
minOrderGrinX1k
uint64// 50 grin of value (reference table) — size floor only
Value
50000
maxOpenOrders
uint64Value
20
defaultExpiry
int64Value
259200
maxExpiry
int64Value
604800
maxFillsPerTx
untyped bigintValue
(10 <untyped> bigint)
maxScanPerTx
untyped bigintValue
(20 <untyped> bigint)
maxViewLimit
untyped bigintValue
(50 <untyped> bigint)
maxAmount
uint64// 1e15
Value
1000000000000000
prefMilli
[7]uint64Reference value per rarity in milli-grin (RARITY\_VALUE ×1000). Used ONLY for the 50-grin minimum order size — never for prices.
- OID
- 0a9dd2…b5d8:35
prefMilli details
pools
v0.Tree// coin → \*pool
- OID
- 0a9dd2…b5d8:37
pools details
lpPositions
v0.Tree// coin+":"+addr → \*lpPos
- OID
- 0a9dd2…b5d8:39
lpPositions details
adminFees
v0.Tree// coin → admin's accrued protocol fees (pull)
- OID
- 0a9dd2…b5d8:41
adminFees details
casinoPool
v0.Tree// coin → casino pool balance (fees in, capped jackpots out)
- OID
- 0a9dd2…b5d8:43
casinoPool details
makerBooks
v0.Tree// maker → ";"-joined compact order records (≤ maxOpenOrders)
- OID
- 0a9dd2…b5d8:45
makerBooks details
sides
v0.Tree// want+">"+give → sorted fixed-width entries (≤ maxSideOrders)
- OID
- 0a9dd2…b5d8:47
sides details
openOrderTotal
uint64Value
0
nextOrderId
uint64Value
0
exPaused
boolValue
false
adminFeesWithdrawn
v0.Tree// coin → lifetime withdrawn by the admin
- OID
- 0a9dd2…b5d8:52
adminFeesWithdrawn details
adminGnotWithdrawn
int64// ugnot withdrawn by WithdrawFunds (≤ passRevenueUgnot)
Value
0
addChk
func(a uint64, b uint64) uint64- OID
- 0a9dd2…b5d8:54
addChk details
subChk
func(a uint64, b uint64) uint64- OID
- 0a9dd2…b5d8:56
subChk details
mulDiv
func(a uint64, b uint64, c uint64) uint64mulDiv = floor(a\*b/c) with a 128-bit product; panics if c == 0 or the quotient does not fit in 64 bits.
- OID
- 0a9dd2…b5d8:57
mulDiv details
mulDivUp
func(a uint64, b uint64, c uint64) uint64mulDivUp = ceil(a\*b/c).
- OID
- 0a9dd2…b5d8:58
mulDivUp details
isqrt128
func(a uint64, b uint64) uint64isqrt128 = floor(sqrt(a\*b)) for the 128-bit product (Newton, bounded).
- OID
- 0a9dd2…b5d8:59
isqrt128 details
isqrt
func(n uint64) uint64- OID
- 0a9dd2…b5d8:60
isqrt details
mulLess
func(a uint64, b uint64, c uint64, d uint64) boolmulLess reports a\*b \< c\*d using 128-bit products.
- OID
- 0a9dd2…b5d8:61
mulLess details
requireBalance
func(addr string, coin string, amt uint64)requireBalance checks a balance before any write, so a failing call changes nothing (validate-then-write).
- OID
- 0a9dd2…b5d8:62
requireBalance details
requireAmount
func(name string, v uint64)- OID
- 0a9dd2…b5d8:63
requireAmount details
u
func(n uint64) string- OID
- 0a9dd2…b5d8:64
u details
exchangeCaller
func() stringexchangeCaller returns the caller for exchange writes. Only end users (an EOA MsgCall or the user's own MsgRun) may trade: other realms can't act through the exchange, so there is no cross-realm call surface at all.
- OID
- 0a9dd2…b5d8:65
exchangeCaller details
requireMarketOpen
func(caller string)requireMarketOpen gates NEW activity (swaps, deposits, orders, fills). Trading opens only after FinalizeMigration: MigrateBatch SETs balances, so trading before that could duplicate or lose escrowed coins.
- OID
- 0a9dd2…b5d8:66
requireMarketOpen details
requireDeadline
func(deadline int64)- OID
- 0a9dd2…b5d8:67
requireDeadline details
requireCoin
func(coin string) int- OID
- 0a9dd2…b5d8:68
requireCoin details
accrueProtocolFee
func(coin string, amt uint64)accrueProtocolFee splits amt of coin 50/50: the floor half to the admin's fee ledger, the rest to the casino pool. Both stay inside the realm.
- OID
- 0a9dd2…b5d8:69
accrueProtocolFee details
WithdrawProtocolFees
func(coin string) uint64WithdrawProtocolFees moves the admin's OWN accrued fees for \`coin\` into the admin's balance. It reads only adminFees (never reserves, escrow, the casino pool or anyone's balance) and works while paused.
- OID
- 0a9dd2…b5d8:70
WithdrawProtocolFees details
SetExchangePaused
func(p bool)SetExchangePaused stops NEW swaps, deposits, orders and fills. It can't stop RemoveLiquidity, CancelOrder, SweepExpiredOrders or fee withdrawals.
- OID
- 0a9dd2…b5d8:71
SetExchangePaused details
ExchangeStatus
func() string- OID
- 0a9dd2…b5d8:72
ExchangeStatus details
ProtocolFees
func(coin string) string- OID
- 0a9dd2…b5d8:73
ProtocolFees details
pool
typeValue
game31.pool
lpPos
typeValue
game31.lpPos
getPool
func(coin string) *game31.pool- OID
- 0a9dd2…b5d8:74
getPool details
rootKPerShare
func(p *game31.pool) uint64- OID
- 0a9dd2…b5d8:76
rootKPerShare details
CreatePool
func(coin string)CreatePool opens an empty COIN/GRIN pool (admin, per the launch schedule). It holds nothing until players deposit; the admin can't deposit for anyone, withdraw from it or close it.
- OID
- 0a9dd2…b5d8:77
CreatePool details
OpenPool
func(coin string, coinAmt uint64, grinAmt uint64, minShares uint64, deadline int64) uint64OpenPool creates a new COIN/GRIN pool and immediately deposits the first liquidity, atomically setting the opening price. Any player who holds the coin and enough Grin can call this — no admin required. coinAmt and grinAmt set the price ratio; whoever calls this first for a coin controls the opening price, so choose amounts that reflect the coin's real value. 1,000 shares are permanently burned as a sandwich-resistance seed. Returns the number of LP shares minted for the caller.
- OID
- 0a9dd2…b5d8:78
OpenPool details
SetPoolPaused
func(coin string, p bool)SetPoolPaused stops new swaps and deposits on one pool. Withdrawals stay open.
- OID
- 0a9dd2…b5d8:79
SetPoolPaused details
AddLiquidity
func(coin string, coinMax uint64, grinMax uint64, minShares uint64, deadline int64) uint64AddLiquidity deposits up to coinMax of \`coin\` and grinMax grin. The first deposit sets the price (open economy: any ratio) and burns minLiquidity shares; later deposits take the current ratio (never more than either cap). Reverts unless at least minShares are minted.
- OID
- 0a9dd2…b5d8:80
AddLiquidity details
lpPayout
func(p *game31.pool, pos *game31.lpPos, shares uint64, now int64) (uint64, uint64)lpPayout computes what \`shares\` of a position withdraw right now: pro-rata of CURRENT reserves (floor). Within the warm-up the fee growth since entry (√k/share above entry) stays in the pool for the other LPs; principal is never cut below its entry-value share.
- OID
- 0a9dd2…b5d8:81
lpPayout details
RemoveLiquidity
func(coin string, shares uint64, minCoin uint64, minGrin uint64, deadline int64) (uint64, uint64)RemoveLiquidity is instant and ALWAYS available: it works while the exchange or the pool is paused, before or after a ban, and needs no tool. Nobody but the position owner can call it for that position.
- OID
- 0a9dd2…b5d8:82
RemoveLiquidity details
poolQuote
func(p *game31.pool, inIsHub bool, amountIn uint64) (uint64, uint64)poolQuote returns (out, protoFee) for amountIn of the input side; no writes.
- OID
- 0a9dd2…b5d8:83
poolQuote details
poolOpenForSwaps
func(p *game31.pool) bool- OID
- 0a9dd2…b5d8:84
poolOpenForSwaps details
poolSwap
func(p *game31.pool, inIsHub bool, amountIn uint64) uint64poolSwap executes one hop (coin↔grin) for \`caller\`, crediting nothing to the caller: it returns the output so routes can chain hops. The caller's input must already have been debited.
- OID
- 0a9dd2…b5d8:85
poolSwap details
SwapExactIn
func(coinIn string, coinOut string, amountIn uint64, minOut uint64, deadline int64) uint64SwapExactIn swaps amountIn of coinIn for at least minOut of coinOut through one pool (one side must be grin). For X→Y via grin use SwapRoute.
- OID
- 0a9dd2…b5d8:86
SwapExactIn details
poolJSON
func(p *game31.pool) string- OID
- 0a9dd2…b5d8:87
poolJSON details
PoolInfo
func(coin string) string- OID
- 0a9dd2…b5d8:88
PoolInfo details
Pools
func(limit int, offset int) stringPools lists pools in coin order (paginated, ≤ 50 per call).
- OID
- 0a9dd2…b5d8:89
Pools details
QuoteSwap
func(coinIn string, coinOut string, amountIn uint64) stringQuoteSwap quotes a single-pool swap; "0" if the pool can't take it.
- OID
- 0a9dd2…b5d8:90
QuoteSwap details
LpPosition
func(coin string, addr string) stringLpPosition shows one position and what it would withdraw right now.
- OID
- 0a9dd2…b5d8:91
LpPosition details
LpPositions
func(addr string, limit int, offset int) stringLpPositions lists an address's positions (bounded: at most one per pool, paginated by pool order, ≤ 50 pools scanned per call).
- OID
- 0a9dd2…b5d8:92
LpPositions details
poolPathOut
func(coinIn string, coinOut string, amountIn uint64) (uint64, bool)poolPathOut quotes amountIn of coinIn → coinOut through the grin pools (one hop if either side is grin, else coinIn→grin→coinOut). ok=false if a needed pool is missing or not open. Read-only.
- OID
- 0a9dd2…b5d8:93
poolPathOut details
routePlan
func(caller string, coinIn string, coinOut string, amountIn uint64, maxFills int, now int64) ([]game31.fillStep, []*game31.order, uint64, uint64, uint64)routePlan splits amountIn between book fills (direct pair) and the pool path. A book fill is taken while its rate is at least the pool path's average rate for the whole remainder; everything else goes to the pools.
- OID
- 0a9dd2…b5d8:95
routePlan details
SwapRoute
func(coinIn string, coinOut string, amountIn uint64, minOut uint64, maxFills int, deadline int64) uint64SwapRoute swaps up to amountIn of coinIn for at least minOut of coinOut, using the order book (direct pair) while it beats the pools and the grin pools for the rest. Coins not needed are never debited.
- OID
- 0a9dd2…b5d8:96
SwapRoute details
QuoteRoute
func(caller string, coinIn string, coinOut string, amountIn uint64, maxFills int) stringQuoteRoute previews SwapRoute: how much goes to the book vs the pools and the expected output (fees included).
- OID
- 0a9dd2…b5d8:97
QuoteRoute details
init.108
func()- OID
- 0a9dd2…b5d8:98
init.108 details
isAdmin
func() bool- OID
- 0a9dd2…b5d8:100
isAdmin details
requireAdmin
func()- OID
- 0a9dd2…b5d8:101
requireAdmin details
TransferAdmin
func(newAdmin string)TransferAdmin hands the admin role to another address.
- OID
- 0a9dd2…b5d8:102
TransferAdmin details
transferAdmin
func(newAdmin string)- OID
- 0a9dd2…b5d8:103
transferAdmin details
UpdateConfig
func(newAdmin string)UpdateConfig is kept for game27/28 API compatibility (= TransferAdmin).
- OID
- 0a9dd2…b5d8:104
UpdateConfig details
SetClaimSigner
func(pubKeyHex string)SetClaimSigner registers the ed25519 public key (64 hex chars) of the server's claim signer. Pass "" to disable all vouchered calls (kill switch).
- OID
- 0a9dd2…b5d8:105
SetClaimSigner details
ClaimSigner
func() string- OID
- 0a9dd2…b5d8:106
ClaimSigner details
Admin
func() string- OID
- 0a9dd2…b5d8:107
Admin details
SetPaused
func(p bool)- OID
- 0a9dd2…b5d8:108
SetPaused details
IsPaused
func() bool- OID
- 0a9dd2…b5d8:109
IsPaused details
requireNotPaused
func()- OID
- 0a9dd2…b5d8:110
requireNotPaused details
BanAddress
func(targetAddr string, reason string, durationSecs int64)BanAddress bans a player address. durationSecs=0 means permanent.
- OID
- 0a9dd2…b5d8:111
BanAddress details
UnbanAddress
func(targetAddr string)- OID
- 0a9dd2…b5d8:112
UnbanAddress details
BlacklistStatus
func(addr string) string- OID
- 0a9dd2…b5d8:113
BlacklistStatus details
isBlacklisted
func(addr string) bool- OID
- 0a9dd2…b5d8:114
isBlacklisted details
requirePlayer
func() string- OID
- 0a9dd2…b5d8:115
requirePlayer details
veinMax
func(coinId string) uint64- OID
- 0a9dd2…b5d8:116
veinMax details
veinMintedOf
func(coinId string) uint64- OID
- 0a9dd2…b5d8:117
veinMintedOf details
takeFromVein
func(coinId string, amt uint64) uint64takeFromVein returns how much of amt can still be minted for coinId and records it as minted.
- OID
- 0a9dd2…b5d8:118
takeFromVein details
SetVeinMax
func(coinId string, maxSupply string)SetVeinMax overrides a coin's vein size. It can't go below what was minted.
- OID
- 0a9dd2…b5d8:119
SetVeinMax details
setVeinMax
func(coinId string, maxSupply string)- OID
- 0a9dd2…b5d8:120
setVeinMax details
RegisterVein
func(coinId string, maxSupply string)RegisterVein is the game28 name for SetVeinMax.
- OID
- 0a9dd2…b5d8:121
RegisterVein details
VeinSupply
func(coinId string) string- OID
- 0a9dd2…b5d8:122
VeinSupply details
SetPassPrice
func(ugnotPer30Days int64)SetPassPrice sets the ugnot price per 30-day period.
- OID
- 0a9dd2…b5d8:123
SetPassPrice details
PassPrice
func() int64- OID
- 0a9dd2…b5d8:124
PassPrice details
ActivateGnomePass
func(durationDays int64)ActivateGnomePass buys durationDays (30..360, multiple of 30) of Gnome Pass. The tx must attach exactly passPrice × durationDays/30 ugnot (MsgCall send).
- OID
- 0a9dd2…b5d8:125
ActivateGnomePass details
GnomePassExpiry
func(addr string) int64- OID
- 0a9dd2…b5d8:126
GnomePassExpiry details
HasActivePass
func(addr string) bool- OID
- 0a9dd2…b5d8:127
HasActivePass details
GnomePassCount
func() int- OID
- 0a9dd2…b5d8:128
GnomePassCount details
PassRevenue
func() int64- OID
- 0a9dd2…b5d8:129
PassRevenue details
TreasuryBalance
func() int64TreasuryBalance returns the ugnot held by this realm (pass revenue not yet withdrawn).
- OID
- 0a9dd2…b5d8:130
TreasuryBalance details
WithdrawFunds
func(to string, amountUgnot int64)WithdrawFunds sends GNOT the admin is OWED — Gnome Pass revenue not yet withdrawn — to \`to\`. It can never touch other ugnot the realm holds (donations, anything a future feature would hold for players).
- OID
- 0a9dd2…b5d8:131
WithdrawFunds details
WithdrawableFunds
func() int64WithdrawableFunds = pass revenue the admin may still withdraw (ugnot).
- OID
- 0a9dd2…b5d8:132
WithdrawableFunds details
MigrateBatch
func(batchId string, kind string, rowsJson string) int── Migration (game27 / game28 → game29) ──────────────────────────────────── MigrateBatch(batchId, kind, rowsJson) imports one batch. rowsJson is a JSON array of string arrays. Kinds and row shapes: balance [addr, coinId, amount] → balances (SET, not add) lifetime [addr, coinId, amount] → lifetimeMined (SET) + miners total tools [addr, "t1,t2,..."] → ownedTools (SET, unknown ids dropped) toollife [addr, toolId, life] → toolLife (SET, clamped to max) skill [addr, skillId, rank] → skillRanks (SET, clamped to max) medal [addr, achievementId] → achievements (allowlisted ids only) pass [addr, expiryUnix] → gnomePasses (SET) guild [guildId, name, leader, "m1,m2,..."] → guilds + members ban [addr, reason, expiryUnix] → blacklist (expiry 0 = permanent) A batchId that was already applied is skipped, and every write is a SET, so re-running a whole migration is a no-op. FinalizeMigration locks it forever.
- OID
- 0a9dd2…b5d8:133
MigrateBatch details
FinalizeMigration
func()- OID
- 0a9dd2…b5d8:134
FinalizeMigration details
MigrationStatus
func() string- OID
- 0a9dd2…b5d8:135
MigrationStatus details
MigrationBatch
func(batchId string) string- OID
- 0a9dd2…b5d8:136
MigrationBatch details
validAddr
func(s string) bool- OID
- 0a9dd2…b5d8:137
validAddr details
migrateRow
func(kind string, r []string) bool- OID
- 0a9dd2…b5d8:138
migrateRow details
casinoBets
v0.Tree// roundId+":"+addr → \*casinoBet
- OID
- 0a9dd2…b5d8:140
casinoBets details
casinoReserved
v0.Tree// coin → largest net payouts of unsettled bets (string)
- OID
- 0a9dd2…b5d8:142
casinoReserved details
casinoDay
v0.Tree// coin → "day:snapshot:paid:received" (UTC day)
- OID
- 0a9dd2…b5d8:144
casinoDay details
casinoWinRange
uint64// winning rolls per pick (of 100) for flip/wheel
Value
49
rpsWinBelow
uint64// rps: roll \< 33 player wins
Value
33
rpsPushBelow
uint64// rps: 33..64 push
Value
65
casinoBetWindowSec
int64// a committed round takes its bet within 1 h
Value
3600
casinoSeedTimeoutSec
int64// refunds open 30 min after the bet if s is never revealed
Value
1800
casinoSecretTimeoutSec
int64// the bet forfeits 24 h after s if c is never revealed
Value
86400
casinoMaxBetBps
uint64// flip / wheel / rps bet ≤ 0.5% of the free pool
Value
50
slotsMaxBetPPM
uint64// slots bet ≤ 0.004% of the free pool
Value
40
casinoOpenBps
uint64// open reservations on a coin ≤ 20% of the pool
Value
2000
casinoDayBps
uint64// daily net payout ≤ 10% of the day's snapshot
Value
1000
casinoMinPoolMilli
uint64// ≥ 20,000 grin-equivalent …
Value
20000000
casinoMinPoolUnits
uint64// … and ≥ 200 units of the coin
Value
200
casinoMaxAmount
uint64Value
1000000000
casinoRefMilli
[7]uint64Reference value per unit by rarity, in milli-grin (same table as the exchange plan): only used for the pool's opening threshold.
- OID
- 0a9dd2…b5d8:146
casinoRefMilli details
casinoRound
typeValue
game31.casinoRound
casinoBet
typeValue
game31.casinoBet
isOperator
func() boolisOperator: the casino operator key commits and reveals server seeds. Once an operator is set, only that key can; the admin (treasury) key only stands in while no operator has been named yet (bootstrap and tests).
- OID
- 0a9dd2…b5d8:147
isOperator details
SetOperator
func(addr string)SetOperator lets the admin name the server account that commits and reveals casino seeds. It must be its own key, never the admin/treasury key. The operator can't move anyone's coins.
- OID
- 0a9dd2…b5d8:149
SetOperator details
Operator
func() string- OID
- 0a9dd2…b5d8:150
Operator details
casinoStats
v0.Tree// coin:field or coin:game:field → uint (string)
- OID
- 0a9dd2…b5d8:152
casinoStats details
casStat
func(coin string, game string, field string, add uint64)- OID
- 0a9dd2…b5d8:153
casStat details
casRecord
func(coin string, game string, staked uint64, paid uint64)- OID
- 0a9dd2…b5d8:154
casRecord details
CasinoStats
func(coinId string) stringCasinoStats reports a coin's accounting: pool, reserved, jackpots, seeded, staked, paid, the conservation check and per-game rounds/staked/paid.
- OID
- 0a9dd2…b5d8:155
CasinoStats details
casGet
func(t *v0.Tree, key string) uint64- OID
- 0a9dd2…b5d8:156
casGet details
casSet
func(t *v0.Tree, key string, v uint64)- OID
- 0a9dd2…b5d8:157
casSet details
casAdd
func(a uint64, b uint64) uint64- OID
- 0a9dd2…b5d8:158
casAdd details
casSub
func(a uint64, b uint64) uint64- OID
- 0a9dd2…b5d8:159
casSub details
casMulDiv
func(a uint64, b uint64, c uint64) uint64casMulDiv = floor(a\*b/c) with a 128-bit product.
- OID
- 0a9dd2…b5d8:160
casMulDiv details
casMul
func(a uint64, b uint64) uint64- OID
- 0a9dd2…b5d8:161
casMul details
casU
func(n uint64) string- OID
- 0a9dd2…b5d8:162
casU details
casBalOf
func(addr string, coin string) uint64- OID
- 0a9dd2…b5d8:163
casBalOf details
casCredit
func(addr string, coin string, amt uint64)- OID
- 0a9dd2…b5d8:164
casCredit details
casDebit
func(addr string, coin string, amt uint64)- OID
- 0a9dd2…b5d8:165
casDebit details
casGrinValueMilli
func(coin string, amt uint64) uint64- OID
- 0a9dd2…b5d8:166
casGrinValueMilli details
casIsHex64
func(s string) bool- OID
- 0a9dd2…b5d8:167
casIsHex64 details
casSafe
func(s string, maxLen int) boolcasSafe: a short \[A-Za-z0-9\_.-] token (no quotes, so it is JSON-safe).
- OID
- 0a9dd2…b5d8:168
casSafe details
sha256Hex
func(s string) string- OID
- 0a9dd2…b5d8:169
sha256Hex details
CasinoRoll
func(serverSeed string, clientSecret string, roundId string, game string) uint64CasinoRoll is the on-chain roll: uint32(sha256(s:c:roundId:game)\[0:4]) % 100.
- OID
- 0a9dd2…b5d8:170
CasinoRoll details
CasinoOutcome
func(game string, roll uint64) stringCasinoOutcome maps a roll to what landed. For rps the outcome is "win" | "push" | "lose" (see rpsHouseMove for the move shown).
- OID
- 0a9dd2…b5d8:171
CasinoOutcome details
rpsHouseMove
func(choice string, outcome string) stringrpsHouseMove: the house move that produces the outcome against the player's move.
- OID
- 0a9dd2…b5d8:172
rpsHouseMove details
validCasinoChoice
func(game string, choice string) bool- OID
- 0a9dd2…b5d8:173
validCasinoChoice details
casinoExposure
func(game string, amt uint64) uint64casinoExposure: the largest net amount a bet can take from the pool.
- OID
- 0a9dd2…b5d8:174
casinoExposure details
casDayNow
func() int64- OID
- 0a9dd2…b5d8:175
casDayNow details
casinoDayState
func(coin string) (int64, uint64, uint64, uint64)- OID
- 0a9dd2…b5d8:176
casinoDayState details
setCasinoDay
func(coin string, day int64, snap uint64, paid uint64, recv uint64)- OID
- 0a9dd2…b5d8:177
setCasinoDay details
casinoIsOpen
func(coin string, pool uint64) bool- OID
- 0a9dd2…b5d8:178
casinoIsOpen details
casinoMaxBet
func(game string, free uint64) uint64- OID
- 0a9dd2…b5d8:179
casinoMaxBet details
casinoCheckBet
func(coin string, game string, amt uint64)casinoCheckBet panics unless the pool can pay the bet's largest win in full (read-only).
- OID
- 0a9dd2…b5d8:180
casinoCheckBet details
casinoReserve
func(coin string, exp uint64)- OID
- 0a9dd2…b5d8:181
casinoReserve details
casinoSettle
func(addr string, coin string, amt uint64, exposure uint64, payout uint64) uint64casinoSettle releases the reservation and moves coins: the player receives \`payout\` (0 ≤ payout ≤ stake + exposure) and the pool keeps the rest of the stake or pays the difference. Returns payout.
- OID
- 0a9dd2…b5d8:182
casinoSettle details
SeedCasinoPool
func(coinId string, amount string)SeedCasinoPool moves the ADMIN'S OWN on-chain coins into a casino pool. Only ever the admin's own balance; nobody can withdraw a pool back.
- OID
- 0a9dd2…b5d8:183
SeedCasinoPool details
CasinoPool
func(coinId string) stringCasinoPool reports a coin's pool, reservation, max bets and daily counters.
- OID
- 0a9dd2…b5d8:184
CasinoPool details
casinoGrants
v0.Tree// addr → \*freeSpinGrant
- OID
- 0a9dd2…b5d8:186
casinoGrants details
casinoJackpot
v0.Tree// coin:tier → pool (string)
- OID
- 0a9dd2…b5d8:188
casinoJackpot details
casinoJpDust
v0.Tree// coin:tier → contribution remainder in bet×bps units (string)
- OID
- 0a9dd2…b5d8:190
casinoJpDust details
casinoJpSeed
v0.Tree// coin:tier → reset seed (string)
- OID
- 0a9dd2…b5d8:192
casinoJpSeed details
casinoJpRef
v0.Tree// coin → reference bet (string)
- OID
- 0a9dd2…b5d8:194
casinoJpRef details
freeSpinMult
uint64Value
2
jpMajorBps
uint64// 1.0% of each paid slots stake
Value
100
jpGrandBps
uint64// 0.5%
Value
50
jpDefaultRefBet
uint64Value
100
jpResetFreeMultiple
uint64Value
20
hsMiniMult
uint64Value
20
hsMinorMult
uint64Value
75
freeSpinGrant
typeValue
game31.freeSpinGrant
getGrant
func(addr string) *game31.freeSpinGrant- OID
- 0a9dd2…b5d8:195
getGrant details
jpKey
func(coin string, tier string) string- OID
- 0a9dd2…b5d8:197
jpKey details
jpRefBet
func(coin string) uint64- OID
- 0a9dd2…b5d8:198
jpRefBet details
casinoJackpotContribute
func(coin string, amt uint64)casinoJackpotContribute moves 1.0% / 0.5% of a paid slots stake from the house pool into the MAJOR / GRAND pools (remainders carried, nothing rounded away).
- OID
- 0a9dd2…b5d8:199
casinoJackpotContribute details
casinoJackpotPay
func(addr string, coin string, tier string, bet uint64) uint64casinoJackpotPay pays a jackpot tier to addr: pool × min(1, bet/refBet).
- OID
- 0a9dd2…b5d8:200
casinoJackpotPay details
slotsHSPayout
func(tiles *[20]uint16, full bool) (uint64, bool, bool)slotsHSPayout turns Hold & Spin tiles into bet multiples (under the cap) and the jackpot tiers won (paid from their pools).
- OID
- 0a9dd2…b5d8:201
slotsHSPayout details
PlaceCasinoFreeSpin
func(roundId string, clientHash string)PlaceCasinoFreeSpin uses one free spin of the caller's grant in a committed round (no stake). One free spin in flight at a time.
- OID
- 0a9dd2…b5d8:202
PlaceCasinoFreeSpin details
settleFreeSpin
func(b *game31.casinoBet, win uint64) uint64settleFreeSpin pays a free spin's win out of its grant's reservation.
- OID
- 0a9dd2…b5d8:203
settleFreeSpin details
FreeSpinGrant
func(addr string) stringFreeSpinGrant reports a player's open free spins (null when none).
- OID
- 0a9dd2…b5d8:204
FreeSpinGrant details
CasinoJackpots
func(coinId string) stringCasinoJackpots reports the real MAJOR / GRAND pools and how they pay.
- OID
- 0a9dd2…b5d8:205
CasinoJackpots details
validJpTier
func(tier string) bool- OID
- 0a9dd2…b5d8:206
validJpTier details
SeedCasinoJackpot
func(coinId string, tier string, amount string)SeedCasinoJackpot adds the ADMIN'S OWN coins to a jackpot pool (never withdrawable).
- OID
- 0a9dd2…b5d8:207
SeedCasinoJackpot details
SetCasinoJackpotSeed
func(coinId string, tier string, amount string)SetCasinoJackpotSeed sets the level a jackpot is topped back up to after a hit.
- OID
- 0a9dd2…b5d8:208
SetCasinoJackpotSeed details
SetCasinoJackpotRefBet
func(coinId string, amount string)SetCasinoJackpotRefBet sets the bet that wins a full jackpot (smaller bets win the same share of the pool as their share of this bet).
- OID
- 0a9dd2…b5d8:209
SetCasinoJackpotRefBet details
getCasinoRound
func(id string) *game31.casinoRound- OID
- 0a9dd2…b5d8:210
getCasinoRound details
mustCasinoRound
func(id string) *game31.casinoRound- OID
- 0a9dd2…b5d8:212
mustCasinoRound details
casinoRoundBet
func(r *game31.casinoRound, roundId string) *game31.casinoBet- OID
- 0a9dd2…b5d8:213
casinoRoundBet details
CommitCasinoSeed
func(roundId string, player string, seedHash string)CommitCasinoSeed opens a round for one player with sha256(s). Operator only; a round id can be used once.
- OID
- 0a9dd2…b5d8:214
CommitCasinoSeed details
PlaceCasinoBet
func(roundId string, game string, coinId string, betAmount string, choice string, clientHash string)PlaceCasinoBet escrows the player's bet with sha256(c): only the round's player, only before s is revealed, and only if the pool can pay its largest win.
- OID
- 0a9dd2…b5d8:215
PlaceCasinoBet details
RevealCasinoSeed
func(roundId string, serverSeed string)RevealCasinoSeed publishes s (it must hash to the commit). It settles nothing: the bet settles when the player's secret is revealed.
- OID
- 0a9dd2…b5d8:216
RevealCasinoSeed details
RevealCasinoSecret
func(roundId string, clientSecret string)RevealCasinoSecret publishes the player's secret c (anyone may relay it: it must hash to the bet's hash) and settles the bet on chain. Works while paused.
- OID
- 0a9dd2…b5d8:217
RevealCasinoSecret details
casinoResolve
func(roundId string, r *game31.casinoRound, b *game31.casinoBet)casinoResolve rolls the bet from s and c, pays it, and records the result.
- OID
- 0a9dd2…b5d8:218
casinoResolve details
RefundCasinoBet
func(roundId string)RefundCasinoBet returns the stake only if s was never revealed and 30 minutes have passed since the bet. Never after s is revealed. Works while paused.
- OID
- 0a9dd2…b5d8:219
RefundCasinoBet details
ForfeitCasinoBet
func(roundId string)ForfeitCasinoBet settles a bet as a loss when s was revealed but the player's secret was not within 24 h (only the player could know the result). Anyone.
- OID
- 0a9dd2…b5d8:220
ForfeitCasinoBet details
CasinoRound
func(roundId string) string- OID
- 0a9dd2…b5d8:221
CasinoRound details
CasinoBet
func(roundId string, addr string) stringCasinoBet returns one player's bet and its on-chain result.
- OID
- 0a9dd2…b5d8:222
CasinoBet details
JackpotPool
func(coinId string) stringJackpotPool reports the GRAND jackpot pool (the casino bankroll is CasinoPool).
- OID
- 0a9dd2…b5d8:223
JackpotPool details
CasinoHistory
func(string) string- OID
- 0a9dd2…b5d8:224
CasinoHistory details
realmPkgPath
untyped stringValue
"gno.land/r/g138gdmwj6heduu3st796lw6qqdwylgaxf7ty5gz/game30"
admin
.uverse.address// deployer; can set roles, prices, veins, migrate, withdraw
Value
<gnolang.StringValue>
operator
.uverse.address// server hot account for casino seeds (defaults to admin)
Value
<gnolang.StringValue>
claimSignerPubKey
[]uint8- OID
- 0a9dd2…b5d8:1300
claimSignerPubKey details
claimNonces
v0.Tree// addr → last used voucher nonce (decimal string)
- OID
- 0a9dd2…b5d8:229
claimNonces details
balances
v0.Tree// addr+":"+coinId → amount string
- OID
- 0a9dd2…b5d8:231
balances details
claimBuckets
v0.Tree// addr → "m0:t0|m1:t1|m2:t2|m3:t3|m4:t4|m5:t5|m6:t6" (packed; lazy-migrated from old addr:r keys)
- OID
- 0a9dd2…b5d8:233
claimBuckets details
veinMinted
v0.Tree// coinId → total ever credited by claims/rewards/migration
- OID
- 0a9dd2…b5d8:235
veinMinted details
veinMaxOverride
v0.Tree// coinId → admin-set max (overrides the rarity default)
- OID
- 0a9dd2…b5d8:237
veinMaxOverride details
veinOverrideActive
bool// true once any SetVeinMax has been called; gates the veinMaxOverride AVL read
Value
false
casinoRounds
v0.Tree// roundId → \*casinoRound
- OID
- 0a9dd2…b5d8:240
casinoRounds details
pvpLobbies
v0.Tree// lobbyId and lobbyId+":field" → string (see game\_pvp.gno)
- OID
- 0a9dd2…b5d8:242
pvpLobbies details
pvpWagers
v0.Tree// lobbyId → "coinId:amount:creator:challenger"
- OID
- 0a9dd2…b5d8:244
pvpWagers details
ownedTools
v0.Tree// addr → comma-separated tool IDs
- OID
- 0a9dd2…b5d8:246
ownedTools details
toolLife
v0.Tree// addr+":"+toolId → remaining life string
- OID
- 0a9dd2…b5d8:248
toolLife details
lifetimeMined
v0.Tree// addr+":"+coinId → total mined string (real claims only)
- OID
- 0a9dd2…b5d8:250
lifetimeMined details
rewarded
v0.Tree// addr+":"+coinId → total credited by rewards (medals etc.)
- OID
- 0a9dd2…b5d8:252
rewarded details
achievements
v0.Tree// addr+":"+achId → "1"
- OID
- 0a9dd2…b5d8:254
achievements details
dailyCheckins
v0.Tree// addr → unix seconds string
- OID
- 0a9dd2…b5d8:256
dailyCheckins details
skillRanks
v0.Tree// addr+":"+skillId → rank string
- OID
- 0a9dd2…b5d8:258
skillRanks details
miners
v0.Tree// addr → total mined all-time string
- OID
- 0a9dd2…b5d8:260
miners details
playerXp
v0.Tree// addr → cumulative rarity-weighted XP (uint64 string)
- OID
- 0a9dd2…b5d8:262
playerXp details
lastClaim
v0.Tree// addr → unix timestamp of last ClaimAndMint
- OID
- 0a9dd2…b5d8:264
lastClaim details
blacklist
v0.Tree// addr → "reason:timestamp"
- OID
- 0a9dd2…b5d8:266
blacklist details
banExpiries
v0.Tree// addr → unix expiry (0 = permanent)
- OID
- 0a9dd2…b5d8:268
banExpiries details
guilds
v0.Tree// guildId → JSON{name, leader, memberCount, createdAt}
- OID
- 0a9dd2…b5d8:270
guilds details
guildMembers
v0.Tree// guildId+":"+addr → "1"
- OID
- 0a9dd2…b5d8:272
guildMembers details
playerGuild
v0.Tree// addr → guildId
- OID
- 0a9dd2…b5d8:274
playerGuild details
gnomePasses
v0.Tree// addr → unix expiry timestamp string
- OID
- 0a9dd2…b5d8:276
gnomePasses details
paused
boolValue
false
passPriceUgnot
int64Value
5000000
passRevenueUgnot
int64// lifetime ugnot received for passes (accounting only)
Value
0
pvpCounter
uint64// monotonically increasing lobby number
Value
0
guildCounter
uint64// monotonically increasing guild number
Value
0
migrationFinalized
boolValue
false
migrationBatches
v0.Tree// batchId → kind
- OID
- 0a9dd2…b5d8:284
migrationBatches details
toolOrder
[]stringtoolOrder is the canonical upgrade path from hands to omega.
- OID
- 0a9dd2…b5d8:286
toolOrder details
toolRequires
map[string]stringtoolRequires: BuyTool must panic unless the caller owns the prerequisite tool.
- OID
- 0a9dd2…b5d8:288
toolRequires details
toolMaxRarity
map[string]inttoolMaxRarity: highest coin rarity each tool can mine (used by the claim rate cap).
- OID
- 0a9dd2…b5d8:290
toolMaxRarity details
toolCosts
map[string][][2]stringtoolCosts maps toolId → slice of \[coinId, amount] pairs. Matches catalog.ts TOOLS array exactly. Amounts are for qty=1.
- OID
- 0a9dd2…b5d8:292
toolCosts details
skillBaseCosts
map[string][][2]stringskillBaseCosts maps skillId → base cost at rank 0. Actual cost at rank N = base × 2^N (doubles per rank).
- OID
- 0a9dd2…b5d8:500
skillBaseCosts details
skillMaxRanks
map[string]uint64skillMaxRanks maps skillId → maximum rank allowed. Most skills cap at 3 or 4 — see catalog.ts SKILLS\[\*].max.
- OID
- 0a9dd2…b5d8:981
skillMaxRanks details
toolMaxLife
map[string]uint64toolMaxLife maps toolId → maximum durability in blocks broken. 0 = indestructible (hands, starter-twig, twig). Matches catalog.ts tool.life.
- OID
- 0a9dd2…b5d8:983
toolMaxLife details
coinRarity
map[string]int- OID
- 0a9dd2…b5d8:1299
coinRarity details
skillDustHeadroom
uint64// ×175/100
Value
175
skillDmgHeadroom
uint64// ×200/100
Value
200
skillDropHeadroom
uint64// ×130/100
Value
130
toolLifeSkillIds
[]stringtoolLifeSkillIds lists the on-chain skills that grant toolLifeBonus. Covers the Things branch (level 50) and the Nature-branch skills that also affect tool wear. Must stay in sync with catalog.ts SKILLS\[\*].toolLifeBonus.
- OID
- 0a9dd2…b5d8:986
toolLifeSkillIds details
toolLifeSkillBonus
map[string]uint64toolLifeSkillBonus maps each skill to its per-rank life bonus fraction × 1000. e.g. "tempered\_grip" → 100 means +10.0% per rank (100/1000 = 0.10).
- OID
- 0a9dd2…b5d8:988
toolLifeSkillBonus details
claimBucketSecs
int64── Claim rate cap tables (REPORT.md §5) ───────────────────────────────────── claimBucketSecs: how many seconds of allowance the bucket can bank (1 hour).
Value
3600
claimRatePerMin
map[string][7]uint64claimRatePerMin\[toolId]\[rarity] = max coins/min of that rarity the caller may claim (before skill headroom). Indexed 0=dust..6=mythic.
- OID
- 0a9dd2…b5d8:990
claimRatePerMin details
veinDefaultMax
[7]uint64── Vein caps (game29) ─────────────────────────────────────────────────────── Every coin in coinRarity has a vein from deploy: its max is the default for its rarity unless the admin overrides it. No per-coin init writes needed. Defaults: ≈1 year of demand per core coin × 1.5 headroom (see REPORT §6).
- OID
- 0a9dd2…b5d8:1007
veinDefaultMax details
veinCoinDefault
map[string]uint64Per-coin default overrides (static: no deploy-time writes).
- OID
- 0a9dd2…b5d8:1009
veinCoinDefault details
coinAmt
type── Achievement allowlist (game29) ─────────────────────────────────────────── Static ids with FIXED rewards. Grind ids "g.\<coin>.\<need>" are valid for any allowlisted coin and need ∈ grindRungs. The client can never choose a reward.
Value
game31.coinAmt
achievementRewards
map[string][]game31.coinAmt- OID
- 0a9dd2…b5d8:1011
achievementRewards details
grindRungs
[]uint64- OID
- 0a9dd2…b5d8:1129
grindRungs details
grindPay
func(need uint64) uint64- OID
- 0a9dd2…b5d8:1130
grindPay details
pvpGames
map[string][]string── PvP / casino allowlists ──────────────────────────────────────────────────
- OID
- 0a9dd2…b5d8:1133
pvpGames details
pvpTimeoutSec
int64// AFK window before ClaimPvpTimeout
Value
600
pvpRakePct
uint64// to admin balance
Value
2
voucherMaxTTL
int64// vouchers must expire within 15 min
Value
900
claimCooldownSec
int64// min seconds between ClaimAndMint
Value
60
claimInitialGraceSec
int64// a new rarity bucket starts with 5 min of allowance
Value
300
init.307
func()- OID
- 0a9dd2…b5d8:1137
init.307 details
init.308
func()- OID
- 0a9dd2…b5d8:1139
init.308 details
init.309
func()- OID
- 0a9dd2…b5d8:1141
init.309 details
maxGuildMembers
untyped bigintValue
(10 <untyped> bigint)
maxGuildNameLen
untyped bigintValue
(24 <untyped> bigint)
guildJSON
func(guildId string, name string, leader string, members int, createdAt int64) string- OID
- 0a9dd2…b5d8:1143
guildJSON details
guildMemberCount
func(gid string) int- OID
- 0a9dd2…b5d8:1145
guildMemberCount details
guildMeta
typeValue
game31.guildMeta
guildMetas
map[string]game31.guildMetaguild meta is stored alongside the JSON so it can be re-rendered safely.
- OID
- 0a9dd2…b5d8:1147
guildMetas details
rewriteGuild
func(gid string)- OID
- 0a9dd2…b5d8:1148
rewriteGuild details
CreateGuild
func(name string) string- OID
- 0a9dd2…b5d8:1149
CreateGuild details
JoinGuild
func(guildId string)- OID
- 0a9dd2…b5d8:1150
JoinGuild details
LeaveGuild
func()- OID
- 0a9dd2…b5d8:1151
LeaveGuild details
PlayerGuild
func(addr string) string- OID
- 0a9dd2…b5d8:1152
PlayerGuild details
GuildInfo
func(guildId string) string- OID
- 0a9dd2…b5d8:1153
GuildInfo details
TopGuilds
func(limit int) string- OID
- 0a9dd2…b5d8:1154
TopGuilds details
kvJSON
func(prefixAddr string, t *v0.Tree) string- OID
- 0a9dd2…b5d8:1155
kvJSON details
AllBalances
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1156
AllBalances details
LifetimeMined
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1157
LifetimeMined details
PlayerXp
func(playerAddr string) stringPlayerXp returns the caller's cumulative rarity-weighted XP earned from ClaimAndMint calls as a plain decimal string (e.g. "12345"). Returns "0" for players who have not yet minted anything on this realm version.
- OID
- 0a9dd2…b5d8:1158
PlayerXp details
Rewarded
func(playerAddr string) stringRewarded returns what rewards (medals etc.) credited, per coin. Separate from LifetimeMined.
- OID
- 0a9dd2…b5d8:1159
Rewarded details
SkillRanks
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1160
SkillRanks details
ToolLife
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1161
ToolLife details
OwnedTools
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1162
OwnedTools details
PlayerProfile
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1163
PlayerProfile details
AllMiners
func(limit int, offset int) stringAllMiners returns the leaderboard sorted by total mined (desc), paginated. (game28 returned it in address order.)
- OID
- 0a9dd2…b5d8:1164
AllMiners details
GetMedals
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1165
GetMedals details
DailyCheckinStatus
func(playerAddr string) string- OID
- 0a9dd2…b5d8:1166
DailyCheckinStatus details
ListTasks
func(string) string- OID
- 0a9dd2…b5d8:1167
ListTasks details
Render
func(string) string- OID
- 0a9dd2…b5d8:1168
Render details
deductBalances
func(caller string, costs [][2]string)deductBalances checks all balances, then deducts (no partial deductions).
- OID
- 0a9dd2…b5d8:1169
deductBalances details
guildRow
typeValue
game31.guildRow
guildRows
typeValue
game31.guildRows
minerRow
typeValue
game31.minerRow
minerRows
typeValue
game31.minerRows
VoucherMessage
func(kind string, player string, nonce int64, expiry int64, payload string) stringVoucherMessage builds the canonical message that the server signs and the realm verifies. Format: gnomoji-voucher-v2|chainId|kind|player|nonce|expiry|compactPayload v2 changes from v1: realmPkgPath removed; payload is now compact (not raw JSON). For kind="claim": compactPayload = coinId:amount pairs sorted by coinId, comma-joined. e.g. [["grin","100"],["joy","50"]] → "grin:100,joy:50" For kind="ach": compactPayload = achievement IDs sorted, comma-joined. e.g. ["blocks_1","g.grin.10"] → "blocks_1,g.grin.10"
- OID
- 0a9dd2…b5d8:1170
VoucherMessage details
compactClaimPayload
func(coinsJson string) stringcompactClaimPayload builds the canonical compact payload for a "claim" voucher from a coinsJson string: \[\["coinId","amount"],...]. Output: "coinId:amount" pairs sorted alphabetically by coinId, comma-joined. Must produce the same output as the TypeScript claimVoucherPayload() function in src/lib/game/claim-voucher.ts.
- OID
- 0a9dd2…b5d8:1172
compactClaimPayload details
compactAchPayload
func(idsJson string) stringcompactAchPayload builds the canonical compact payload for an "ach" voucher from an idsJson string: \["achId",...]. Output: achievement IDs sorted alphabetically, comma-joined.
- OID
- 0a9dd2…b5d8:1173
compactAchPayload details
LastNonce
func(addr string) int64LastNonce returns the last voucher nonce used by addr (0 if none).
- OID
- 0a9dd2…b5d8:1174
LastNonce details
useVoucher
func(kind string, player string, nonce int64, expiry int64, payload string, sigHex string)- OID
- 0a9dd2…b5d8:1175
useVoucher details
bestOwnedTool
func(callerAddr string) stringbestOwnedTool returns the highest-tier tool the caller owns that still has durability (or is indestructible). "hands" if none.
- OID
- 0a9dd2…b5d8:1176
bestOwnedTool details
effectiveRateFor
func(tool string, r int) uint64- OID
- 0a9dd2…b5d8:1177
effectiveRateFor details
loadPackedBuckets
func(addr string, nowTs int64) [7][2]uint64loadPackedBuckets reads the packed claimBuckets entry for addr, or creates a fresh one. Returns \[7]\[2]uint64 where \[r]\[0]=accruedMillis, \[r]\[1]=lastTs. Lazy-migrates from the old per-rarity key format (addr+":"+r) on first read after an upgrade.
- OID
- 0a9dd2…b5d8:1178
loadPackedBuckets details
formatPackedBuckets
func(buckets [7][2]uint64) stringformatPackedBuckets serializes \[7]\[2]uint64 to "m0:t0|m1:t1|...|m6:t6".
- OID
- 0a9dd2…b5d8:1179
formatPackedBuckets details
bucketState
func(allBuckets [7][2]uint64, r int, tool string, nowTs int64) (uint64, uint64)bucketState returns (accruedMillis, capMillis) for rarity r at nowTs. allBuckets is the result of loadPackedBuckets — pass it in to avoid re-reading the AVL entry for each rarity check.
- OID
- 0a9dd2…b5d8:1180
bucketState details
enforceClaimRate
func(callerAddr string, byRarity [7]uint64, nowTs int64, tool string)enforceClaimRate checks every rarity first, then deducts (no partial writes). FIX 2A: reads claimBuckets once (packed format) instead of once per rarity.
- OID
- 0a9dd2…b5d8:1181
enforceClaimRate details
decrementToolLife
func(callerAddr string, totalCoins uint64, tool string)decrementToolLife wears the best tool by the number of non-dust coins. FIX 1A: accepts pre-computed tool to avoid a second bestOwnedTool call.
- OID
- 0a9dd2…b5d8:1182
decrementToolLife details
parseCoinClaims
func(coinsJson string) ([]string, map[string]uint64, [7]uint64)parseCoinClaims parses \[\["coinId","amount"],...]. Unknown ids panic (allowlist); duplicate ids are summed; at most 20 entries.
- OID
- 0a9dd2…b5d8:1183
parseCoinClaims details
guildBonusPct
func(addr string) uint64- OID
- 0a9dd2…b5d8:1184
guildBonusPct details
creditMined
func(addr string, coinId string, amt uint64) uint64creditMined credits a mined/reward amount to addr, capped by the vein, and records lifetime total. Returns the amount credited. FIX 1B: miners update removed — caller must addU(&miners, addr, total) after the loop.
- OID
- 0a9dd2…b5d8:1185
creditMined details
creditReward
func(addr string, coinId string, amt uint64) uint64creditReward credits a reward (medal/achievement or any future event). It still draws from the vein (so rewards can't exceed supply caps) but is tracked in its own counter: it never touches lifetimeMined or the miners leaderboard, so rewards can't unlock grind medals or inflate rankings.
- OID
- 0a9dd2…b5d8:1186
creditReward details
ClaimAndMint
func(coinsJson string, nonce int64, expiry int64, sigHex string) stringClaimAndMint credits mined coins to the caller's on-chain balance. coinsJson: \[\["coinId","amount"],...]. Requires a server voucher (see VoucherMessage) for exactly this coinsJson, plus the on-chain rate cap for the caller's best tool, the coin allowlist and the vein caps. Returns a JSON object of what was actually credited (after bonuses/veins).
- OID
- 0a9dd2…b5d8:1187
ClaimAndMint details
ClaimMine
func(coinsJson string)ClaimMine (game27/28 two-step flow) is retired: pending mints are gone.
- OID
- 0a9dd2…b5d8:1188
ClaimMine details
PendingMints
func(playerAddr string) stringPendingMints is kept for client compatibility; game29 has no pending step.
- OID
- 0a9dd2…b5d8:1189
PendingMints details
ClaimAllowance
func(playerAddr string) stringClaimAllowance returns the current per-rarity allowance for addr.
- OID
- 0a9dd2…b5d8:1190
ClaimAllowance details
lget
func(id string, f string) string- OID
- 0a9dd2…b5d8:1191
lget details
lset
func(id string, f string, v string)- OID
- 0a9dd2…b5d8:1193
lset details
renderLobby
func(id string)- OID
- 0a9dd2…b5d8:1194
renderLobby details
touch
func(id string)- OID
- 0a9dd2…b5d8:1195
touch details
lastAction
func(id string) int64- OID
- 0a9dd2…b5d8:1196
lastAction details
CreatePvpLobby
func(game string, coinId string, betAmount string) stringCreatePvpLobby escrows the creator's wager and opens a lobby.
- OID
- 0a9dd2…b5d8:1197
CreatePvpLobby details
JoinPvpLobby
func(lobbyId string)- OID
- 0a9dd2…b5d8:1198
JoinPvpLobby details
pvpWagered
func(id string) boolpvpWagered: a lobby that escrowed coins before wagers were switched off. It can only be cancelled or refunded after the timeout.
- OID
- 0a9dd2…b5d8:1199
pvpWagered details
CancelPvpLobby
func(lobbyId string)CancelPvpLobby lets the creator close an open lobby nobody joined (refund). Works while paused: a refund of the player's own escrow is never blocked.
- OID
- 0a9dd2…b5d8:1200
CancelPvpLobby details
memberOf
func(lobbyId string, addr string) bool- OID
- 0a9dd2…b5d8:1201
memberOf details
CommitPvpMove
func(lobbyId string, moveHash string)CommitPvpMove stores sha256(choice+":"+salt) for the caller. Members only, once per player per lobby, only while the lobby is joined.
- OID
- 0a9dd2…b5d8:1202
CommitPvpMove details
validChoice
func(game string, choice string) bool- OID
- 0a9dd2…b5d8:1203
validChoice details
moveHash
func(choice string, salt string) string- OID
- 0a9dd2…b5d8:1204
moveHash details
RevealPvpMove
func(lobbyId string, choice string, salt string)RevealPvpMove reveals a committed move. The tx fails unless sha256(choice+":"+salt) equals the stored commit. A matching reveal of an invalid choice forfeits the match. When both have revealed, it settles.
- OID
- 0a9dd2…b5d8:1205
RevealPvpMove details
pvpWinner
func(game string, creator string, challenger string, cChoice string, chChoice string, cSalt string, chSalt string) stringpvpWinner: rps uses the usual rules. coin\_flip / higher\_lower flip a coin from sha256(creatorSalt:challengerSalt) — neither player controls it alone — and whoever alone called it wins (both or neither right = draw).
- OID
- 0a9dd2…b5d8:1206
pvpWinner details
settlePvp
func(lobbyId string, result string)settlePvp pays out the escrow. result = winner addr, "draw" or "refund".
- OID
- 0a9dd2…b5d8:1207
settlePvp details
ClaimPvpTimeout
func(lobbyId string)ClaimPvpTimeout resolves a stuck match after pvpTimeoutSec without action: - only one player committed → that player wins; - both committed, only one revealed → the revealer wins; - otherwise → both refunded. Any lobby member may call it. Escrow can never stay locked.
- OID
- 0a9dd2…b5d8:1208
ClaimPvpTimeout details
ExpireLobbies
func()ExpireLobbies is a no-op kept for API compatibility (timeouts are per lobby).
- OID
- 0a9dd2…b5d8:1209
ExpireLobbies details
PvpLobby
func(lobbyId string) string- OID
- 0a9dd2…b5d8:1210
PvpLobby details
OpenLobbies
func() string- OID
- 0a9dd2…b5d8:1211
OpenLobbies details
sha256Sum
func(s string) string- OID
- 0a9dd2…b5d8:1212
sha256Sum details
zeroPad
func(n uint64, w int) stringzeroPad formats n with leading zeros to width w (ufmt has no %0Nd).
- OID
- 0a9dd2…b5d8:1213
zeroPad details
effectiveMaxLife
func(callerAddr string, toolId string) uint64effectiveMaxLife = toolMaxLife × (1000 + Σ rank × bonus‰) / 1000. FIX 1C: fast-path for players with no tool-life skills trained (the common case), avoiding 22 AVL reads (11 skills × Has+Get) that all return 0.
- OID
- 0a9dd2…b5d8:1214
effectiveMaxLife details
ownsTool
func(addr string, toolId string) bool- OID
- 0a9dd2…b5d8:1216
ownsTool details
Transfer
func(coinId string, toAddr string, amountStr string)Transfer sends coins to another player. It is a player's own money, so the admin can't stop it: it works while the game is paused and for banned addresses (bans only stop earning). It needs a finalized migration (MigrateBatch SETs balances). There is no receive cap: any coin can be sent to any player, whatever tools they own.
- OID
- 0a9dd2…b5d8:1217
Transfer details
BuyTool
func(toolId string)- OID
- 0a9dd2…b5d8:1218
BuyTool details
RepairTool
func(toolId string)- OID
- 0a9dd2…b5d8:1219
RepairTool details
TrainSkill
func(skillId string)- OID
- 0a9dd2…b5d8:1220
TrainSkill details
parseGrindId
func(id string) (string, uint64, bool)- OID
- 0a9dd2…b5d8:1221
parseGrindId details
isValidAchievementId
func(id string) bool- OID
- 0a9dd2…b5d8:1222
isValidAchievementId details
achievementReward
func(addr string, id string) ([]game31.coinAmt, string)achievementReward returns the fixed reward for id, checking any on-chain predicate (grind: lifetimeMined ≥ need; "\<tool>\_own": tool owned). ok=false means the id is unknown or not earned on chain.
- OID
- 0a9dd2…b5d8:1223
achievementReward details
claimAchievementsFor
func(addr string, ids []string, strict bool) intclaimAchievementsFor claims ids for addr. strict=true panics on any bad id; otherwise bad/claimed ids are skipped. Returns the number claimed.
- OID
- 0a9dd2…b5d8:1224
claimAchievementsFor details
ClaimAchievement
func(achievementId string, nonce int64, expiry int64, sigHex string)ClaimAchievement claims one allowlisted achievement and credits its fixed reward. Needs a server voucher of kind "ach" with payload = \`\["\<id>"]\`.
- OID
- 0a9dd2…b5d8:1225
ClaimAchievement details
BatchClaimAchievements
func(idsJson string, nonce int64, expiry int64, sigHex string) intBatchClaimAchievements claims several ids (already-claimed / not-earned ids are skipped). idsJson must be exactly the voucher payload.
- OID
- 0a9dd2…b5d8:1226
BatchClaimAchievements details
HasAchievement
func(addr string, id string) bool- OID
- 0a9dd2…b5d8:1227
HasAchievement details
parseDailyCheckin
func(raw string) (int64, int64)parseDailyCheckin reads the stored value for an address and returns (lastDay, streak). It handles both the new "\<lastDay>:\<streak>" format and the legacy "\<unix seconds>" format (which stores raw epoch seconds; treated as lastDay = seconds/86400, streak = 1).
- OID
- 0a9dd2…b5d8:1228
parseDailyCheckin details
DailyCheckin
func()- OID
- 0a9dd2…b5d8:1229
DailyCheckin details
CreateTask
func(taskId string, desc string)Tasks: game28 let anyone mark any task done. In game29 tasks are created and completed for a player only by the operator (server) — no free medals.
- OID
- 0a9dd2…b5d8:1230
CreateTask details
CompleteTask
func(taskId string)- OID
- 0a9dd2…b5d8:1231
CompleteTask details
CompleteTaskFor
func(player string, taskId string)- OID
- 0a9dd2…b5d8:1232
CompleteTaskFor details
slotsReels
untyped bigintValue
(5 <untyped> bigint)
slotsRows
untyped bigintValue
(4 <untyped> bigint)
slotsCells
untyped bigintValue
(20 <untyped> bigint)
slotsStripLen
untyped bigintValue
(40 <untyped> bigint)
slotsBetStep
uint64// bet must be a multiple of the 25 lines
Value
25
slotsMaxWinMult
uint64Value
500
symWild
uint8Value
0
symScatter
uint8Value
8
symVault
uint8Value
9
hsLandBelow
uint8// a free cell lands a coin when its byte \< 8 (3.125%)
Value
8
hsRespins
untyped bigintValue
(3 <untyped> bigint)
hsMini
uint16Value
101
hsMinor
uint16Value
102
hsMajor
uint16Value
103
hsGrand
uint16Value
104
slotsStrip
untyped stringOne strip for all reels: wild 1, seven 3, diamond 4, trophy 5, star 6, clover 6, flame 7, coin 6, scatter 1, vault 1 (digits = symbol ids).
Value
"8645732106457321645793216457326457364576"
slotsSymbolNames
[10]string- OID
- 0a9dd2…b5d8:1234
slotsSymbolNames details
slotsPays
[8][3]uint64line-bet multiples for 3/4/5 of a kind, symbols 0..7
- OID
- 0a9dd2…b5d8:1236
slotsPays details
slotsPaylines
[25][5]uint8same 25 lines as src/lib/game/slots.ts PAYLINES (row per reel)
- OID
- 0a9dd2…b5d8:1246
slotsPaylines details
slotsScatterPay
[6]uint64// × bet, by scatter count
- OID
- 0a9dd2…b5d8:1273
slotsScatterPay details
slotsFreeSpins
[6]uint64- OID
- 0a9dd2…b5d8:1275
slotsFreeSpins details
slotsStream
typeValue
game31.slotsStream
newSlotsStream
func(serverSeed string, clientSecret string, roundId string) *game31.slotsStream- OID
- 0a9dd2…b5d8:1276
newSlotsStream details
slotsSpinGrid
func(s *game31.slotsStream) [20]uint8slotsSpinGrid draws the 5 reel stops and returns the 20 visible symbols.
- OID
- 0a9dd2…b5d8:1278
slotsSpinGrid details
slotsLineMult
func(g *[20]uint8) (uint64, int)slotsLineMult = Σ line pays in line-bet units, and how many lines paid.
- OID
- 0a9dd2…b5d8:1279
slotsLineMult details
slotsCount
func(g *[20]uint8, sym uint8) int- OID
- 0a9dd2…b5d8:1280
slotsCount details
hsDrawValue
func(s *game31.slotsStream) uint16hsDrawValue: 1× 50%, 2× 28%, 3× 12%, 5× 6%, MINI 3%, MINOR 0.9%, MAJOR 0.08%, GRAND 0.02%.
- OID
- 0a9dd2…b5d8:1281
hsDrawValue details
slotsHoldAndSpin
func(s *game31.slotsStream, g *[20]uint8) ([20]uint16, int, bool)slotsHoldAndSpin resolves the whole bonus from the stream: the vault cells start locked with a value each; then while respins remain and the board isn't full, every empty cell (in index order) lands a coin when its byte \< 8, and a landing resets the respins to 3. Returns the 20 tiles (0 = empty), how many respins were played, and whether the board filled (blackout = GRAND).
- OID
- 0a9dd2…b5d8:1282
slotsHoldAndSpin details
slotsGridString
func(g *[20]uint8) string- OID
- 0a9dd2…b5d8:1283
slotsGridString details
hsTilesString
func(t *[20]uint16) string- OID
- 0a9dd2…b5d8:1284
hsTilesString details
jsonStr
func(s string) stringjsonStr returns s as a quoted, escaped JSON string (game28 concatenated raw user strings into JSON, so a guild name with a quote broke every reader).
- OID
- 0a9dd2…b5d8:1285
jsonStr details
sanitizeName
func(s string) stringsanitizeName trims and strips control characters from a display name.
- OID
- 0a9dd2…b5d8:1287
sanitizeName details
isSafeId
func(s string, maxLen int) boolisSafeId reports whether s is a short \[a-z0-9\_.-] identifier.
- OID
- 0a9dd2…b5d8:1288
isSafeId details
isHex64
func(s string) bool- OID
- 0a9dd2…b5d8:1289
isHex64 details
parseStringRows
func(s string) [][]stringparseStringRows parses a JSON array of arrays of strings, e.g. \[\["g1..","grin","10"],\["g1..","joy","4"]]. Numbers are accepted unquoted. Panics on malformed input.
- OID
- 0a9dd2…b5d8:1290
parseStringRows details
parseStringList
func(s string) []stringparseStringList parses \["a","b",...].
- OID
- 0a9dd2…b5d8:1291
parseStringList details
jparser
typeValue
game31.jparser
getU
func(t *v0.Tree, key string) uint64- OID
- 0a9dd2…b5d8:1292
getU details
setU
func(t *v0.Tree, key string, v uint64)- OID
- 0a9dd2…b5d8:1293
setU details
addU
func(t *v0.Tree, key string, d uint64) uint64addU adds d to a stored counter; panics instead of wrapping on overflow.
- OID
- 0a9dd2…b5d8:1294
addU details
balOf
func(addr string, coin string) uint64- OID
- 0a9dd2…b5d8:1295
balOf details
creditBal
func(addr string, coin string, amt uint64)- OID
- 0a9dd2…b5d8:1296
creditBal details
debitBal
func(addr string, coin string, amt uint64)- OID
- 0a9dd2…b5d8:1297