func Accept
crossing ActionAccept agrees with the result; when all hand players accept, the hand is finalized without waiting for the window.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package poker is a trustless no-limit Texas Hold'em realm. See docs/protocol.md for the normative protocol and API.
Package poker is a trustless no-limit Texas Hold'em realm. See docs/protocol.md for the normative protocol and API.
Accept agrees with the result; when all hand players accept, the hand is finalized without waiting for the window.
Act applies a betting action by the player to act.
1func Challenge(cur realm, tableID, handNo uint64, accused int, kind string, index int, inB64, inProofHex, outB64, outProofHex string)Challenge disputes one element of a shuffle or rekey pass during the challenge window (protocol.md section 5).
ChallengesEnabled reports whether this deployment accepts challenges.
1func CreateTable(cur realm, smallBlind, bigBlind, minBuyIn, maxBuyIn int64, maxPlayers int, actionTimeoutBlocks, challengeWindowBlocks, challengeBond int64) uint64CreateTable creates a table and returns its id.
Finalize settles the hand once the challenge window has passed.
GetDeck returns the latest deck pass of the current hand as standard base64, or "" before the first pass.
GetTable returns the full table and hand state as JSON.
Join takes a free seat with the attached ugnot minus gasAllowance as stack and forwards gasAllowance to the session address.
Leave pays out the stack, or marks the seat leaving until the hand ends.
ListTables returns a JSON array of table summaries.
Render shows the newest renderMaxTables tables, or one table at path "<id>".
RevealSeed opens the caller's seed; published card keys are checked at once.
ShareKeys publishes the caller's card keys for the current deal step.
SitIn makes the caller eligible again from the next hand.
SitOut skips the caller from the next hand on.
StartHand moves the button, posts blinds and opens the shuffle.
SubmitRekey records the caller's re-keyed deck.
SubmitShuffle records the caller's commitment and shuffled deck.
Timeout applies the stall rules once the current deadline has passed.
TopUp adds the attached ugnot to the caller's stack between hands.
ChallengeRecord is one resolved challenge.
1type Hand struct {
2 No uint64
3 Phase int
4 Players []*HandPlayer
5 Bet *holdem.Betting
6 Roots []string // hex root per accepted deck pass
7 Owing []bool // per player, for deal steps
8 Deadline int64
9 Cards []int // official card per position, after reveal
10 Result *Result
11 Settled bool // contributions have been paid out or refunded
12}Hand is the state of the current or last hand of a table.
HandPlayer is a seat's participation in one hand.
Result is the outcome of a hand. Credits are what settlement adds to each hand player's stack (winnings, or refund plus penalty share on abort).
Seat is an occupied table seat.
1type Table struct {
2 ID uint64
3 SmallBlind int64
4 BigBlind int64
5 MinBuyIn int64
6 MaxBuyIn int64
7 MaxPlayers int
8 ActionTimeout int64
9 ChallengeWindow int64
10 ChallengeBond int64
11
12 Seats []*Seat
13 Button int // seat index of the last button, -1 before the first hand
14 HandNo uint64
15 Hand *Hand
16 Deck string // raw bytes of the latest deck pass of hand DeckHand
17 DeckHand uint64
18}Table is a persistent cash table.