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
- 097bef…1678:5
getVerifiedCaller details
games
[]*kewrchess_v2.GameStores all chess games permanently on the blockchain
- OID
- 097bef…1678:131
games details
nextGameID
intValue
5
matchmakingQueue
[].uverse.addressOn-chain matchmaking queue (FIFO)
- OID
- 097bef…1678:130
init.6
func()- OID
- 097bef…1678:10
init.6 details
CreateGame
func(opponent .uverse.address) .uverse.errorCreateGame creates a new direct game challenge
- OID
- 097bef…1678:11
CreateGame details
CreateGameInternal
func(caller .uverse.address, opponent .uverse.address) .uverse.error- OID
- 097bef…1678:12
CreateGameInternal details
JoinQueue
func() .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
- 097bef…1678:13
JoinQueue details
JoinQueueInternal
func(caller .uverse.address) .uverse.error- OID
- 097bef…1678:14
JoinQueueInternal details
LeaveQueue
func() .uverse.errorLeaveQueue cancels and removes a player from the on-chain matchmaking queue
- OID
- 097bef…1678:15
LeaveQueue details
LeaveQueueInternal
func(caller .uverse.address) .uverse.error- OID
- 097bef…1678:16
LeaveQueueInternal details
makeMoveInternal
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error- OID
- 097bef…1678:17
makeMoveInternal details
MakeMove
func(gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.errorMakeMove moves a piece (defaults to Queen on promotion)
- OID
- 097bef…1678:18
MakeMove details
MakeMoveInternal
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.error- OID
- 097bef…1678:19
MakeMoveInternal details
MakeMovePromote
func(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
- 097bef…1678:20
MakeMovePromote details
MakeMovePromoteInternal
func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error- OID
- 097bef…1678:21
MakeMovePromoteInternal details
Resign
func(gameID int) .uverse.errorResign resigns the game for the calling player
- OID
- 097bef…1678:22
Resign details
ResignInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:23
ResignInternal details
OfferDraw
func(gameID int) .uverse.errorOfferDraw offers a draw to the opponent
- OID
- 097bef…1678:24
OfferDraw details
OfferDrawInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:25
OfferDrawInternal details
AcceptDraw
func(gameID int) .uverse.errorAcceptDraw accepts a draw offer from the opponent
- OID
- 097bef…1678:26
AcceptDraw details
AcceptDrawInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:27
AcceptDrawInternal details
DeclineDraw
func(gameID int) .uverse.errorDeclineDraw declines a draw offer from the opponent
- OID
- 097bef…1678:28
DeclineDraw details
DeclineDrawInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:29
DeclineDrawInternal details
ProposeSettlement
func(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. ProposeSettlement 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
- 097bef…1678:30
ProposeSettlement details
ProposeSettlementInternal
func(caller .uverse.address, gameID int, movesUCI string) .uverse.error- OID
- 097bef…1678:31
ProposeSettlementInternal details
ConfirmSettlement
func(gameID int) .uverse.errorConfirmSettlement allows opponent to immediately approve final result without waiting for challenge window
- OID
- 097bef…1678:32
ConfirmSettlement details
ConfirmSettlementInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:33
ConfirmSettlementInternal details
FinalizeSettlement
func(gameID int) .uverse.errorFinalizeSettlement officially finalizes the game after the challenge period has passed
- OID
- 097bef…1678:34
FinalizeSettlement details
FinalizeSettlementInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:35
FinalizeSettlementInternal details
DisputeSettlement
func(gameID int) .uverse.errorDisputeSettlement allows opponent to dispute a fraudulent settlement proposal
- OID
- 097bef…1678:36
DisputeSettlement details
DisputeSettlementInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:37
DisputeSettlementInternal details
SettleGame
func(gameID int, movesUCI string) .uverse.errorSettleGame proposes settlement and finalizes immediately if challenge window is 0
- OID
- 097bef…1678:38
SettleGame details
SettleGameInternal
func(caller .uverse.address, gameID int, movesUCI string) .uverse.error- OID
- 097bef…1678:39
SettleGameInternal details
StartTurnTimer
func(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
- 097bef…1678:40
StartTurnTimer details
StartTurnTimerInternal
func(caller .uverse.address, gameID int, currentMovesUCI string) .uverse.error- OID
- 097bef…1678:41
StartTurnTimerInternal details
ClaimTimeout
func(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
- 097bef…1678:42
ClaimTimeout details
ClaimTimeoutInternal
func(caller .uverse.address, gameID int) .uverse.error- OID
- 097bef…1678:43
ClaimTimeoutInternal details
GetGamesCount
func() intGetGamesCount returns the total number of games
- OID
- 097bef…1678:44
GetGamesCount details
GetBoard
func(gameID int) [8][8]stringGetBoard returns the 8x8 board for a given game ID
- OID
- 097bef…1678:45
GetBoard details
GetWhitePlayer
func(gameID int) .uverse.address- OID
- 097bef…1678:46
GetWhitePlayer details
GetBlackPlayer
func(gameID int) .uverse.address- OID
- 097bef…1678:47
GetBlackPlayer details
IsWhiteTurn
func(gameID int) boolIsWhiteTurn returns whether it is White's turn for a given game ID
- OID
- 097bef…1678:48
IsWhiteTurn details
GetGameStatus
func(gameID int) stringGetGameStatus returns the game status for a given game ID
- OID
- 097bef…1678:49
GetGameStatus details
GetDrawOfferedBy
func(gameID int) .uverse.address- OID
- 097bef…1678:50
GetDrawOfferedBy details
GetResignedBy
func(gameID int) .uverse.address- OID
- 097bef…1678:51
GetResignedBy details
GetQueueCount
func() intGetQueueCount returns the number of players waiting in the matchmaking queue
- OID
- 097bef…1678:52
GetQueueCount details
IsInQueue
func(addr .uverse.address) boolIsInQueue checks if an address is currently waiting in the matchmaking queue
- OID
- 097bef…1678:53
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
- 097bef…1678:54
GetActiveGameForPlayer details
GetLatestGameForPlayer
func(addr .uverse.address) intGetLatestGameForPlayer returns the latest game ID involving the player, or -1 if none.
- OID
- 097bef…1678:55
GetLatestGameForPlayer details
GetSettledBy
func(gameID int) .uverse.address- OID
- 097bef…1678:56
GetSettledBy details
GetProposedBy
func(gameID int) .uverse.address- OID
- 097bef…1678:57
GetProposedBy details
GetPendingStatus
func(gameID int) stringGetPendingStatus returns the pending status of settlement
- OID
- 097bef…1678:58
GetPendingStatus details
GetChallengeDeadline
func(gameID int) int64GetChallengeDeadline returns the deadline unix timestamp for challenging settlement
- OID
- 097bef…1678:59
GetChallengeDeadline details
GetTurnDeadline
func(gameID int) int64GetTurnDeadline returns the deadline unix timestamp for turn timeout
- OID
- 097bef…1678:60
GetTurnDeadline details
GetTurnChallengedBy
func(gameID int) .uverse.address- OID
- 097bef…1678:61
GetTurnChallengedBy details
Render
func(path string) string- OID
- 097bef…1678:62
Render details
Game
typeGame represents an on-chain chess game session
Value
kewrchess_v2.Game
NewGame
func(id int, white .uverse.address, black .uverse.address) *kewrchess_v2.GameNewGame initializes a new game with the standard chess starting layout
- OID
- 097bef…1678:64