Data structures
API V2 data types
V2_TestPingRequestBody
export interface V2_TestPingRequestBody {
testData: unknown;
}
export interface V2_StartGameRoundRequestBody {
token: string;
rngResult: GameRNGResult;
debitInformation: DebitInformation;
creditInformation?: CreditInformation;
endGame: boolean;
closeOpenGame?: boolean;
useJackpot?: boolean;
betData?: BetData;
externalGameProviderRoundId?: string;
}V2_StartGameRoundRequestBody
Note: externalGameProviderRoundId is optional and if used must not exceed a length of more than 32 characters!
V2_EndGameRoundRequestBody
export interface V2_EndGameRoundRequestBody {
token: string;
gameRound: string;
}
export interface V2_GetGameRoundDetailsRequestBody {
token: string;
gameRound: string;
}
export interface V2_AddWinRequestBody {
token: string;
gameRound: string;
rngResult: GameRNGResult;
collect?: boolean;
externalGameProviderTransactionId?: string
jackpotPayout?: V2_JackpotPayout[]
}
export interface V2_WagerWinRoundRequestBody {
token: string;
gameRound: string;
rngResult: GameRNGResult;
wagerInformation: WagerInformation;
}
export interface V2_GetUncollectedAmountRequestBody {
token: string;
gameRound: string;
}
export interface V2_AddSpinCounterGameStateRequestBody {
token: string;
gameRound: string;
counterType: string;
rngResult: GameEventRNGResult;
gameStateResult: string | { [index: string]: unknown; };
}
export interface V2_GetAvailableSpinCounterRequestBody {
token: string;
gameRound: string;
counterType: string;
}
export interface V2_GetRandomResultRequestBody {
token: string;
rngEndPoint: string;
rngPayload: {
count?: number;
min?: number;
max: number;
};
}
export interface V2_GetTokenForGameRoundRequestBody {
gameRound: string;
}
export interface V2_GetTokenDataRequestBody {
token: string;
}
export interface V2_GameAPIReply {
tokenData: V2_GameToken,
balance?: {
totalBalance: number;
mode: string;
currency: string;
balances: {
type: string;
amount: number;
currency: string;
}[];
};
gameRoundInfo?: {
hash: string;
status: string;
stake: number;
mode: string;
currency: string;
game: string;
currencyMultiplier?: number;
};
gameState?: Array<V2_GameAPIGameState>;
amountToCollect?: number;
amountCredited?: number;
freePlayInfo?: {
used: number;
granted: number;
won: number;
isLast: boolean;
}
freePlaysAvailable?: {
currency: string;
stake: number;
count: number;
}[];
}
export interface V2_ConnectReply extends V2_GameAPIReply {
backendUrl: string;
refreshUrl: string;
logoutUrl: string;
token: string;
gameSettings: V2_GameSettings;
gameVariables: Partial<V2_GameVariables>;
tokenData: V2_GameToken;
// please contact support for available options
operatorProtocol: number;
}
export interface V2_CollectWinRoundRequestBody {
token: string;
gameRound: string;
collectInformation: CollectInformation;
}
export interface V2_GameAPIGetUncollectedAmountReply {
tokenData: V2_GameToken,
amountToCollect?: number;
}
export interface V2_GameAPIAddSpinCounterGameStateReply extends V2_GameAPIReply {
spinsAvailable: number;
}
export interface V2_GameAPIGetAvailableSpinCounterReply extends V2_GameAPIGetUncollectedAmountReply {
spinsAvailable: number;
}
export interface V2_GameAPIRngReply {
tokenData: V2_GameToken;
values: number[];
}
export interface V2_GetTokenForGameRoundReply {
tokenData: V2_GameToken,
}
export interface V2_GetTokenDataReply {
tokenData: V2_GameToken,
}
export interface GameAPIBalanceReply {
totalBalance: number;
mode: GameModes;
currency: string;
balances: BalanceEntry[];
discountInfo?: DiscountInfo;
tickets?: TicketEntry[];
ticketInfo?: TicketWonInfo;
}
export interface TicketEntry {
count: number;
stake: number;
currency: string;
price?: number;
feature?: string;
serial: string;
}
export interface TicketWonInfo {
used: number;
granted: number;
won: number;
isLast: boolean;
promotions?: {
protocolVersion: number;
data: unknown;
};
serial: string;
}
export interface GameRNGResult {
rngCallId: string;
result: unknown;
winAmount?: number;
}
export interface GameEventRNGResult {
rngCallId: string;
result: GameEventRNGResultCounter;
winAmount?: number;
}
export interface GameEventRNGResultCounter {
awarded?: number;
used?: number;
}
export interface DebitInformation extends GameTransaction {
debitAmount: number;
useTicketInfo?: UseTicketDebitInformation;
buyFeatureInfo?: BuyFeatureDebitInformation;
jackpotContribution?: V2_JackpotContribution[]
}
type GameTransactionStatus = 'success' | 'error' | 'retrying';
interface GameTransaction {
currency: string;
status?: GameTransactionStatus;
}
interface UseTicketDebitInformation {
useTicket: boolean;
featureType?: string;
}
interface BuyFeatureDebitInformation {
featureToBuy: string,
featurePrice: number;
featureResultSetSelected: number;
}
export interface CreditInformation extends GameTransaction {
creditAmount: number;
jackpotPayout?: V2_JackpotPayout[]
}
export interface CollectInformation extends GameTransaction {
creditAmount?: number;
jackpotPayout?: V2_JackpotPayout[]
}
export interface WagerInformation extends GameTransaction {
wagerAmount: number;
winAmount?: number;
jackpotPayout?: V2_JackpotPayout[]
}
export interface V2_GameToken {
operatorId: string;
playerId: string;
gameId: string;
mode: string;
currency: string;
currentToken?: string;
gameRound?: string; // this holds any open gameroundhash
walletMode: string;
language: string;
currencyMultiplier: number;
}
export interface V2_GameAPIGameState {
hash: string;
type: string;
processedOn?: Date;
result?: {
winAmount?: number;
info: Record<string, unknown>;
};
amountWagered?: number;
collected?: number;
reason?: string;
}
export interface V2_GetLastGamesRequestBody {
token: string;
maxRecords?: number; // default is 50
maxDays?: number; // default is 30
}
export interface V2_GetLastGamesReply {
gameRoundList: Record<string, unknown>[];
}
export interface V2_GetOperatorSettingsQuery {
game: string;
operator: string;
currency: string;
}
export interface V2_VoidGameRoundRequestBody {
gameRound: string;
token: string
}V2_GetGameRoundDetailsRequestBody
V2_AddWinRequestBody
V2_WagerWinRoundRequestBody
V2_GetUncollectedAmountRequestBody
V2_AddSpinCounterGameStateRequestBody
V2_GetAvailableSpinCounterRequestBody
V2_GetRandomResultRequestBody
V2_GetTokenForGameRoundRequestBody
V2_GetTokenDataRequestBody
V2_GameAPIReply
V2_ConnectReply
V2_CollectWinRoundRequestBody
V2_GameAPIGetUncollectedAmountReply
V2_GameAPIAddSpinCounterGameStateReply
V2_GameAPIGetAvailableSpinCounterReply
V2_GameAPIRngReply
V2_GetTokenForGameRoundReply
V2_GetTokenDataReply
---
GameAPIBalanceReply
TicketEntry
TicketWonInfo
GameRNGResult
GameEventRNGResult
DebitInformation
CreditInformation
CollectInformation
WagerInformation
V2_GameToken
V2_GameAPIGameState
V2_GetLastGamesRequestBody
V2_GetLastGamesReply
V2_GetOperatorSettingsQuery
V2_VoidGameRoundRequestBody
Additional data types used in responses to frontend
These structures are sent in response to connect requests sent by frontend during game startup (GET V2_API_ENDPOINT/connect)
V2_GameSettings
export declare enum V2_ForcedOrientation {
none = 0,
landscape = 1,
portrait = 2
}
export interface V2_GameSettings {
autoplayEnabled: boolean;
autoplayLossLimitRequired: boolean;
displayCoins: boolean;
displayJackpotOdds: boolean;
displayRTP: boolean;
displayXRTP: boolean;
forceOrientation: V2_ForcedOrientation;
gambleEnabled: boolean;
historyURL: string;
homeURL: string;
loadMsg: string;
maxExposure?: number;
maxStake?: number;
maxPackageStake?: number;
minStake?: number;
minLoadTime?: number;
minSpinTime?: number;
multipleInstancesAllowed: boolean;
rcDisplayWinLoss: boolean;
rcEnabled: boolean;
rcInterval?: number;
stopEnabled: boolean;
topupURL: string;
turboEnabled: boolean;
homeEnabled: boolean;
dynamicMinSpinTime: boolean;
redirectTarget: 'self' | 'parent' | 'top';
packageBuyEnabled: boolean;
defaultStakeIndex?: number;
}
export interface V2_GameVariables {
rcElapsed: number;
}V2_GameVariables
V2_JackpotMode
export enum JackpotMode {
ENGINE = 'engine',
VENDOR = 'vendor'
}
V2_JackpotContribution
export type V2_JackpotContribution = ({
jackpotId: string
jackpotMode: JackpotMode.ENGINE
} | {
jackpotId: string
jackpotContributionAmount: number // 6 decimal digits(check JackpotContributionScale)
jackpotMode: JackpotMode.VENDOR
})
JackpotContributionScale
| jackpotContributionAmount | Monetary value |
| 1 | 0.000001 |
| 10 | 0.00001 |
| 100 | 0.0001 |
| 1000 | 0.001 |
| 10000 | 0.01 |
| 100000 | 0.1 |
| 1000000 | 1 |
V2_JackpotPayout
export type V2_JackpotPayout = ({
jackpotId: string
jackpotMode: JackpotMode.ENGINE
} | {
jackpotId: string
jackpotPayoutAmount: number
jackpotMode: JackpotMode.VENDOR
})