1package arena23// The string rules below are what makes the hand-built JSON and the markdown4// of this realm safe: every string that is stored and later printed went5// through one of them, and none of them lets a quote, a backslash, a pipe, a6// bracket or a control character in. They are the rules of the game realm.78const ticketLen = 64 // a SHA-256 in hex910// validTicket reports whether s is 64 lowercase hex characters, the SHA-25611// of the secret a player's client keeps.12func validTicket(s string) bool {13 if len(s) != ticketLen {14 return false15 }16 for i := 0; i < len(s); i++ {17 c := s[i]18 if !(c >= '0' && c <= '9') && !(c >= 'a' && c <= 'f') {19 return false20 }21 }22 return true23}2425// validAddress reports whether addr is a valid address in its canonical,26// lowercase form.27//28// Bech32 can also be written in all capitals, and address.IsValid accepts29// that. Bech32 does not allow mixing cases, so looking at the first character30// is enough.31func validAddress(addr address) bool {32 return addr.IsValid() && addr[0] == 'g'33}3435// indexOfAddr returns the index of addr in list, -1 when it is not there.36// The lists of this realm hold at most 16 addresses.37func indexOfAddr(list []address, addr address) int {38 for i, a := range list {39 if a == addr {40 return i41 }42 }43 return -144}45ArenaJSON(id string) string
ArenasJSON() string
CancelRound(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string)
Claim(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}) int64
Claimable(addr string) int64
ClaimsJSON(addr string) string
EarningsJSON() string
Enter(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, spec string, ticket string) string
Escrowed() int64
ExpireLobby(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string)
Leave(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string)
PlayerJSON(addr string) string
RefundDelay() int64
RefundRound(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string)
Render(path string) string
ResultJSON(id string) string
ResultsJSON() string
SetRefundDelay(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, seconds int64)
SettleRound(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string, deaths string)
StartRound(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string) int64
Version() int64
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.