Skip to main content

@kalamba/sdk

Index

Type Aliases

AutoplayLimit

AutoplayLimit: { enabled: boolean; options: number[]; showCustomLimit: boolean; showNoLimit: boolean }

Type declaration

  • enabled: boolean
  • options: number[]
  • showCustomLimit: boolean
  • showNoLimit: boolean

Bet

Bet: { base: number; multiplier: number }

Type declaration

  • base: number
  • multiplier: number

Cashier

Cashier: { type: ON_DEMAND | BALANCE_LOW | BALANCE_INSUFFICIENT }

Type declaration

  • type: ON_DEMAND | BALANCE_LOW | BALANCE_INSUFFICIENT

CashierConfig

CashierConfig: { balanceThreshold: number[]; enabled: boolean }

Type declaration

  • balanceThreshold: number[]
  • enabled: boolean

CasinoOnlyMessagePayloadMap

CasinoOnlyMessagePayloadMap: { balance: { balance: number }; bet: Bet; cashier: Cashier; choice: { id: string }; close: never; freeze: never; help: { show?: boolean }; history: History; paytable: { show?: boolean }; play: PlayRequest; resume: never; settings: Settings; suspend: never; unfreeze: never }

Type declaration

  • balance: { balance: number }
    • balance: number
  • bet: Bet
  • cashier: Cashier
  • choice: { id: string }
    • id: string
  • close: never
  • freeze: never
  • help: { show?: boolean }
    • optionalshow?: boolean
  • history: History
  • paytable: { show?: boolean }
    • optionalshow?: boolean
  • play: PlayRequest
  • resume: never
  • settings: Settings
  • suspend: never
  • unfreeze: never

ContractPlayPayload

ContractPlayPayload: { bet: Bet | null; forcedOutcomes?: unknown }

Type declaration

  • [key string]: any
  • bet: Bet | null
  • optionalforcedOutcomes?: unknown

DomainAllowedPayloadMap

DomainAllowedPayloadMap<P>: DomainToMessagePayloadMap[P]

Type parameters

DomainMessage

DomainMessage<P>: keyof DomainAllowedPayloadMap<P>

Type parameters

DomainMessageMessageEvent

DomainMessageMessageEvent<P, M>: MessageEvent<{ message: M; payload: DomainMessagePayload<P, M> }>

Type parameters

DomainMessagePayload

DomainMessagePayload<P, M>: DomainAllowedPayloadMap<P>[M]

Type parameters

DomainPrefix

DomainPrefix: keyof DomainToMessagePayloadMap & string

DomainToMessagePayloadMap

ForwardToPluginsMessage

ForwardToPluginsMessage<P>: keyof ForwardToPluginsMessageMap<sdk>[P] | keyof ForwardToPluginsMessageMap<rgs>[P] | keyof ForwardToPluginsMessageMap<casino>[P] | keyof ForwardToPluginsMessageMap<telemetry>[P]

Type parameters

ForwardToPluginsMessagePayload

ForwardToPluginsMessagePayload<P, M>: ForwardToPluginsMessageMap<sdk>[P][M] & ForwardToPluginsMessageMap<rgs>[P][M] & ForwardToPluginsMessageMap<casino>[P][M] & ForwardToPluginsMessageMap<telemetry>[P][M]

Type parameters

ForwardToSdkMessage

ForwardToSdkMessage: keyof ToSdkForwardedMessageMap

ForwardToSdkMessagePayload

ForwardToSdkMessagePayload<M>: ToSdkForwardedMessageMap[M]

Type parameters

FreeRound

FreeRound: { conf: { base: number; multiplier: number; numAwarded: number }; data: { numLeft: number; numPlayed: number; win: number }; id: string; rejectable: boolean; skippable: boolean; status: PENDING | ACTIVE | FINISHED; type: string }

