ChallengeWindowSeconds
int64// 3-minute challenge window for settlement proposals
Value
180
TurnTimeoutSeconds
int64// 2-minute move timeout when opponent is AFK (Abandonment)
Value
120
getVerifiedCaller
func(caller .uverse.address) (.uverse.address, .uverse.error)- OID
- 0af112…94af:5
getVerifiedCaller details
games
[]*kewrchess.GameStores all chess games permanently on the blockchain
- OID
- 0af112…94af:50
games details
nextGameID
intValue
1
matchmakingQueue
[].uverse.addressOn-chain matchmaking queue (FIFO)
Value
<zero>
init.6
func()- OID
- 0af112…94af:10
init.6 details
CreateGame
func(caller .uverse.address, opponent .uverse.address) .uverse.errorCreateGame creates a new direct game challenge
- OID
- 0af112…94af:11
CreateGame details
JoinQueue
func(caller .uverse.address) .uverse.errorJoinQueue registers a player into the on-chain matchmaking queue. If the queue is empty, the player is added to the queue. If another player is already waiting, both players are immediately matched into a new game.
- OID
- 0af112…94af:12
JoinQueue details
LeaveQueue
func(caller .uverse.address) .uverse.errorLeaveQueue cancels and removes a player from the on-chain matchmaking queue
- OID
- 0af112…94af:13
LeaveQueue details
makeMoveInternal
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error- OID
- 0af112…94af:14
makeMoveInternal details
MakeMove
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.errorMakeMove moves a piece (defaults to Queen on promotion)
- OID
- 0af112…94af:15
MakeMove details
MakeMovePromote
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.errorMakeMovePromote moves a piece with a specified promotion piece (Q, R, B, N)
- OID
- 0af112…94af:16
MakeMovePromote details
Resign
func(caller .uverse.address, gameID int) .uverse.errorResign resigns the game for the calling player
- OID
- 0af112…94af:17
Resign details
OfferDraw
func(caller .uverse.address, gameID int) .uverse.errorOfferDraw offers a draw to the opponent
- OID
- 0af112…94af:18
OfferDraw details
AcceptDraw
func(caller .uverse.address, gameID int) .uverse.errorAcceptDraw accepts a draw offer from the opponent
- OID
- 0af112…94af:19
AcceptDraw details
DeclineDraw
func(caller .uverse.address, gameID int) .uverse.errorDeclineDraw declines a draw offer from the opponent
- OID
- 0af112…94af:20
DeclineDraw details
ProposeSettlement
func(caller .uverse.address, gameID int, movesUCI string) .uverse.errorProposeSettlement submits a victory claim for off-chain chess results. Prevents fraudulent opponent moves: proposal opens a challenge period. Opponent can confirm immediately (ConfirmSettlement), or dispute if cheated (DisputeSettlement). If opponent does not respond, winner can finalize after ChallengeWindowSeconds expires.
- OID
- 0af112…94af:21
ProposeSettlement details
ConfirmSettlement
func(caller .uverse.address, gameID int) .uverse.errorConfirmSettlement allows opponent to immediately approve final result without waiting for challenge window
- OID
- 0af112…94af:22
ConfirmSettlement details
FinalizeSettlement
func(caller .uverse.address, gameID int) .uverse.errorFinalizeSettlement officially finalizes the game after the challenge period has passed
- OID
- 0af112…94af:23
FinalizeSettlement details
DisputeSettlement
func(caller .uverse.address, gameID int) .uverse.errorDisputeSettlement allows opponent to dispute a fraudulent settlement proposal
- OID
- 0af112…94af:24
DisputeSettlement details
SettleGame
func(caller .uverse.address, gameID int, movesUCI string) .uverse.errorSettleGame proposes settlement and finalizes immediately if challenge window is 0
- OID
- 0af112…94af:25
SettleGame details
StartTurnTimer
func(caller .uverse.address, gameID int, currentMovesUCI string) .uverse.errorStartTurnTimer is initiated when opponent goes AFK or closes browser (Rage Quit) during an off-chain game. Player submits current move history (currentMovesUCI). Smart contract validates the board and ensures it is the OPPONENT'S TURN.
- OID
- 0af112…94af:26
StartTurnTimer details
ClaimTimeout
func(caller .uverse.address, gameID int) .uverse.errorClaimTimeout allows the challenger to win the game after the opponent goes AFK/rage quits and turnDeadline has passed without a response move from the opponent.
- OID
- 0af112…94af:27
ClaimTimeout details
GetGamesCount
func() intGetGamesCount returns the total number of games
- OID
- 0af112…94af:28
GetGamesCount details
GetBoard
func(gameID int) [8][8]stringGetBoard returns the 8x8 board for a given game ID
- OID
- 0af112…94af:29
GetBoard details
GetWhitePlayer
func(gameID int) .uverse.address- OID
- 0af112…94af:30
GetWhitePlayer details
GetBlackPlayer
func(gameID int) .uverse.address- OID
- 0af112…94af:31
GetBlackPlayer details
IsWhiteTurn
func(gameID int) boolIsWhiteTurn returns whether it is White's turn for a given game ID
- OID
- 0af112…94af:32
IsWhiteTurn details
GetGameStatus
func(gameID int) stringGetGameStatus returns the game status for a given game ID
- OID
- 0af112…94af:33
GetGameStatus details
GetDrawOfferedBy
func(gameID int) .uverse.address- OID
- 0af112…94af:34
GetDrawOfferedBy details
GetResignedBy
func(gameID int) .uverse.address- OID
- 0af112…94af:35
GetResignedBy details
GetQueueCount
func() intGetQueueCount returns the number of players waiting in the matchmaking queue
- OID
- 0af112…94af:36
GetQueueCount details
IsInQueue
func(addr .uverse.address) boolIsInQueue checks if an address is currently waiting in the matchmaking queue
- OID
- 0af112…94af:37
IsInQueue details
GetActiveGameForPlayer
func(addr .uverse.address) intGetActiveGameForPlayer searches for the latest active game ("PLAYING") for a given address. Returns -1 if no active game found.
- OID
- 0af112…94af:38
GetActiveGameForPlayer details
GetLatestGameForPlayer
func(addr .uverse.address) intGetLatestGameForPlayer returns the latest game ID involving the player, or -1 if none.
- OID
- 0af112…94af:39
GetLatestGameForPlayer details
GetSettledBy
func(gameID int) .uverse.address- OID
- 0af112…94af:40
GetSettledBy details
GetProposedBy
func(gameID int) .uverse.address- OID
- 0af112…94af:41
GetProposedBy details
GetPendingStatus
func(gameID int) stringGetPendingStatus returns the pending status of settlement
- OID
- 0af112…94af:42
GetPendingStatus details
GetChallengeDeadline
func(gameID int) int64GetChallengeDeadline returns the deadline unix timestamp for challenging settlement
- OID
- 0af112…94af:43
GetChallengeDeadline details
GetTurnDeadline
func(gameID int) int64GetTurnDeadline returns the deadline unix timestamp for turn timeout
- OID
- 0af112…94af:44
GetTurnDeadline details
GetTurnChallengedBy
func(gameID int) .uverse.address- OID
- 0af112…94af:45
GetTurnChallengedBy details
Render
func(path string) string- OID
- 0af112…94af:46
Render details
Game
typeGame represents an on-chain chess game session
Value
kewrchess.Game
NewGame
func(id int, white .uverse.address, black .uverse.address) *kewrchess.GameNewGame initializes a new game with the standard chess starting layout
- OID
- 0af112…94af:48