Skip to main content
After you place, the API tracks the bet on-chain, computes the outcome from the epoch seed, attempts a Groth16 entropy proof, and pushes everything to subscribers. Socket first, poll as fallback.

Realtime (preferred)

TypeScript
Subscriptions are per-wallet and unauthenticated (results and proofs are public data; the server seed is never sent). Exact event contracts: Socket.IO — bets.

Poll fallback

If you can’t hold a socket open, poll betResult (single) or betResults (batch, max 25 ids) — same payload shape. See GraphQL — betResult.

The update payload

Key fields of a bets:update (integers are decimal strings):

Handling proof: null

The API always attempts a proof, but delivers the result either way. When proof is null:
  • Treat the result as optimistic display only — you cannot claimWithProof yet.
  • Wait for the epoch to close and the seed to reveal, then use plain claim (it settles from the revealed seed and claims in one transaction), or keep polling betResult.
Never treat an API result as a paid outcome. The paid truth is the on-chain settle — show optimistic UI if you like, but gate balance changes on settled / claimed. Treat settled and claimed as terminal: ignore any later pending / computed update for the same betId (delivery order isn’t guaranteed).

Onward

  • Claiming — turning a won result into a payout
  • Provably fair — verifying entropy against the commitment yourself