Type declaration

  • conf: { base: number; multiplier: number; numAwarded: number }
    • base: number
    • multiplier: number
    • numAwarded: number
  • data: { numLeft: number; numPlayed: number; win: number }
    • numLeft: number
    • numPlayed: number
    • win: number
  • id: string
  • rejectable: boolean
  • skippable: boolean
  • status: PENDING | ACTIVE | FINISHED
  • type: string

FreeRoundsAction

FreeRoundsAction: { action: ACCEPT | DECLINE | SKIP; id: string }

Type declaration

  • action: ACCEPT | DECLINE | SKIP
  • id: string

FreeRoundsResponse

FreeRoundsResponse: { action: ACCEPT | DECLINE | SKIP; id: string }

Type declaration

  • action: ACCEPT | DECLINE | SKIP
  • id: string

Message

Message: keyof MessageMap

MessageMap

MessageMessageEvent

MessageMessageEvent<M>: MessageEvent<{ message: M; payload: MessagePayload<M> }>

Type parameters

MessagePayload

MessagePayload<M>: MessageMap[M]

Type parameters

OpenGameResponse

OpenGameResponse: { contract: { balance: { coins: number; version: number }; bet: { available: Record<number, number[]>; default: Bet; last: Bet | null; lastPaid: Bet | null; max: number | null }; freeRounds: FreeRound[]; gameModel: string; metaData: { maxWin: { key: string; maxWinOdds: number; maxWinValueXBet: number }[]; rtpValues: { key: string; rtpValue: string }[]; version: string }; roundId?: string; serverTime: number; sessionId: string; stateType: { nextRound: string; thisRound: string }; uiMessages: unknown[]; win: { max: number | null; round: number; total: number } }; data: unknown }

Type declaration

  • contract: { balance: { coins: number; version: number }; bet: { available: Record<number, number[]>; default: Bet; last: Bet | null; lastPaid: Bet | null; max: number | null }; freeRounds: FreeRound[]; gameModel: string; metaData: { maxWin: { key: string; maxWinOdds: number; maxWinValueXBet: number }[]; rtpValues: { key: string; rtpValue: string }[]; version: string }; roundId?: string; serverTime: number; sessionId: string; stateType: { nextRound: string; thisRound: string }; uiMessages: unknown[]; win: { max: number | null; round: number; total: number } }
    • balance: { coins: number; version: number }
      • coins: number
      • version: number
    • bet: { available: Record<number, number[]>; default: Bet; last: Bet | null; lastPaid: Bet | null; max: number | null }
      • available: Record<number, number[]>
      • default: Bet
      • last: Bet | null
      • lastPaid: Bet | null
      • max: number | null
    • freeRounds: FreeRound[]
    • gameModel: string
    • metaData: { maxWin: { key: string; maxWinOdds: number; maxWinValueXBet: number }[]; rtpValues: { key: string; rtpValue: string }[]; version: string }
      • maxWin: { key: string; maxWinOdds: number; maxWinValueXBet: number }[]
      • rtpValues: { key: string; rtpValue: string }[]
      • version: string
    • optionalroundId?: string
    • serverTime: number
    • sessionId: string
    • stateType: { nextRound: string; thisRound: string }
      • nextRound: string
      • thisRound: string
    • uiMessages: unknown[]
    • win: { max: number | null; round: number; total: number }
      • max: number | null
      • round: number
      • total: number
  • data: unknown

PlayRequest

PlayRequest: { actionType: string; contract: ContractPlayPayload; extra?: unknown }

Type declaration

PlayResponse

PlayResponse: { contract: { balance: { coins: number; version: number }; bet: { last: Bet | null; lastPaid: Bet }; freeRounds: FreeRound[]; roundId: string; serverTime: number; stateType: { nextRound: string; thisRound: string }; uiMessages: unknown[]; win: { round: number; total: number } }; data: unknown }

