@octane-rgs/fairness
v1.0.27
Published
Provably fair RNG and audit tooling for Octane RGS
Readme
@octane-rgs/fairness
Client for the RGS's provably fair RNG endpoints (fetch values, reveal a seed), the round helpers an external live game server needs (settle, store outcome), and the verification functions re-exported from @octane-rgs/rng.
Install
npm install @octane-rgs/fairnessExample
import { OctaneFairnessClient } from "@octane-rgs/fairness";
const rgs = new OctaneFairnessClient({ baseUrl: process.env.RGS_URL!, apiKey: process.env.RGS_API_KEY! });
const { values } = await rgs.fetchRng({ roundId, count: 6 });
await rgs.updateRoundOutcome(roundId, { grid: [[1, 2, 3]], winLines: [0] });
await rgs.settle({
roundId,
gameType: "roulette",
closeRound: true,
multipliers: [{ betOption: "red", multiplier: 2 }],
});API
OctaneFairnessClient (errors are RgsError with status):
| Method | Description |
|--------|-------------|
| fetchRng(params) | Provably fair random values scoped by sessionToken and/or roundId |
| revealSeed(params) | Reveal the server seed for verification |
| updateRoundOutcome(roundId, data) | Store game outcome data on a round |
| settle(params) | Settle a round with integer multipliers |
Re-exported from @octane-rgs/rng: createFloatGenerator, verify, hashSeed and the Seed, FloatGenerator and VerifyResult types.
