Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

kewrchess_v2 state

Back to all declarations

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)
Open
OID
097bef…1678:5
getVerifiedCaller details

Inspect func

games

[]*kewrchess_v2.Game (len=5)

Stores all chess games permanently on the blockchain

Open
OID
097bef…1678:131
games details (len=5)

+5 more Inspect slice

nextGameID

int

Value

5

matchmakingQueue

[].uverse.address (len=0)

On-chain matchmaking queue (FIFO)

Open
OID
097bef…1678:130
Inspect slice

CreateGame

func(opponent .uverse.address) .uverse.error

CreateGame creates a new direct game challenge

Open
OID
097bef…1678:11
CreateGame details

Inspect func

CreateGameInternal

func(caller .uverse.address, opponent .uverse.address) .uverse.error
Open
OID
097bef…1678:12
CreateGameInternal details

Inspect func

JoinQueue

func() .uverse.error

JoinQueue 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.

Open
OID
097bef…1678:13
JoinQueue details

Inspect func

JoinQueueInternal

func(caller .uverse.address) .uverse.error
Open
OID
097bef…1678:14
JoinQueueInternal details

Inspect func

LeaveQueue

func() .uverse.error

LeaveQueue cancels and removes a player from the on-chain matchmaking queue

Open
OID
097bef…1678:15
LeaveQueue details

Inspect func

LeaveQueueInternal

func(caller .uverse.address) .uverse.error
Open
OID
097bef…1678:16
LeaveQueueInternal details

Inspect func

makeMoveInternal

func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error
Open
OID
097bef…1678:17
makeMoveInternal details

Inspect func

MakeMove