Type declaration

  • contract: { balance: { coins: number; version: number }; bet: { last: Bet | null; lastPaid: Bet }; freeRounds: FreeRound[]; roundId: string; serverTime: number; stateType: { nextRound: string; thisRound: string }; uiMessages: unknown[]; win: { round: number; total: number } }
    • balance: { coins: number; version: number }
      • coins: number
      • version: number
    • bet: { last: Bet | null; lastPaid: Bet }
    • freeRounds: FreeRound[]
    • roundId: string
    • serverTime: number
    • stateType: { nextRound: string; thisRound: string }
      • nextRound: string
      • thisRound: string
    • uiMessages: unknown[]
    • win: { round: number; total: number }
      • round: number
      • total: number
  • data: unknown

PluginDomain

PluginDomain: keyof ForwardToPluginsMessageMap<any>

PrefixedForwardToPluginsMessage

PrefixedForwardToPluginsMessage<P>: PrefixTypes<keyof ForwardToPluginsMessageMap<sdk>[P], sdk> | PrefixTypes<keyof ForwardToPluginsMessageMap<rgs>[P], rgs> | PrefixTypes<keyof ForwardToPluginsMessageMap<casino>[P], casino> | PrefixTypes<keyof ForwardToPluginsMessageMap<telemetry>[P], telemetry>

Type parameters

PrefixedMessage

PrefixedMessage: keyof PrefixedMessageMap

PrefixedMessageMap

PrefixedMessageMessageEvent

PrefixedMessageMessageEvent<M>: MessageEvent<{ message: M; payload: PrefixedMessagePayload<M> }>

Type parameters

PrefixedMessagePayload

PrefixedMessagePayload<M>: PrefixedMessageMap[M]

Type parameters

PrefixedMessagePayloadMap

PrefixedMessagePayloadMap<P>: PrefixKeys<DomainToMessagePayloadMap[P], P>

Type parameters

RealityCheckConfig

RealityCheckConfig: { sessionDurationPeriodFormat: seconds | minutes | hours; showCloseGame: boolean; showHistory: boolean; showNetPosition: boolean; showSessionDuration: boolean; showSumBets: boolean; showSumWins: boolean }

Type declaration

  • sessionDurationPeriodFormat: seconds | minutes | hours
  • showCloseGame: boolean
  • showHistory: boolean
  • showNetPosition: boolean
  • showSessionDuration: boolean
  • showSumBets: boolean
  • showSumWins: boolean

RgsErrorData

RgsErrorData: { code: keyof typeof RgsErrorCode; details?: unknown }

Type declaration

RgsErrorWithType

RgsErrorWithType: { type: timeout } | { data: RgsErrorData; type: error }

RgsOnlyMessagePayloadMap

RgsOnlyMessagePayloadMap: { error: SdkError; freeRoundsError: RgsErrorWithType; freeRoundsResponse: FreeRoundsResponse; openGameError: RgsErrorWithType; openGameResponse: OpenGameResponse; playError: RgsErrorWithType; playResponse: PlayResponse; realityCheck: { duration: number; sumBetAmount: number; sumWinAmount: number } }

Type declaration

RgsResponse

RgsResponse<M>: { response: `${M}Response` extends DomainMessage<rgs> ? DomainMessagePayload<rgs, `${M}Response`> : never; type: response } | { error: `${M}Error` extends DomainMessage<rgs> ? DomainMessagePayload<rgs, `${M}Error`> : never; type: error }

Type parameters

SdkError

SdkError: { messageCode: string; type: CLOSE | RELOAD | CONTINUE } & ({ message: string } | { messageKey: string })

SdkOnlyMessagePayloadMap

SdkOnlyMessagePayloadMap: { autoplay: { action: start | stop | pause | resume }; balance: { balance: number }; bet: Bet; cashier: Cashier; choice: { message: string; options: { id: string; label: string }[] }; close: never; configure: Partial<WrapperConfig>; error: SdkError; freeRounds: FreeRoundsAction; freeRoundsPopup: never; fullscreen: { lock?: OrientationLockType }; history: History; loadEnd: never; loadProgress: { progress: number }; loadStart: never; openGame: never; play: PlayRequest; playCycleEnd: PlayResponse; playCycleStart: ContractPlayPayload; playEnd: PlayResponse; playReady: never; playStart: ContractPlayPayload; settings: Settings; telemetry.click: { location: string; name: string }; telemetry.orientationChange: never; translations: NestedRecord<string, string> }

