In brief
An animated demo is not a wallet-integrated game. The frontend must authenticate a valid session, use the server's allowed configuration, request a round, present its result and finish or recover that round correctly. Test this in staging without hardcoded credentials.
- Keep payout multipliers, wallet integers and display values separate.
- Never substitute a local random result for a failed server call.
- Do not blindly repeat a bet after an ambiguous network failure.
Read the launch context
The official RGS specification describes launch parameters including sessionID, lang, device and rgs_url. The RGS address comes from the launch context rather than a permanently hardcoded production endpoint.
Treat a session URL as sensitive. Do not include it in a public screenshot, analytics payload, bug report or repository. When someone reports a problem, request a redacted reproduction and a non-sensitive build identifier instead.
Keep the SDK's established URL handling unless a reviewed integration requirement calls for a change. Do not trust arbitrary copied URLs as production configuration or disable transport/security checks to make a demo connect.
The round lifecycle
Launch context → authenticate → apply allowed configuration
↓
recover active round, if any
↓
accept one bet action
↓
request round → present returned events
↓
settle/end as required → ready
This is a conceptual flow, not a replacement API implementation. Account for modes that close automatically and those requiring an explicit completion call; retain the SDK's round-state logic and confirm actual staging behavior.
The pinned request helpers use /wallet/authenticate, /wallet/play, /wallet/end-round and /bet/event. They already convert the bet amount at the request boundary. Passing a value that you have converted a second time can multiply the intended amount incorrectly.
Understand the money boundaries
Wallet amounts use integer units with six decimal places: 1,000,000 units represents one currency unit. This is different from the math book's hundredths-of-a-multiplier convention. Display formatting also varies by currency. The RGS specification defines the wallet representation and mode cost relationship.
For a base bet of 0.20 currency units and a mode costing 100 base bets, the displayed purchase cost is 20.00 currency units. Do not pass the already-multiplied 20.00 into a helper expecting the base bet if the server applies the mode cost. Test the actual helper contract with a known staging example.
Use explicit conversion functions and numeric-range checks. Preserve exact integers where needed; JavaScript numbers cannot safely represent every possible 64-bit integer. Do not solve precision issues by rounding arbitrary server values until they look plausible.
Apply authentication configuration
The reference Authenticate component handles balance, bet levels, jurisdiction settings and a round to resume. A custom interface should preserve those responsibilities.
Do not display a purchase button for a mode that is unavailable, or ignore returned restrictions because the training UI once allowed it. If a jurisdiction disables a feature, both the visible control and the underlying action must respect that setting.
An active round and the last completed round are not interchangeable. After refresh, reconstruct the correct presentation state from the returned round and progress information. Do not invent a fresh bonus just because the previous animation was interrupted.
Test the failures deliberately
| Scenario | Expected product behavior |
|---|---|
| Invalid or expired session | Clear error; no pretend balance or gameplay |
| Insufficient balance | Explain the failure; no winning animation |
| Rapid double click | At most one valid in-flight bet action |
| Network loss after request | Reconcile server state before another bet |
| Refresh during bonus | Recover the existing round correctly |
| Tab hidden during sound | Resume without duplicate loops or stale overlays |
These are engineering test expectations, not a claim that retries are safe on every endpoint. A timeout can happen after the server has accepted an operation. Blindly sending another play request risks creating another bet rather than completing the first one.
When an error is logged, retain its category and a safe diagnostic identifier, not the full session payload. Keep test instrumentation separate from the final bundle.
Finish this part
Produce a staging recording of an ordinary round and a recovered interrupted round. Confirm the balance and final payout against the server response. Only then describe the game as integrated; “it spins locally” is a different milestone.
