The core loop
- Discover — resolve
chainIdand contract addresses fromnetworkConfigs. Once, at startup. - Place — build mode args, read
currentCommitId(), send the place transaction. See Placing bets. - Result — the API watches the chain, computes the outcome, and pushes it (with a ZK proof when available) over the socket. See Results & proofs.
- Claim — winners claim on-chain, choosing USDG or CHANCE. See Claiming.
- History — back-fill and paginate a wallet’s bets from
playerBets.
Trust model
The API is a convenience layer, not an authority. Results it pushes are display-only until the on-chain settle — payouts only ever derive from entropy the contract verified (revealed seed or ZK proof). If the API disappeared entirely, every pending bet could still be settled and claimed permissionlessly. Details in Provably fair.All public API surfaces are unauthenticated. There are no API keys for the queries and socket channels documented here.