Type declaration

  • autoplay: { action: start | stop | pause | resume }
    • action: start | stop | pause | resume
  • balance: { balance: number }
    • balance: number
  • bet: Bet
  • cashier: Cashier
  • choice: { message: string; options: { id: string; label: string }[] }
    • message: string
    • options: { id: string; label: string }[]
  • close: never
  • configure: Partial<WrapperConfig>
  • error: SdkError
  • freeRounds: FreeRoundsAction
  • freeRoundsPopup: never
  • fullscreen: { lock?: OrientationLockType }
    • optionallock?: OrientationLockType
  • history: History
  • loadEnd: never
  • loadProgress: { progress: number }
    • progress: number
  • loadStart: never
  • openGame: never
  • play: PlayRequest
  • playCycleEnd: PlayResponse
  • playCycleStart: ContractPlayPayload
  • playEnd: PlayResponse
  • playReady: never
  • playStart: ContractPlayPayload
  • settings: Settings
  • telemetry.click: { location: string; name: string }
    • location: string
    • name: string
  • telemetry.orientationChange: never
  • translations: NestedRecord<string, string>
    {
    my_custom_error: 'Something went wrong',
    RgsError: {
    OUT_OF_MONEY: 'You are out of credits',
    }
    }

Settings

Settings: { fastPlay?: boolean; fastPlaySpeed?: number; music?: boolean; sounds?: boolean }

Type declaration

  • optionalfastPlay?: boolean
  • optionalfastPlaySpeed?: number
  • optionalmusic?: boolean
  • optionalsounds?: boolean

TelemetryOnlyMessagePayloadMap

TelemetryOnlyMessagePayloadMap: {}

Type declaration

  • [key string]: unknown

ToCasinoPluginsForwardedMessageMap

ToCasinoPluginsForwardedMessageMap: { casino: undefined; rgs: Pick<RgsOnlyMessagePayloadMap, playResponse | playError | openGameResponse>; sdk: Pick<SdkOnlyMessagePayloadMap, autoplay | balance | bet | cashier | choice | close | error | history | loadEnd | loadProgress | loadStart | openGame | play | playCycleEnd | playCycleStart | playEnd | playReady | playStart | settings>; telemetry: undefined; wrapper: undefined }

Type declaration

  • casino: undefined
  • rgs: Pick<RgsOnlyMessagePayloadMap, playResponse | playError | openGameResponse>
  • sdk: Pick<SdkOnlyMessagePayloadMap, autoplay | balance | bet | cashier | choice | close | error | history | loadEnd | loadProgress | loadStart | openGame | play | playCycleEnd | playCycleStart | playEnd | playReady | playStart | settings>
  • telemetry: undefined
  • wrapper: undefined

ToRgsPluginsForwardedMessageMap

ToRgsPluginsForwardedMessageMap: { casino: Pick<CasinoOnlyMessagePayloadMap, play | cashier | close | history>; rgs: undefined; sdk: Pick<SdkOnlyMessagePayloadMap, history | openGame | play>; telemetry: undefined; wrapper: undefined }

Type declaration

ToSdkForwardedMessageMap

ToSdkForwardedMessageMap: Pick<CasinoOnlyMessagePayloadMap, balance | bet | choice | freeze | help | paytable | resume | settings | suspend | unfreeze> & Pick<RgsOnlyMessagePayloadMap, realityCheck | openGameError | openGameResponse | playError | playResponse>

ToTelemetryPluginsForwardedMessageMap