func(gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.error

MakeMove moves a piece (defaults to Queen on promotion)

Open
OID
097bef…1678:18
MakeMove details

Inspect func

MakeMoveInternal

func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.error
Open
OID
097bef…1678:19
MakeMoveInternal details

Inspect func

MakeMovePromote

func(gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error

MakeMovePromote moves a piece with a specified promotion piece (Q, R, B, N)

Open
OID
097bef…1678:20
MakeMovePromote details

Inspect func

MakeMovePromoteInternal

func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error
Open
OID
097bef…1678:21
MakeMovePromoteInternal details

Inspect func

Resign

func(gameID int) .uverse.error

Resign resigns the game for the calling player

Open
OID
097bef…1678:22
Resign details

Inspect func

ResignInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:23
ResignInternal details

Inspect func

OfferDraw

func(gameID int) .uverse.error

OfferDraw offers a draw to the opponent

Open
OID
097bef…1678:24
OfferDraw details

Inspect func

OfferDrawInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:25
OfferDrawInternal details

Inspect func

AcceptDraw

func(gameID int) .uverse.error

AcceptDraw accepts a draw offer from the opponent

Open
OID
097bef…1678:26
AcceptDraw details

Inspect func

AcceptDrawInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:27
AcceptDrawInternal details

Inspect func

DeclineDraw

func(gameID int) .uverse.error

DeclineDraw declines a draw offer from the opponent

Open
OID
097bef…1678:28
DeclineDraw details

Inspect func

DeclineDrawInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:29
DeclineDrawInternal details

Inspect func

ProposeSettlement

func(gameID int, movesUCI string) .uverse.error

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. 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.

Open
OID
097bef…1678:30
ProposeSettlement details

Inspect func

ProposeSettlementInternal

func(caller .uverse.address, gameID int, movesUCI string) .uverse.error
Open
OID
097bef…1678:31
ProposeSettlementInternal details

Inspect func

ConfirmSettlement

func(gameID int) .uverse.error

ConfirmSettlement allows opponent to immediately approve final result without waiting for challenge window

Open
OID
097bef…1678:32
ConfirmSettlement details

Inspect func

ConfirmSettlementInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:33
ConfirmSettlementInternal details

Inspect func

FinalizeSettlement

func(gameID int) .uverse.error

FinalizeSettlement officially finalizes the game after the challenge period has passed

Open
OID
097bef…1678:34
FinalizeSettlement details

Inspect func

FinalizeSettlementInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:35
FinalizeSettlementInternal details

Inspect func

DisputeSettlement

func(gameID int) .uverse.error

DisputeSettlement allows opponent to dispute a fraudulent settlement proposal

Open
OID
097bef…1678:36
DisputeSettlement details

Inspect func

DisputeSettlementInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:37
DisputeSettlementInternal details

Inspect func

SettleGame

func(gameID int, movesUCI string) .uverse.error

SettleGame proposes settlement and finalizes immediately if challenge window is 0

Open
OID
097bef…1678:38
SettleGame details

Inspect func

SettleGameInternal

func(caller .uverse.address, gameID int, movesUCI string) .uverse.error
Open
OID
097bef…1678:39
SettleGameInternal details

Inspect func

StartTurnTimer

func(gameID int, currentMovesUCI string) .uverse.error

StartTurnTimer 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.

Open
OID
097bef…1678:40
StartTurnTimer details

Inspect func

StartTurnTimerInternal

func(caller .uverse.address, gameID int, currentMovesUCI string) .uverse.error
Open
OID
097bef…1678:41
StartTurnTimerInternal details

Inspect func

ClaimTimeout

func(gameID int) .uverse.error

ClaimTimeout 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.

Open
OID
097bef…1678:42
ClaimTimeout details

Inspect func

ClaimTimeoutInternal

func(caller .uverse.address, gameID int) .uverse.error
Open
OID
097bef…1678:43
ClaimTimeoutInternal details

Inspect func

GetGamesCount

func() int

GetGamesCount returns the total number of games

Open
OID
097bef…1678:44
GetGamesCount details

Inspect func

GetBoard

func(gameID int) [8][8]string

GetBoard returns the 8x8 board for a given game ID

Open
OID
097bef…1678:45
GetBoard details

Inspect func

GetWhitePlayer

func(gameID int) .uverse.address
Open
OID
097bef…1678:46
GetWhitePlayer details

Inspect func

GetBlackPlayer

func(gameID int) .uverse.address
Open
OID
097bef…1678:47
GetBlackPlayer details

Inspect func

IsWhiteTurn

func(gameID int) bool

IsWhiteTurn returns whether it is White's turn for a given game ID

Open
OID
097bef…1678:48
IsWhiteTurn details

Inspect func

GetGameStatus

func(gameID int) string

GetGameStatus returns the game status for a given game ID

Open
OID
097bef…1678:49
GetGameStatus details

Inspect func

GetDrawOfferedBy

func(gameID int) .uverse.address
Open
OID
097bef…1678:50
GetDrawOfferedBy details

Inspect func

GetResignedBy

func(gameID int) .uverse.address
Open
OID
097bef…1678:51
GetResignedBy details

Inspect func

GetQueueCount

func() int

GetQueueCount returns the number of players waiting in the matchmaking queue

Open
OID
097bef…1678:52
GetQueueCount details

Inspect func

IsInQueue

func(addr .uverse.address) bool

IsInQueue checks if an address is currently waiting in the matchmaking queue

Open
OID
097bef…1678:53
IsInQueue details

Inspect func

GetActiveGameForPlayer

func(addr .uverse.address) int

GetActiveGameForPlayer searches for the latest active game ("PLAYING") for a given address. Returns -1 if no active game found.

Open
OID
097bef…1678:54
GetActiveGameForPlayer details

Inspect func

GetLatestGameForPlayer

func(addr .uverse.address) int

GetLatestGameForPlayer returns the latest game ID involving the player, or -1 if none.

Open
OID
097bef…1678:55
GetLatestGameForPlayer details

Inspect func

GetSettledBy

func(gameID int) .uverse.address
Open
OID
097bef…1678:56
GetSettledBy details

Inspect func

GetProposedBy

func(gameID int) .uverse.address
Open
OID
097bef…1678:57
GetProposedBy details

Inspect func

GetPendingStatus

func(gameID int) string

GetPendingStatus returns the pending status of settlement

Open
OID
097bef…1678:58
GetPendingStatus details

Inspect func

GetChallengeDeadline

func(gameID int) int64

GetChallengeDeadline returns the deadline unix timestamp for challenging settlement

Open
OID
097bef…1678:59
GetChallengeDeadline details

Inspect func

GetTurnDeadline

func(gameID int) int64

GetTurnDeadline returns the deadline unix timestamp for turn timeout

Open
OID
097bef…1678:60
GetTurnDeadline details

Inspect func

GetTurnChallengedBy

func(gameID int) .uverse.address
Open
OID
097bef…1678:61
GetTurnChallengedBy details

Inspect func

Game

type

Game represents an on-chain chess game session

Value

kewrchess_v2.Game

NewGame

func(id int, white .uverse.address, black .uverse.address) *kewrchess_v2.Game

NewGame initializes a new game with the standard chess starting layout

Open
OID
097bef…1678:64
NewGame details

Inspect func
ChallengeWindowSeconds : int64 =180
TurnTimeoutSeconds : int64 =120
getVerifiedCaller : func(caller .uverse.address) (.uverse.address, .uverse.error) Inspect
games : []*kewrchess_v2.Game (len=5) Inspect
nextGameID : int =5
matchmakingQueue : [].uverse.address
init.6 : func() Inspect
CreateGame : func(opponent .uverse.address) .uverse.error Inspect
CreateGameInternal : func(caller .uverse.address, opponent .uverse.address) .uverse.error Inspect
JoinQueue : func() .uverse.error Inspect
JoinQueueInternal : func(caller .uverse.address) .uverse.error Inspect
LeaveQueue : func() .uverse.error Inspect
LeaveQueueInternal : func(caller .uverse.address) .uverse.error Inspect
makeMoveInternal : func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error Inspect
MakeMove : func(gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.error Inspect
MakeMoveInternal : func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int) .uverse.error Inspect
MakeMovePromote : func(gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error Inspect
MakeMovePromoteInternal : func(caller .uverse.address, gameID int, fromRow int, fromCol int, toRow int, toCol int, promoPiece string) .uverse.error Inspect
Resign : func(gameID int) .uverse.error Inspect
ResignInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
OfferDraw : func(gameID int) .uverse.error Inspect
OfferDrawInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
AcceptDraw : func(gameID int) .uverse.error Inspect
AcceptDrawInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
DeclineDraw : func(gameID int) .uverse.error Inspect
DeclineDrawInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
ProposeSettlement : func(gameID int, movesUCI string) .uverse.error Inspect
ProposeSettlementInternal : func(caller .uverse.address, gameID int, movesUCI string) .uverse.error Inspect
ConfirmSettlement : func(gameID int) .uverse.error Inspect
ConfirmSettlementInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
FinalizeSettlement : func(gameID int) .uverse.error Inspect
FinalizeSettlementInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
DisputeSettlement : func(gameID int) .uverse.error Inspect
DisputeSettlementInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
SettleGame : func(gameID int, movesUCI string) .uverse.error Inspect
SettleGameInternal : func(caller .uverse.address, gameID int, movesUCI string) .uverse.error Inspect
StartTurnTimer : func(gameID int, currentMovesUCI string) .uverse.error Inspect
StartTurnTimerInternal : func(caller .uverse.address, gameID int, currentMovesUCI string) .uverse.error Inspect
ClaimTimeout : func(gameID int) .uverse.error Inspect
ClaimTimeoutInternal : func(caller .uverse.address, gameID int) .uverse.error Inspect
GetGamesCount : func() int Inspect
GetBoard : func(gameID int) [8][8]string Inspect
GetWhitePlayer : func(gameID int) .uverse.address Inspect
GetBlackPlayer : func(gameID int) .uverse.address Inspect
IsWhiteTurn : func(gameID int) bool Inspect
GetGameStatus : func(gameID int) string Inspect
GetDrawOfferedBy : func(gameID int) .uverse.address Inspect
GetResignedBy : func(gameID int) .uverse.address Inspect
GetQueueCount : func() int Inspect
IsInQueue : func(addr .uverse.address) bool Inspect
GetActiveGameForPlayer : func(addr .uverse.address) int Inspect
GetLatestGameForPlayer : func(addr .uverse.address) int Inspect
GetSettledBy : func(gameID int) .uverse.address Inspect
GetProposedBy : func(gameID int) .uverse.address Inspect
GetPendingStatus : func(gameID int) string Inspect
GetChallengeDeadline : func(gameID int) int64 Inspect
GetTurnDeadline : func(gameID int) int64 Inspect
GetTurnChallengedBy : func(gameID int) .uverse.address Inspect
Render : func(path string) string Inspect
Game : type =kewrchess_v2.Game
NewGame : func(id int, white .uverse.address, black .uverse.address) *kewrchess_v2.Game Inspect