RuneCode RGS: integration guide

This guide is for the engineers of an operator (a casino or lobby that shows our games to its players) or an aggregator (a platform that fronts many operators) who want to offer RuneCode games. It describes the integration as it works, the SDKs that implement it, and what is live today versus what is still planned.

If you already integrate games through Stake Engine, read Engine operators first: the operator API and the wallet contract are the same, and moving over is mostly configuration.

The model in one page

Two parties and one rule decide everything.

There are three surfaces, and you build two of them:

SurfaceDirectionYou buildWhere it is described
Operator APIyou → RGScalls to launch games and look rounds upLaunching games, Catalogue, Rounds and reconciliation
Wallet APIRGS → youfour endpoints on your side: balance, debit, credit, rollbackImplementing the wallet
Game APIplayer's browser → RGSnothing: our game front ends talk to it(internal; Engine-compatible)

Both directions are authenticated with Ed25519 signatures over the exact bytes of each request. You never share a secret: you give us your public key and we give you ours. See Authentication and signing.

What a round looks like

 your lobby                 RuneCode RGS                         your wallet
     │  POST /v1/game/url        │                                    │
     │  (signed, token T) ─────► │ stores T, mints a session          │
     │ ◄───── {url, fair} ───────│                                    │
     │  redirect the player      │                                    │
     │  to url (valid ~120 s)    │                                    │
     │                           │ player opens the game              │
     │                           │ ── POST /v1/balance {token:T} ───► │  (the session check)
     │                           │ ◄──────── {balance} ────────────── │
     │                           │ player spins                       │
     │                           │ ── POST /v1/debit  {round, id…} ─► │  stake taken
     │                           │ ◄──────── {debit_id, balance} ──── │
     │                           │ outcome drawn, round settles       │
     │                           │ ── POST /v1/credit {round, id…} ─► │  win paid (omitted for a loss)
     │                           │ ◄──────── {credit_id, balance} ─── │

The player's browser never sees your token: it only gets an RGS-minted session id inside a one-time, signed URL.

What you need

  1. An Ed25519 key pair for each environment (openssl genpkey -algorithm ed25519). Keep the private key; send the public key.
  2. A wallet endpoint, reachable by us, that implements four calls. We provide a reference wallet to start from.
  3. The list of lobby origins that will frame the games (we restrict framing to them).
  4. For production: licences per jurisdiction, and the onboarding steps in Testing and going live.

Where to go next