ToTelemetryPluginsForwardedMessageMap: { casino: undefined; rgs: Pick<RgsOnlyMessagePayloadMap, openGameResponse | openGameError | playResponse | playError>; sdk: Pick<SdkOnlyMessagePayloadMap, autoplay | error | loadStart | loadProgress | loadEnd | playCycleStart | playCycleEnd | settings | telemetry.click | telemetry.orientationChange>; telemetry: undefined; wrapper: undefined }

Type declaration

  • casino: undefined
  • rgs: Pick<RgsOnlyMessagePayloadMap, openGameResponse | openGameError | playResponse | playError>
  • sdk: Pick<SdkOnlyMessagePayloadMap, autoplay | error | loadStart | loadProgress | loadEnd | playCycleStart | playCycleEnd | settings | telemetry.click | telemetry.orientationChange>
  • telemetry: undefined
  • wrapper: undefined

WrapperConfig

WrapperConfig: { gameHistoryUrl?: string; gameName: string; gameVersion: string; showBars: boolean; showErrors: boolean; showFreeRounds: boolean; showRealityCheck: boolean; skipErrors: (typeof RgsErrorCode[keyof typeof RgsErrorCode] | TIMEOUT)[] }

Type declaration

  • optionalgameHistoryUrl?: string
  • gameName: string
  • gameVersion: string
  • showBars: boolean
  • showErrors: boolean
  • showFreeRounds: boolean
  • showRealityCheck: boolean
  • skipErrors: (typeof RgsErrorCode[keyof typeof RgsErrorCode] | TIMEOUT)[]

WrapperOnlyMessagePayloadMap

WrapperOnlyMessagePayloadMap: { bet: Bet; close: never; configured: SdkConfig; error: SdkError; freeRounds: FreeRoundsAction; freeRoundsComplete: FreeRound; freeRoundsInfo: FreeRound; freeRoundsOffer: FreeRound; freeRoundsPopup: never; freeze: never; history: History; legalBets: Record<number, number[]>; play: PlayRequest & { payloadToInject?: Record<string, unknown> }; resume: never; state: WrapperState; suspend: never; unfreeze: never }

Type declaration

WrapperState

WrapperState: { balance: number; bet: Bet; freeRoundId?: string; isSdkConfigured: boolean; lastPlayResponse?: PlayResponse; openGameResponse?: OpenGameResponse }

Type declaration

  • balance: number
  • bet: Bet
  • optionalfreeRoundId?: string
  • isSdkConfigured: boolean
  • optionallastPlayResponse?: PlayResponse
  • optionalopenGameResponse?: OpenGameResponse

Variables

constRgsErrorCode

RgsErrorCode: { ACCESS_DENIED: ACCESS_DENIED; ALREADY_LOGGED_IN: ALREADY_LOGGED_IN; BONUS_RESTRICTION: BONUS_RESTRICTION; CONNECTION_ERROR: CONNECTION_ERROR; CREDENTIALS_NOT_FOUND: CREDENTIALS_NOT_FOUND; DATA_ACCESS_ERROR: DATA_ACCESS_ERROR; FORCED_OUTCOMES_NOT_ALLOWED: FORCED_OUTCOMES_NOT_ALLOWED; FREE_ROUNDS_PROCESSING_ERROR: FREE_ROUNDS_PROCESSING_ERROR; GAME_FROZEN: GAME_FROZEN; GAME_SERVER_ERROR: GAME_SERVER_ERROR; GAME_UNAVAILABLE: GAME_UNAVAILABLE; GAMING_LIMITS_REACHED: GAMING_LIMITS_REACHED; INVALID_BET: INVALID_BET; INVALID_BET_CURRENCY: INVALID_BET_CURRENCY; INVALID_CAGE_CODE: INVALID_CAGE_CODE; INVALID_CLIENT_TYPE: INVALID_CLIENT_TYPE; INVALID_MESSAGE_FORMAT: INVALID_MESSAGE_FORMAT; INVALID_SESSION: INVALID_SESSION; MESSAGE_SENDER_ERROR: MESSAGE_SENDER_ERROR; MISSING_GAME_STATE: MISSING_GAME_STATE; OUT_OF_MONEY: OUT_OF_MONEY; SESSION_MANAGEMENT_ERROR: SESSION_MANAGEMENT_ERROR; TOO_HIGH_ACTION_FREQUENCY: TOO_HIGH_ACTION_FREQUENCY; TOO_HIGH_BET_FREQUENCY: TOO_HIGH_BET_FREQUENCY; TOO_MANY_OPEN_GAMES: TOO_MANY_OPEN_GAMES; UNFINISHED_ROUND_IN_PROGRESS: UNFINISHED_ROUND_IN_PROGRESS; UNKNOWN: UNKNOWN; USER_ALREADY_LOCKED: USER_ALREADY_LOCKED; USER_LOCK_INVALID_PARAMS: USER_LOCK_INVALID_PARAMS; WALLET_PROCESSING_ERROR: WALLET_PROCESSING_ERROR; WEB_SESSION_NOT_OPEN: WEB_SESSION_NOT_OPEN } = ...

