/** * High-level client for Stake Engine RGS API operations * * @description * This module provides convenient methods for all RGS API operations including * authentication, betting, balance checking, and game events. All methods * include automatic amount conversion and type safety. */ import type { paths, components } from './types'; type PathsWithPost = { [K in keyof paths]: paths[K] extends { post: unknown; } ? K : never; }[keyof paths]; /** * Type-safe RGS API client with automatic response parsing */ export declare class StakeEngineClient { /** * Make a POST request to the RGS API * * @param options - Request configuration * @returns Typed response data */ post(options: { url: T; rgsUrl: string; variables?: paths[T]['post']['requestBody']['content']['application/json']; }): Promise; /** * Make a GET request to the RGS API * * @param options - Request configuration * @returns Typed response data */ get(options: { url: T; rgsUrl: string; }): Promise; } /** * Default client instance for convenience */ export declare const stakeEngineClient: StakeEngineClient; /** * Get replay-specific URL parameters * @returns Object with replay mode flag and parameters */ export declare const getReplayUrlParams: () => { replay: boolean; amount: number; game: string; version: string; mode: string; event: string; }; /** * Check if current session is in replay mode * @returns true if replay=true is in URL params */ export declare const isReplayMode: () => boolean; /** * Authenticate a player session with the RGS * * @param options - Authentication parameters * @returns Authentication response with balance, config, and active round info * * @example * ```typescript * const auth = await requestAuthenticate({ * sessionID: 'player-session-123', * rgsUrl: 'api.stakeengine.com', * language: 'en' * }); * * console.log('Player balance:', auth.balance?.amount); * console.log('Available bet levels:', auth.config?.betLevels); * ``` */ export declare const authenticate: (options?: { sessionID?: string; rgsUrl?: string; language?: string; }) => Promise; /** * Play a round (place a bet and start a new round) * * @param options - Play parameters * @returns Play response with round details, balance, and game state * * @example * ```typescript * const play = await requestPlay({ * amount: 1.00, // $1.00 (automatically converted to API format) * mode: 'base' * // sessionID, currency, rgsUrl from URL params if not provided * }); * * console.log('Round ID:', play.round?.roundID); * console.log('Payout multiplier:', play.round?.payoutMultiplier); * console.log('New balance:', play.balance?.amount); * ``` */ export declare const play: (options: { amount: number; mode: string; currency?: string; sessionID?: string; rgsUrl?: string; }) => Promise; /** * @deprecated Use `play` instead. This function will be removed in a future version. * * Place a bet and start a new round * * @param options - Bet parameters * @returns Bet response with round details, balance, and game state */ export declare const requestBet: (options: { amount: number; mode: string; currency?: string; sessionID?: string; rgsUrl?: string; }) => Promise; /** * End the current betting round * * @param options - End round parameters * @returns Response with updated balance and status * * @example * ```typescript * const result = await requestEndRound({ * sessionID: 'player-session-123', * rgsUrl: 'api.stakeengine.com' * }); * * if (result.status?.statusCode === 'SUCCESS') { * console.log('Round ended successfully'); * } * ``` */ export declare const endRound: (options?: { sessionID?: string; rgsUrl?: string; }) => Promise; /** * Track a game event (for bet progress tracking) * * @param options - Event parameters * @returns Event response with confirmation * * @example * ```typescript * const result = await requestEndEvent({ * sessionID: 'player-session-123', * eventIndex: 1, * rgsUrl: 'api.stakeengine.com' * }); * ``` */ export declare const endEvent: (options: { eventIndex: number; sessionID?: string; rgsUrl?: string; }) => Promise; /** * Search for specific game results (for testing/debugging) * * @param options - Search parameters * @returns Search results with matching rounds * * @example * ```typescript * const results = await requestForceResult({ * mode: 'base', * search: { * bookID: 42, * kind: 1, * symbol: 'BONUS' * }, * rgsUrl: 'api.stakeengine.com' * }); * ``` */ export declare const forceResult: (options: { mode: string; search: { bookID?: number; kind?: number; symbol?: string; hasWild?: boolean; wildMult?: number; gameType?: string; }; rgsUrl?: string; }) => Promise; /** * Get current player balance * * @param options - Balance request parameters * @returns Current balance information * * @example * ```typescript * const balance = await requestBalance({ * sessionID: 'player-session-123', * rgsUrl: 'api.stakeengine.com' * }); * * console.log('Current balance:', balance.balance?.amount, balance.balance?.currency); * ``` */ export declare const getBalance: (options?: { sessionID?: string; rgsUrl?: string; }) => Promise; /** * Replay a historical bet * * @param options - Replay parameters * @returns Replay response with payout multiplier and game state * * @example * ```typescript * const replay = await requestReplay({ * game: 'slots-adventure', * version: '1.0.0', * mode: 'base', * event: 'abc123', * rgsUrl: 'api.stakeengine.com' * }); * * console.log('Payout multiplier:', replay.payoutMultiplier); // 2.5 * console.log('Game state:', replay.state); // Array of game events * ``` */ export declare const replay: (options: { game: string; version: string; mode: string; event: string; rgsUrl?: string; }) => Promise; /** * @deprecated Use `authenticate` instead * @see authenticate */ export declare const requestAuthenticate: (options?: { sessionID?: string; rgsUrl?: string; language?: string; }) => Promise; /** * @deprecated Use `getBalance` instead * @see getBalance */ export declare const requestBalance: (options?: { sessionID?: string; rgsUrl?: string; }) => Promise; /** * @deprecated Use `endRound` instead * @see endRound */ export declare const requestEndRound: (options?: { sessionID?: string; rgsUrl?: string; }) => Promise; /** * @deprecated Use `endEvent` instead * @see endEvent */ export declare const requestEndEvent: (options: { eventIndex: number; sessionID?: string; rgsUrl?: string; }) => Promise; /** * @deprecated Use `forceResult` instead * @see forceResult */ export declare const requestForceResult: (options: { mode: string; search: { bookID?: number; kind?: number; symbol?: string; hasWild?: boolean; wildMult?: number; gameType?: string; }; rgsUrl?: string; }) => Promise; /** * @deprecated Use `replay` instead * @see replay */ export declare const requestReplay: (options: { game: string; version: string; mode: string; event: string; rgsUrl?: string; }) => Promise; export {}; //# sourceMappingURL=client.d.ts.map