Skip to content

PokerToolsTexas Hold'em infrastructure that ships

Immutable engine, 17M+ hand/sec evaluator, typed SDK, scalable API and on-chain settlement โ€” one npm monorepo.

PokerTools

Why PokerTools โ€‹

Everything a real-money poker platform needs, in one versioned monorepo โ€” from the pure game logic to the blockchain settlement layer:

CapabilityHighlights
Rules correctnessTDA-43/47 raise rules, side pots, odd-chip distribution, rake caps, tournament blind structures, time banks
SecurityMasked public views (no hole cards or deck), SIWE auth, EIP-712 withdrawal intents, multi-RPC quorum, no-automatic-replacement signing
Financial integrityDouble-entry ledger, balanced settlement batches, tournament escrow, idempotent workers
PerformanceInteger lookup-table evaluator: ~17M hands/sec, zero-allocation hot path
DeploymentDocker Compose, GitHub Actions, GitHub Pages docs, npm provenance publishing

Quick start โ€‹

bash
git clone https://github.com/aaurelions/pokertools.git
cd pokertools
npm install
npm run build
npm test                        # full monorepo suite
ts
import { evaluateStrings, getHandRank, HandRank } from "@pokertools/evaluator";

const board = ["Ts", "Jc", "Qd", "2h", "9s"];
const hero = ["As", "Kh"];

const rank = getHandRank(evaluateStrings([...board, ...hero]));
console.log(HandRank[rank]); // "Straight"
ts
import { PokerEngine } from "@pokertools/engine";
import { ActionType } from "@pokertools/types";

const engine = new PokerEngine({ smallBlind: 10, bigBlind: 20, maxPlayers: 3 });
[0, 1, 2].forEach((seat) => engine.sit(seat, `p${seat}`, `Player ${seat}`, 1000));
engine.deal();

engine.act({ type: ActionType.RAISE, playerId: "p0", amount: 60 });
engine.act({ type: ActionType.CALL, playerId: "p1" });
engine.act({ type: ActionType.FOLD, playerId: "p2" });
console.log(engine.state.street); // "FLOP"
ts
import { PokerClient } from "@pokertools/sdk";

const client = new PokerClient({ baseUrl: "https://api.example.com" });
const tables = await client.getTables();
console.log(tables);

Full examples

Every example above is expanded with tables and API references on its package page: engine ยท evaluator ยท sdk ยท api.

Packages โ€‹

PackageDescriptionPublished
@pokertools/typesDomain contracts, actions, DTOs, Zod schemasโœ… npm
@pokertools/evaluator5/6/7-card evaluation โ€” integer scores, zero depsโœ… npm
@pokertools/engineImmutable Texas Hold'em state machineโœ… npm
@pokertools/sdkHTTP + WebSocket client and React 19 hooksโœ… npm
@pokertools/apiFastify REST/WS API, PostgreSQL authority, Redis coordination, BullMQ, Prisma๐Ÿณ Docker
@pokertools/custodyIsolated withdrawal signer and reconciliation๐Ÿณ Docker
@pokertools/benchEvaluator/API/worker/socket benchmarkslocal
@pokertools/e2eDocker + Anvil end-to-end scenarioslocal

Explore the docs โ€‹

SectionWhat you'll find
Getting StartedRequirements, install, scripts, first steps per package
ArchitectureComponent map, hand lifecycle, concurrency model, security
Testing & CoverageRunners, coverage gates, acceptance prerequisites, CI wiring
DeploymentDocker production, GitHub Actions, backups, release checklist

Project stats โ€‹

MetricValue
Workspaces8 npm packages
Evaluator throughput~17M hands/sec
LanguageTypeScript 6.0, Solidity 0.8
LicenseMIT

Released under the MIT License.