version
int64// bumps on every admin write, see Version
Value
1
arenas
v0.BPTree// arena id -> \*arena, with its lobby and its round
- OID
- 0e5ce9…8022:219
arenas details
results
v0.BPTree// arena id -> encoded result, see results.gno
- OID
- 0e5ce9…8022:220
results details
closed
[]stringThe whole state of the realm. Everything is unexported and nothing below is ever returned by reference: the trees are /p/ types with mutator methods, so handing one out would be handing out write access to the realm.
Value
<zero>
refundDelay
int64// seconds after a game's time limit before anyone may refund it
Value
600
escrowed
int64// ugnot owed to players: the stakes of every lobby and running game, and their unclaimed winnings
Value
0
claims
v0.BPTree// player address -> encoded credits
- OID
- 0e5ce9…8022:221
claims details
earnings
v0.BPTree// player address -> encoded totals, allocated on a first settled game
- OID
- 0e5ce9…8022:222
earnings details
winners
v0.ranking// the top players by winnings
- OID
- 0e5ce9…8022:223
winners details
webPath
string// "/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/arena/v0", used to build links in Render
Value
"/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/arena/v0"
defaultRefundDelay
untyped bigint// seconds
Value
(600 <untyped> bigint)
init.11
func()- OID
- 0e5ce9…8022:18
init.11 details
bootstrap
func(pkgPath string)bootstrap (re)creates the initial state. The tests call it to start from a clean slate.
- OID
- 0e5ce9…8022:20
bootstrap details
Version
func() int64Version returns a counter that bumps on every admin write: the refund delay. Player and referee actions do not bump it.
- OID
- 0e5ce9…8022:21
Version details
now
func() int64now returns the block time in Unix seconds.
- OID
- 0e5ce9…8022:22
now details
webPathOf
func(pkgPath string) stringwebPathOf turns "gno.land/r/..." into "/r/...".
- OID
- 0e5ce9…8022:23
webPathOf details
itoa
func(n int64) string- OID
- 0e5ce9…8022:24
itoa details
claimCredit
typeclaimCredit is what one game owes one player.
Value
v0.claimCredit
creditsOf
func(addr .uverse.address) []v0.claimCredit- OID
- 0e5ce9…8022:25
creditsOf details
credit
func(addr .uverse.address, id string, amount int64)credit owes amount to a player for the game of an arena. The coins are already in the realm: they stay in the escrow until claimed.
- OID
- 0e5ce9…8022:27
credit details
Claim
func() int64Claim sends the caller everything the realm owes them from settled games, and returns the amount in ugnot. It panics when there is nothing to claim.
- OID
- 0e5ce9…8022:28
Claim details
Claimable
func(addr .uverse.address) int64Claimable returns what a player can claim, in ugnot.
- OID
- 0e5ce9…8022:29
Claimable details
ClaimsJSON
func(addr .uverse.address) stringClaimsJSON returns what a player can claim, game by game, oldest first: { "address": "g1...", "total": 19000000, "games": [ { "id": "...", "amount": 19000000 } ] } The output has no whitespace. An address with nothing to claim returns the same shape with a zero total and no game.
- OID
- 0e5ce9…8022:30
ClaimsJSON details
topSize
untyped biginttopSize is how many players the list of top winners holds.
Value
(10 <untyped> bigint)
totals
typetotals is what the realm remembers about one player.
Value
v0.totals
totalsOf
func(addr .uverse.address) v0.totalstotalsOf returns the totals of a player, zero for a player who never finished a round.
- OID
- 0e5ce9…8022:31
totalsOf details
creditRound
func(stake int64, players [].uverse.address, payouts []v0.Payout)creditRound records a settled round for each of its players: one more round played, and what they were paid above their stake, if anything.
- OID
- 0e5ce9…8022:33
creditRound details
ranking
typeranking is the list of top winners: the players who won the most, best first, at most topSize lines and one line per player. With equal winnings, the player who got there first stays ahead. It is the ranking of the game realm. It is kept sorted at write time, so reading it never has to look at every player. Winnings only going up is what makes that exact: a player outside the list can only enter it through raise. The two slices are parallel: slices of plain values are one stored object each, where a slice of structs would be one object per line.
Value
v0.ranking
spliceAddrs
func(list [].uverse.address, from int, to int, v .uverse.address, size int) [].uverse.address- OID
- 0e5ce9…8022:34
spliceAddrs details
spliceInts
func(list []int64, from int, to int, v int64, size int) []int64spliceInts is spliceAddrs for a column of numbers.
- OID
- 0e5ce9…8022:35
spliceInts details
errSpoofedRealm
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:37
errSpoofedRealm details
errNotOwner
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:40
errNotOwner details
errNotAdmin
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:43
errNotAdmin details
errNotReferee
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:46
errNotReferee details
errInvalidSpec
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:49
errInvalidSpec details
errInvalidMode
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:52
errInvalidMode details
errInvalidStake
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:55
errInvalidStake details
errInvalidSeats
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:58
errInvalidSeats details
errInvalidLives
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:61
errInvalidLives details
errInvalidSeconds
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:64
errInvalidSeconds details
errInvalidKillTarget
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:67
errInvalidKillTarget details
errRoyaleTarget
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:70
errRoyaleTarget details
errInvalidAddress
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:73
errInvalidAddress details
errInvalidRefundDelay
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:76
errInvalidRefundDelay details
errUnknownArena
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:79
errUnknownArena details
errNotUserCall
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:82
errNotUserCall details
errEntryClosed
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:85
errEntryClosed details
errNotYetCreated
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:88
errNotYetCreated details
errInvalidTicket
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:91
errInvalidTicket details
errAlreadyInLobby
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:94
errAlreadyInLobby details
errLobbyFull
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:97
errLobbyFull details
errNotInLobby
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:100
errNotInLobby details
errNotExpired
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:103
errNotExpired details
errRoundRunning
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:106
errRoundRunning details
errTooFewPlayers
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:109
errTooFewPlayers details
errNoRound
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:112
errNoRound details
errRefundTooEarly
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:115
errRefundTooEarly details
errBadSettlement
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:118
errBadSettlement details
errNotConserved
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:121
errNotConserved details
errEscrow
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:124
errEscrow details
errInsolvent
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:127
errInsolvent details
errNothingToClaim
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:130
errNothingToClaim details
errCorruptClaims
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:133
errCorruptClaims details
errCorruptResult
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:136
errCorruptResult details
errCorruptEarnings
*errors.errorStringErrors are values created once, at package init: a panic with one of them costs no allocation. Messages that need a value are built at the call.
- OID
- 0e5ce9…8022:139
errCorruptEarnings details
payDenom
untyped stringpayDenom is the only coin the realm deals in.
Value
"ugnot"
hold
func(amount int64)hold records that the realm received amount in stakes.
- OID
- 0e5ce9…8022:141
hold details
release
func(amount int64)release takes amount out of what the realm owes. It is called before the coins are sent, and it panics rather than let the counter go below zero.
- OID
- 0e5ce9…8022:143
release details
pay
func(int, rlm .uverse.realm, to .uverse.address, amount int64)pay sends amount ugnot from the realm's own balance to an address. A RealmSend banker can spend everything the realm holds, which is why it is built here and only here, from the live cur of the crossing function (rlm), and never kept. The bank aborts the transaction if the realm does not have the coins.
- OID
- 0e5ce9…8022:144
pay details
assertSolvent
func(int, rlm .uverse.realm)assertSolvent panics unless the realm holds at least what it owes.
- OID
- 0e5ce9…8022:145
assertSolvent details
Escrowed
func() int64Escrowed returns what the realm owes to players, in ugnot: the stakes of every lobby and of every running round. The balance of the realm's address is never below it.
- OID
- 0e5ce9…8022:146
Escrowed details
ArenasJSON
func() stringArenasJSON returns every arena someone paid into and whose game is not over, as a JSON array sorted by id: [ { "id": "3f2a...", "mode": "deathmatch", "stake": 10000000, "minSeats": 2, "maxSeats": 8, "lives": 3, "seconds": 900, "killTarget": 5, "creator": "g1...", "created": 1790950000, "nonce": "k3x9", "lobby": [ { "address": "g1...", "ticket": "9f86d0...00a08" } ], "round": { "startedAt": 1790950300, "players": [ "g1...", "g1..." ] } } ] The output has no whitespace. "round" is null until the game starts. The fields from "mode" to "nonce" are the arena's spec: the game server rebuilds the spec string, and so the id, from them.
- OID
- 0e5ce9…8022:147
ArenasJSON details
ArenaJSON
func(id string) stringArenaJSON returns one arena in the shape of ArenasJSON, or null.
- OID
- 0e5ce9…8022:149
ArenaJSON details
writeArena
func(b *strings.Builder, id string, a *v0.arena)- OID
- 0e5ce9…8022:150
writeArena details
ResultsJSON
func() stringResultsJSON returns the last closed games, newest first, at most 50: [ { "id": "3f2a...", "mode": "deathmatch", "stake": 10000000, "outcome": "settled", "players": 2, "pot": 20000000, "fee": 500000, "closedAt": 1790951000, "payouts": [ { "address": "g1...", "amount": 19500000 } ] } ]
- OID
- 0e5ce9…8022:151
ResultsJSON details
ResultJSON
func(id string) stringResultJSON returns the result of one closed game in the shape of ResultsJSON, or null when the realm does not have it (still running, or too old).
- OID
- 0e5ce9…8022:152
ResultJSON details
writeResult
func(b *strings.Builder, id string, r v0.result)- OID
- 0e5ce9…8022:153
writeResult details
EarningsJSON
func() stringEarningsJSON returns the top winners as a JSON array, best first, at most 10 entries: [ { "address": "g1...", "won": 19000000, "rounds": 3 } ] The output has no whitespace. "won" adds up, round after round, what the player was paid above their own stake, never less than zero for a round. "rounds" is how many settled rounds they played. With equal winnings, the player who got there first stays ahead.
- OID
- 0e5ce9…8022:154
EarningsJSON details
PlayerJSON
func(addr .uverse.address) stringPlayerJSON returns one player's totals as a JSON object: { "address": "g1...", "won": 19000000, "rounds": 3 } The output has no whitespace. An unknown address returns the same shape with zero won and zero rounds.
- OID
- 0e5ce9…8022:155
PlayerJSON details
writeTotals
func(b *strings.Builder, quoted string, t v0.totals)writeTotals writes the totals of a player. quoted is the player's address as a JSON string literal, quotes included.
- OID
- 0e5ce9…8022:156
writeTotals details
quote
func(s string) stringquote returns s as a JSON string literal, quotes included. It is for the strings the realm did not validate. Quotes and backslashes are escaped and anything outside printable ASCII is replaced by "?", so the result is valid JSON whatever s holds.
- OID
- 0e5ce9…8022:157
quote details
arena
typearena is one game: its spec, the players who paid and wait, and once it started, its round. It is stored from the first paid entry and deleted when its round is closed or its lobby empties.
Value
v0.arena
getArena
func(id string) *v0.arena- OID
- 0e5ce9…8022:158
getArena details
mustArena
func(id string) *v0.arena- OID
- 0e5ce9…8022:160
mustArena details
Enter
func(spec string, ticket string) stringEnter puts the caller in the lobby of the arena that spec describes, and returns its id. The exact stake must be attached to the transaction (-send "\<stake>ugnot") and stays in the realm until the player leaves or the game is over. The first entry creates the arena, the next ones join it: the realm recomputes the id from the spec every time. An arena takes entries for an hour after it was created, and until its game starts. ticket is 64 lowercase hex characters, the SHA-256 of a secret the player's client made up: the game server gives the seat to whoever shows the secret. It must be called directly by a user (maketx call): a call relayed by another realm or by a maketx run script is refused.
- OID
- 0e5ce9…8022:161
Enter details
Leave
func(id string)Leave takes the caller out of the lobby of an arena and sends their stake back. It works until the game starts. The last player out deletes the arena: nothing is left on chain of a game nobody played.
- OID
- 0e5ce9…8022:162
Leave details
ExpireLobby
func(id string)ExpireLobby closes an arena whose game never started: every player in the lobby gets their stake back, and the arena is deleted. Anyone can call it once the arena stopped taking entries, an hour after it was created.
- OID
- 0e5ce9…8022:163
ExpireLobby details
withAddr
func(list [].uverse.address, v .uverse.address) [].uverse.address- OID
- 0e5ce9…8022:164
withAddr details
withString
func(list []string, v string) []stringwithString returns list with v added at the end.
- OID
- 0e5ce9…8022:165
withString details
withoutAddr
func(list [].uverse.address, at int) [].uverse.address- OID
- 0e5ce9…8022:166
withoutAddr details
withoutString
func(list []string, at int) []stringwithoutString returns list without the element at index at.
- OID
- 0e5ce9…8022:167
withoutString details
Render
func(path string) stringRender returns the state of the arenas as markdown, for gnoweb: "" the open arenas and the last games played "arena/<id>" one arena: its rules, lobby and game, or its result "earnings" the top winners Everything printed here was validated against a narrow charset when it was written (see spec.gno and validate.gno), or is an address the chain gave the realm. The only caller-supplied value, the id of an arena page, is printed only if it is a valid id. Nothing needs markdown escaping.
- OID
- 0e5ce9…8022:168
Render details
link
func(path string) stringlink returns the gnoweb URL of a Render path of this realm.
- OID
- 0e5ce9…8022:170
link details
renderHome
func() string- OID
- 0e5ce9…8022:171
renderHome details
renderArena
func(id string, a *v0.arena) string- OID
- 0e5ce9…8022:172
renderArena details
renderResult
func(id string, r v0.result) string- OID
- 0e5ce9…8022:173
renderResult details
targetCell
func(n int64) stringtargetCell formats a kill target: most arenas end on the clock only.
- OID
- 0e5ce9…8022:174
targetCell details
paidCell
func(r v0.result) stringpaidCell lists who was paid what in a round, for a table cell.
- OID
- 0e5ce9…8022:175
paidCell details
renderEarnings
func() string- OID
- 0e5ce9…8022:176
renderEarnings details
modeDoc
func(mode string) stringmodeDoc is one sentence about the payout rule of a mode.
- OID
- 0e5ce9…8022:177
modeDoc details
gnot
func(ugnot int64) stringgnot formats an amount of ugnot in GNOT, without trailing zeros: 10000000 gives "10 GNOT", 9500000 gives "9.5 GNOT", 1 gives "0.000001 GNOT".
- OID
- 0e5ce9…8022:178
gnot details
percent
func(bps int64) stringpercent formats basis points as a percentage, without trailing zeros: 500 gives "5%", 250 gives "2.5%", 1 gives "0.01%".
- OID
- 0e5ce9…8022:179
percent details
clock
func(unix int64) stringclock formats a block time in Unix seconds, in UTC.
- OID
- 0e5ce9…8022:180
clock details
result
typeresult is how a game ended, kept for readers: no payment is ever computed from it.
Value
v0.result
outcomeSettled
untyped stringValue
"settled"
outcomeCancelled
untyped stringValue
"cancelled"
outcomeRefunded
untyped stringValue
"refunded"
maxResults
untyped bigintmaxResults is how many closed games the realm remembers.
Value
(50 <untyped> bigint)
decodeResult
func(s string) v0.result- OID
- 0e5ce9…8022:181
decodeResult details
record
func(id string, r v0.result)record keeps the result of a closed game, and forgets the oldest one past maxResults.
- OID
- 0e5ce9…8022:183
record details
resultOf
func(id string) (v0.result, bool)resultOf returns the result of a closed game, if the realm still has it.
- OID
- 0e5ce9…8022:184
resultOf details
indexFrom
func(s string, i int, c uint8) intindexFrom returns the index of the first c in s at or after i, or len(s).
- OID
- 0e5ce9…8022:185
indexFrom details
digits
func(s string) (int64, bool)digits parses a non-negative decimal of at most 18 digits.
- OID
- 0e5ce9…8022:186
digits details
authority
typeauthority is the set of questions this realm asks about roles.
Value
v0.authority
gameRoles
typegameRoles answers with the roles of the game realm.
Value
v0.gameRoles
roles
v0.gameRolesroles is the authority of this realm: the game realm, always. It is a variable for one reason. Under \`gno test\` an imported realm is initialized without a deployer, and a test of this package has no way to become the owner of the game realm, so the tests put their own answers here. Nothing outside the test files assigns it, and there is no setter.
- OID
- 0e5ce9…8022:188
roles details
callerOf
func(int, rlm .uverse.realm) .uverse.address- OID
- 0e5ce9…8022:189
callerOf details
assertOwner
func(int, rlm .uverse.realm) .uverse.address- OID
- 0e5ce9…8022:191
assertOwner details
assertAdmin
func(int, rlm .uverse.realm) .uverse.address- OID
- 0e5ce9…8022:192
assertAdmin details
assertReferee
func(int, rlm .uverse.realm) .uverse.address- OID
- 0e5ce9…8022:193
assertReferee details
round
typeround is the started game of an arena. Its players are fixed at start, and each of them has one stake in it.
Value
v0.round
StartRound
func(id string) int64StartRound starts the game of an arena with every player of its lobby. Referee only. The lobby must hold at least minSeats players; it holds at most maxSeats, Enter sees to that. No coin moves: the stakes that were owed to the lobby are now owed to the round. It returns how many play.
- OID
- 0e5ce9…8022:194
StartRound details
SettleRound
func(id string, deaths string)SettleRound closes the game of an arena: it applies the rule of its mode to what happened, pays the players, and pays the fee to the treasury. Referee only. deaths is "victim:killer" entries separated by ";", in the order they happened, "victim:" when nobody shot the victim down, and the empty string when nobody died. A player dies at most as often as the arena has lives. The referee is trusted for these facts and for nothing else. The rule refuses a victim or a killer who is not a player of the round, and decides the amounts. The realm then checks them (see settle) before it pays.
- OID
- 0e5ce9…8022:196
SettleRound details
settle
func(int, rlm .uverse.realm, id string, a *v0.arena, res v0.Result, referee .uverse.address)settle closes the game of an arena with the result of its rule. It trusts nothing about the result. Before a counter or a coin moves, checkResult verifies that only players of the round are paid and that the payouts and the fee add up to the pot, to the ugnot.
- OID
- 0e5ce9…8022:197
settle details
withFeeShared
func(players [].uverse.address, payouts []v0.Payout, fee int64) []v0.PayoutwithFeeShared returns payouts with fee added, shared between every player of the round, in their order: the remainder goes to the first.
- OID
- 0e5ce9…8022:198
withFeeShared details
checkResult
func(pot int64, players [].uverse.address, res v0.Result)checkResult panics unless a result can be paid out of a pot: every payout goes to a player of the round, a player is paid at most once and never zero or less, the fee is not negative, and all of it adds up to the pot exactly. The built-in rules guarantee all of this. The check is here so that the realm does not depend on it: whatever a rule returns, the realm never sends more than the pot, and never to a stranger.
- OID
- 0e5ce9…8022:199
checkResult details
CancelRound
func(id string)CancelRound closes the game of an arena without a result: every player gets their stake back in full. Referee only. The game server uses it for a game it cannot referee, for example one it finds running when it starts.
- OID
- 0e5ce9…8022:200
CancelRound details
RefundRound
func(id string)RefundRound closes the game of an arena without a result, like CancelRound, and can be called by anyone, once startedAt + seconds + RefundDelay() has passed on the block clock. It is the players' way out when the referee never settles: no stake depends on a server staying up.
- OID
- 0e5ce9…8022:201
RefundRound details
refund
func(int, rlm .uverse.realm, id string, a *v0.arena, outcome string, event string, caller .uverse.address)refund closes the game of an arena and sends every player their stake back. No fee is taken.
- OID
- 0e5ce9…8022:202
refund details
runningArena
func(id string) *v0.arenarunningArena returns an arena whose game is running. It panics for an unknown arena and for one whose game has not started.
- OID
- 0e5ce9…8022:203
runningArena details
minRefundDelay
untyped bigintRefund delay bounds, in seconds.
Value
(60 <untyped> bigint)
maxRefundDelay
untyped bigintRefund delay bounds, in seconds.
Value
(86400 <untyped> bigint)
SetRefundDelay
func(seconds int64)SetRefundDelay sets how long after a game's time limit anyone may refund it. Admin only.
- OID
- 0e5ce9…8022:204
SetRefundDelay details
RefundDelay
func() int64RefundDelay returns the refund delay, in seconds.
- OID
- 0e5ce9…8022:205
RefundDelay details
joinAddrs
func(list [].uverse.address) stringjoinAddrs writes addresses separated by commas, for an event.
- OID
- 0e5ce9…8022:206
joinAddrs details
joinPayouts
func(list []v0.Payout) stringjoinPayouts writes payouts as "address:amount" separated by commas, for an event and for the stored results.
- OID
- 0e5ce9…8022:207
joinPayouts details
specVersion
untyped stringBounds of a spec, the same as the game server's.
Value
"v1"
idLen
untyped bigintBounds of a spec, the same as the game server's.
Value
(24 <untyped> bigint)
minStake
untyped bigint// ugnot, 1 GNOT
Value
(1000000 <untyped> bigint)
maxStake
untyped bigint// ugnot, 1000 GNOT
Value
(1000000000 <untyped> bigint)
minSeconds
untyped bigint// 5 minutes
Value
(300 <untyped> bigint)
maxSeconds
untyped bigint// 30 minutes
Value
(1800 <untyped> bigint)
entryWindow
untyped bigint// seconds an arena takes entries after it was created
Value
(3600 <untyped> bigint)
clockSkew
untyped bigint// seconds a server clock may run ahead of the chain
Value
(300 <untyped> bigint)
maxNonceLen
untyped bigintBounds of a spec, the same as the game server's.
Value
(16 <untyped> bigint)
maxSpecLength
untyped bigintBounds of a spec, the same as the game server's.
Value
(160 <untyped> bigint)
feeBps
untyped bigintBounds of a spec, the same as the game server's.
Value
(500 <untyped> bigint)
spec
typespec is a parsed arena spec.
Value
v0.spec
idOf
func(s string) stringidOf returns the id of a spec string.
- OID
- 0e5ce9…8022:208
idOf details
parseSpec
func(s string) v0.specparseSpec reads and checks a spec string. It panics on anything the realm would not play.
- OID
- 0e5ce9…8022:210
parseSpec details
validNonce
func(s string) boolvalidNonce reports whether s is 1 to 16 characters of \[a-z0-9].
- OID
- 0e5ce9…8022:211
validNonce details
validID
func(s string) boolvalidID reports whether s can be an arena id: 24 lowercase hex characters.
- OID
- 0e5ce9…8022:212
validID details
ticketLen
untyped bigint// a SHA-256 in hex
Value
(64 <untyped> bigint)
validTicket
func(s string) boolvalidTicket reports whether s is 64 lowercase hex characters, the SHA-256 of the secret a player's client keeps.
- OID
- 0e5ce9…8022:213
validTicket details
validAddress
func(addr .uverse.address) boolvalidAddress reports whether addr is a valid address in its canonical, lowercase form. Bech32 can also be written in all capitals, and address.IsValid accepts that. Bech32 does not allow mixing cases, so looking at the first character is enough.
- OID
- 0e5ce9…8022:215
validAddress details
indexOfAddr
func(list [].uverse.address, addr .uverse.address) intindexOfAddr returns the index of addr in list, -1 when it is not there. The lists of this realm hold at most 16 addresses.
- OID
- 0e5ce9…8022:216