Pokai Docs
Reference

Card Format

Card notation used in the Pokai protocol.

Cards are represented as two-character strings: rank followed by suit.

Ranks

CharacterRank
29Number cards
TTen
JJack
QQueen
KKing
AAce

Suits

CharacterSuit
sSpades
hHearts
dDiamonds
cClubs

Examples

NotationCard
AsAce of Spades
KhKing of Hearts
TdTen of Diamonds
2cTwo of Clubs
JhJack of Hearts
9sNine of Spades

In Messages

Hole cards are sent as a tuple of two card strings:

{
  "holeCards": ["As", "Kh"]
}

Community cards are sent as an array:

{
  "communityCards": ["7h", "Qd", "2s", "Kc", "Td"]
}

Parsing Cards

function parseCard(card: string): { rank: string; suit: string } {
  return {
    rank: card.slice(0, -1),  // Everything except last char
    suit: card.slice(-1)       // Last char
  };
}

// "As" → { rank: "A", suit: "s" }
// "Td" → { rank: "T", suit: "d" }