Type declaration

  • readonlyACCESS_DENIED: ACCESS_DENIED
  • readonlyALREADY_LOGGED_IN: ALREADY_LOGGED_IN
  • readonlyBONUS_RESTRICTION: BONUS_RESTRICTION
  • readonlyCONNECTION_ERROR: CONNECTION_ERROR
  • readonlyCREDENTIALS_NOT_FOUND: CREDENTIALS_NOT_FOUND
  • readonlyDATA_ACCESS_ERROR: DATA_ACCESS_ERROR
  • readonlyFORCED_OUTCOMES_NOT_ALLOWED: FORCED_OUTCOMES_NOT_ALLOWED
  • readonlyFREE_ROUNDS_PROCESSING_ERROR: FREE_ROUNDS_PROCESSING_ERROR
  • readonlyGAME_FROZEN: GAME_FROZEN
  • readonlyGAME_SERVER_ERROR: GAME_SERVER_ERROR
  • readonlyGAME_UNAVAILABLE: GAME_UNAVAILABLE
  • readonlyGAMING_LIMITS_REACHED: GAMING_LIMITS_REACHED
  • readonlyINVALID_BET: INVALID_BET
  • readonlyINVALID_BET_CURRENCY: INVALID_BET_CURRENCY
  • readonlyINVALID_CAGE_CODE: INVALID_CAGE_CODE
  • readonlyINVALID_CLIENT_TYPE: INVALID_CLIENT_TYPE
  • readonlyINVALID_MESSAGE_FORMAT: INVALID_MESSAGE_FORMAT
  • readonlyINVALID_SESSION: INVALID_SESSION
  • readonlyMESSAGE_SENDER_ERROR: MESSAGE_SENDER_ERROR
  • readonlyMISSING_GAME_STATE: MISSING_GAME_STATE
  • readonlyOUT_OF_MONEY: OUT_OF_MONEY
  • readonlySESSION_MANAGEMENT_ERROR: SESSION_MANAGEMENT_ERROR
  • readonlyTOO_HIGH_ACTION_FREQUENCY: TOO_HIGH_ACTION_FREQUENCY
  • readonlyTOO_HIGH_BET_FREQUENCY: TOO_HIGH_BET_FREQUENCY
  • readonlyTOO_MANY_OPEN_GAMES: TOO_MANY_OPEN_GAMES
  • readonlyUNFINISHED_ROUND_IN_PROGRESS: UNFINISHED_ROUND_IN_PROGRESS
  • readonlyUNKNOWN: UNKNOWN
  • readonlyUSER_ALREADY_LOCKED: USER_ALREADY_LOCKED
  • readonlyUSER_LOCK_INVALID_PARAMS: USER_LOCK_INVALID_PARAMS
  • readonlyWALLET_PROCESSING_ERROR: WALLET_PROCESSING_ERROR
  • readonlyWEB_SESSION_NOT_OPEN: WEB_SESSION_NOT_OPEN