@octane-rgs/instant
v1.3.1
Published
Instant-resolution game SDK for Octane RGS — playRound, gameAction
Readme
@octane-rgs/instant
SDK for instant-resolution games on Octane RGS. Handles sessions, play-round, multi-step game actions, and queries.
Install
npm install @octane-rgs/instantQuick Start
import { OctaneInstantClient } from "@octane-rgs/instant";
const rgs = new OctaneInstantClient({
baseUrl: "https://staging.octanestudios.ai",
apiKey: "your-api-key",
});
const { sessionToken } = await rgs.launch({
externalPlayerId: "player-123",
tableSessionId: crypto.randomUUID(),
tableGameCode: "dice",
currency: "USD",
});
// Play a round — places bet, runs the local instant module, settles if resolved
const { roundId, remainingBalance, gameResult } = await rgs.playRound({
sessionToken,
bets: [{ betOption: "over-50", amount: 500 }],
requestId: crypto.randomUUID(),
});
// remainingBalance reflects post-settlement balance when the game resolves immediately
// For multi-action games (blackjack, gamble features):
const actionResult = await rgs.gameAction({
sessionToken,
roundId,
action: "hit",
});
// When the game resolves, the action response includes the settlementAPI
Sessions
| Method | Description |
|--------|-------------|
| launch(params, apiKey?) | Create a player session |
| operatorInfo(apiKey) | Get operator details and bet config |
| getBalance(sessionToken) | Get player balance from operator wallet |
| getPlayerSession(sessionToken) | Get session details |
| redeemLaunch({ sessionToken }) | Single-use exchange of a launch URL token for the session; throws LaunchRedeemError (LAUNCH_ALREADY_REDEEMED, LAUNCH_EXPIRED) |
| markStarted(sessionToken) | Mark session as started |
| realityCheck(sessionToken) | Session duration, total wagered, net position |
Table Sessions
| Method | Description |
|--------|-------------|
| upsertTable(params) | Create or update a table session |
| endTable(tableSessionId, endedAt) | End a table session |
| getTableSession(tableSessionId) | Get table session details |
| lobbies(publicOnly?) | List active table sessions |
| activeByGame(gameCode) | Find active table by game code |
| activeByTableCode(tableCode) | Find active table by table code |
| activeByAvatar(slug) | Deprecated: use activeByTableCode |
| activeByAvatarGame(avatarName, gameName) | Find active table by avatar + game |
| updateRoomStates(params) | Batch update room states (active/dormant) |
| cleanup(params) | Find and mark stale sessions as dead |
Game Play
| Method | Description |
|--------|-------------|
| playRound(params) | Place bet, run the instant game module, auto-settle if multipliers returned |
| gameAction(params) | Send a game action for multi-step games — auto-settles when multipliers returned |
Queries
| Method | Description |
|--------|-------------|
| roundWinners(roundId) | Get winners for a round |
| lastPayout(sessionToken) | Get last payout amount |
| betStatistics(roundId, sides) | Get bet distribution stats |
| playerHistory(sessionToken, limit?, offset?) | Get player bet/payout history |
| roundHistory(tableSessionId, limit?) | Get round history for a table |
Free Rounds
| Method | Description |
|--------|-------------|
| getFreeRounds(playerId, gameCode?) | Get active free round grant |
Self-Exclusion
| Method | Description |
|--------|-------------|
| excludePlayer(params) | Self-exclude a player for a duration |
| getExclusionStatus(externalPlayerId) | Check exclusion status |
Changes
- 1.3.0: core 1.3.0.
redeemLaunch({ sessionToken })andLaunchRedeemErrorfor single-use, time-boxed launch tokens. - 1.2.0 (breaking): core 1.2.0.
roundWinnersentries androundDetailsplayers replaceplayerSessionIdwithplayerRef, a stable pseudonym. The session id is the player'ssessionToken, a bearer credential, so it is no longer returned by query endpoints. - 1.1.0:
remainingBalanceis now optional on play results (omitted when the wallet confirmed the debit but its balance could not be read; refresh the balance), and balance fields may benull.
