duelStatus
typeduelStatus tracks the lifecycle of a duel.
Value
v0.duelStatus
statusPending
v0.duelStatusValue
<zero>
statusResolved
v0.duelStatusValue
<zero>
statusCancelled
v0.duelStatusValue
<zero>
duel
typeduel is one challenge from Challenger to Opponent over a single coin flip. The Challenger calls a side up front; the Opponent's only move is to accept, which triggers the flip.
Value
v0.duel
playerState
typeplayerState is the persisted win/loss record for one address.
Value
v0.playerState
duels
v0.Tree// duel ID -> \*duel
- OID
- 017272…c01b:4
duels details
players
v0.Tree// address string -> \*playerState
- OID
- 017272…c01b:6
players details
nextID
intValue
0
flipNonce
intValue
0
totalDone
intValue
0
champion
.uverse.addressValue
<zero>
championWins
intValue
0
parseCall
func(s string) (string, bool)- OID
- 017272…c01b:12
parseCall details
flipCoin
func(d *v0.duel) stringflipCoin derives a deterministic pseudo-random side from the current chain height, a monotonic per-realm nonce, and both duelists' addresses, so two duels resolved in the same block still diverge.
- OID
- 017272…c01b:14
flipCoin details
getOrCreate
func(addr .uverse.address) *v0.playerState- OID
- 017272…c01b:15
getOrCreate details
recordResult
func(winner .uverse.address, loser .uverse.address)- OID
- 017272…c01b:16
recordResult details
Challenge
func(opponentAddr string, call string) stringChallenge opens a new duel against opponentAddr, locking in the challenger's call of "heads"/"tails" ("h"/"t" also accepted). The opponent settles it by calling Accept with the returned duel ID.
- OID
- 017272…c01b:17
Challenge details
Accept
func(id string) stringAccept settles a pending duel. Only the challenged opponent may call it; the flip happens immediately and the result is final.
- OID
- 017272…c01b:18
Accept details
Cancel
func(id string) stringCancel withdraws a still-pending duel. Only the challenger may cancel, and only before the opponent accepts.
- OID
- 017272…c01b:19
Cancel details
escapeInline
func(s string) stringescapeInline neutralizes markdown-active characters in untrusted text before it's embedded inline in Render output.
- OID
- 017272…c01b:20
escapeInline details
renderHome
func() string- OID
- 017272…c01b:21
renderHome details
renderDuel
func(id string) string- OID
- 017272…c01b:22
renderDuel details
renderPlayer
func(rawAddr string) string- OID
- 017272…c01b:23
renderPlayer details
Render
func(path string) stringRender shows the duel arena at "", a specific duel when path is a numeric ID, or one player's record when path is their bech32 address.
- OID
- 017272…c01b:24