Skip to content

Wallet

Round lifecycle

How a round moves through bet, win and refund, and how retries work.

A round
play       bet leg, sent once, synchronously
             ok        -> round open; a round that pays nothing is closed at once with a zero win leg
             declined  -> round void, player sees insufficient balance
             refused   -> round void
             unknown   -> round void, refund leg queued for the same amount (refunds a bet you may have applied;
                          a refund for a bet you never saw must answer 200 and change nothing)
end-round  win leg for the payout (once per round), sent now and retried until applied
  1. 1A win or refund that is not applied is retried with the same transaction_id after 2, 4, 8… seconds, capped at 5 minutes, for 24 hours; then it is marked stuck and logged at error level.
  2. 2A send holds a 30 s lease with a token, so two senders never send the same leg at once and a late answer cannot overwrite a newer one. A player's own retry resends at most once a second.
  3. 3The client calls end-round when the run's animation ends. If the player leaves, the server sends the win itself 10 minutes after the bet. While a win is unconfirmed the round stays live and the client resumes it.
  4. 4A bet that never reached the wallet because our process stopped between storing and sending is refunded after one minute.
  5. 5One live round per session: a second play before the first one is settled is refused.
  6. 6Every round is closed by a win leg with round_final: true, also when it pays 0, so your final-round signal is uniform. Tell us if you prefer no zero legs.