@smartico/public-api 0.0.381 → 0.0.383
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GamePick/GamePickTypes.d.ts +461 -0
- package/dist/GamePick/MarketsAnswers.d.ts +40 -0
- package/dist/GamePick/MarketsInfo.d.ts +14 -0
- package/dist/GamePick/MarketsPerSport.d.ts +6 -0
- package/dist/GamePick/MarketsType.d.ts +28 -0
- package/dist/GamePick/ScoreResultTypes.d.ts +28 -0
- package/dist/GamePick/SportTypes.d.ts +6 -0
- package/dist/GamePick/index.d.ts +7 -0
- package/dist/MiniGames/SAWGameType.d.ts +3 -1
- package/dist/MiniGames/SAWTemplateUI.d.ts +7 -0
- package/dist/SmarticoAPI.d.ts +1 -1
- package/dist/WSAPI/WSAPIGamePick.d.ts +1 -1
- package/dist/WSAPI/WSAPITypes.d.ts +2 -460
- package/dist/index.d.ts +1 -1
- package/dist/index.js +139 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +140 -2
- package/dist/index.modern.mjs.map +1 -1
- package/docs/api/README.md +2 -22
- package/docs/api/classes/WSAPIGamePick.md +42 -42
- package/docs/api/enumerations/SAWGameType.md +6 -0
- package/docs/api/enumerations/SAWGameTypeName.md +6 -0
- package/docs/api/interfaces/SAWTemplateUI.md +11 -0
- package/package.json +1 -1
- package/src/GamePick/GamePickTypes.ts +471 -0
- package/src/{Quiz → GamePick}/index.ts +1 -0
- package/src/MiniGames/SAWGameType.ts +3 -0
- package/src/MiniGames/SAWTemplateUI.ts +10 -0
- package/src/SmarticoAPI.ts +1 -7
- package/src/WSAPI/WSAPIGamePick.ts +1 -9
- package/src/WSAPI/WSAPITypes.ts +2 -471
- package/src/index.ts +1 -1
- package/docs/api/enumerations/GPRoundStatus.md +0 -43
- package/docs/api/enumerations/GamePickMarketType.md +0 -19
- package/docs/api/enumerations/GamePickResolutionType.md +0 -35
- package/docs/api/enumerations/GamePickScoreType.md +0 -19
- package/docs/api/enumerations/GamePickSportType.md +0 -375
- package/docs/api/enumerations/GameRoundOrderType.md +0 -35
- package/docs/api/interfaces/GamePickBoardUser.md +0 -75
- package/docs/api/interfaces/GamePickEvent.md +0 -123
- package/docs/api/interfaces/GamePickEventMeta.md +0 -201
- package/docs/api/interfaces/GamePickGameInfo.md +0 -27
- package/docs/api/interfaces/GamePickRequestParams.md +0 -39
- package/docs/api/interfaces/GamePickRound.md +0 -383
- package/docs/api/interfaces/GamePickRoundBase.md +0 -232
- package/docs/api/interfaces/GamePickRoundBoard.md +0 -359
- package/docs/api/interfaces/GamePickRoundPublicMeta.md +0 -103
- package/docs/api/interfaces/GamePickRoundRequestParams.md +0 -63
- package/docs/api/interfaces/GamePickUserInfo.md +0 -107
- package/docs/api/interfaces/GamesApiResponse.md +0 -33
- package/docs/api/interfaces/QuizEventMeta.md +0 -61
- package/docs/api/variables/AllRoundsGameBoardID.md +0 -5
- /package/src/{Quiz → GamePick}/MarketsAnswers.ts +0 -0
- /package/src/{Quiz → GamePick}/MarketsInfo.ts +0 -0
- /package/src/{Quiz → GamePick}/MarketsPerSport.ts +0 -0
- /package/src/{Quiz → GamePick}/MarketsType.ts +0 -0
- /package/src/{Quiz → GamePick}/ScoreResultTypes.ts +0 -0
- /package/src/{Quiz → GamePick}/SportTypes.ts +0 -0
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { SAWTemplate } from "src/MiniGames";
|
|
2
|
+
import { QuizAnswersValueType } from "./MarketsAnswers";
|
|
3
|
+
import { SAWGPMarketType } from "./MarketsType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GamePickMarketType defines legacy market categories for MatchX events
|
|
7
|
+
*/
|
|
8
|
+
export enum GamePickMarketType {
|
|
9
|
+
/** Predict the number of goals */
|
|
10
|
+
Goals = 1,
|
|
11
|
+
/** Predict the winner */
|
|
12
|
+
Winner = 2,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* GamePickResolutionType defines how a user's prediction was scored after event resolution
|
|
17
|
+
*/
|
|
18
|
+
export enum GamePickResolutionType {
|
|
19
|
+
/** Event not yet resolved */
|
|
20
|
+
None = 0,
|
|
21
|
+
/** Prediction was wrong */
|
|
22
|
+
Lost = 2,
|
|
23
|
+
/** Prediction was partially correct (e.g. correct winner but wrong score) */
|
|
24
|
+
PartialWin = 3,
|
|
25
|
+
/** Prediction was fully correct */
|
|
26
|
+
FullWin = 4,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* GPRoundStatus defines the lifecycle stage of a game round
|
|
31
|
+
*/
|
|
32
|
+
export enum GPRoundStatus {
|
|
33
|
+
/** Round is in an active/other state */
|
|
34
|
+
Other = -1,
|
|
35
|
+
/** Round exists but has no events defined yet */
|
|
36
|
+
NoEventsDefined = 1,
|
|
37
|
+
/** Betting deadline has passed, no more bets allowed */
|
|
38
|
+
NoMoreBetsAllowed = 2,
|
|
39
|
+
/** All events in the round are resolved, but the round itself is not finalized */
|
|
40
|
+
AllEventsResolved_ButNotRound = 3,
|
|
41
|
+
/** Round is fully resolved and scored */
|
|
42
|
+
RoundResolved = 4,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* GamePickScoreType defines how scores are calculated for predictions
|
|
47
|
+
*/
|
|
48
|
+
export enum GamePickScoreType {
|
|
49
|
+
/** Score based on exact match of predicted result */
|
|
50
|
+
ExactScore = 1,
|
|
51
|
+
/** Score based on closeness (difference) of predicted result */
|
|
52
|
+
PointsDifference = 2,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* GamePickSportType defines supported sport types for events, using Betradar sport IDs
|
|
57
|
+
*/
|
|
58
|
+
export enum GamePickSportType {
|
|
59
|
+
Soccer = 1,
|
|
60
|
+
Basketball = 2,
|
|
61
|
+
Baseball = 3,
|
|
62
|
+
IceHockey = 4,
|
|
63
|
+
Tennis = 5,
|
|
64
|
+
Handball = 6,
|
|
65
|
+
Floorball = 7,
|
|
66
|
+
Golf = 9,
|
|
67
|
+
Boxing = 10,
|
|
68
|
+
Motorsport = 11,
|
|
69
|
+
Rugby = 12,
|
|
70
|
+
AussieRules = 13,
|
|
71
|
+
Bandy = 15,
|
|
72
|
+
AmericanFootball = 16,
|
|
73
|
+
Cycling = 17,
|
|
74
|
+
Specials = 18,
|
|
75
|
+
Snooker = 19,
|
|
76
|
+
TableTennis = 20,
|
|
77
|
+
Cricket = 21,
|
|
78
|
+
Darts = 22,
|
|
79
|
+
Volleyball = 23,
|
|
80
|
+
FieldHockey = 24,
|
|
81
|
+
Waterpolo = 26,
|
|
82
|
+
Curling = 28,
|
|
83
|
+
Futsal = 29,
|
|
84
|
+
Badminton = 31,
|
|
85
|
+
Bowls = 32,
|
|
86
|
+
Chess = 33,
|
|
87
|
+
BeachVolley = 34,
|
|
88
|
+
Netball = 35,
|
|
89
|
+
Athletics = 36,
|
|
90
|
+
Squash = 37,
|
|
91
|
+
Lacrosse = 39,
|
|
92
|
+
Formula1 = 40,
|
|
93
|
+
AlpineSkiing = 43,
|
|
94
|
+
Biathlon = 44,
|
|
95
|
+
CrossCountry = 46,
|
|
96
|
+
NordicCombined = 47,
|
|
97
|
+
SkiJumping = 48,
|
|
98
|
+
Schwingen = 56,
|
|
99
|
+
BeachSoccer = 60,
|
|
100
|
+
Pesapallo = 61,
|
|
101
|
+
ESportCounterStrike = 109,
|
|
102
|
+
ESportLeagueofLegends = 110,
|
|
103
|
+
ESportDota = 111,
|
|
104
|
+
StarCraft = 112,
|
|
105
|
+
MMA = 117,
|
|
106
|
+
CallOfDuty = 118,
|
|
107
|
+
ESportOverwatch = 121,
|
|
108
|
+
ESportRocketLeague = 128,
|
|
109
|
+
IndyRacing = 129,
|
|
110
|
+
Speedway = 131,
|
|
111
|
+
GaelicFootball = 135,
|
|
112
|
+
GaelicHurling = 136,
|
|
113
|
+
ESporteSoccer = 137,
|
|
114
|
+
Kabaddi = 138,
|
|
115
|
+
ESporteBasketball = 153,
|
|
116
|
+
Basketball3x3 = 155,
|
|
117
|
+
ESportArenaofValor = 158,
|
|
118
|
+
TouringCarRacing = 188,
|
|
119
|
+
MotorcycleRacing = 190,
|
|
120
|
+
StockCarRacing = 191,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* GameRoundOrderType defines how events within a round are ordered for display
|
|
125
|
+
*/
|
|
126
|
+
export enum GameRoundOrderType {
|
|
127
|
+
/** Display in the order events were added */
|
|
128
|
+
HowAdded = 1,
|
|
129
|
+
/** Display in reverse of the order events were added */
|
|
130
|
+
HowAddedReversed = 2,
|
|
131
|
+
/** Display ordered by event/match date ascending (earliest first) */
|
|
132
|
+
EventDateAscending = 3,
|
|
133
|
+
/** Display ordered by event/match date descending (latest first) */
|
|
134
|
+
EventDateDescending = 4,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Round ID constant used to request the overall/seasonal leaderboard across all rounds */
|
|
138
|
+
export const AllRoundsGameBoardID = -1;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* QuizEventMeta describes metadata for a quiz-type event (custom question with answer options)
|
|
142
|
+
*/
|
|
143
|
+
export interface QuizEventMeta {
|
|
144
|
+
/** List of possible answer options for the quiz question */
|
|
145
|
+
answers?: {
|
|
146
|
+
/** Answer identifier value sent on submission */
|
|
147
|
+
value: string;
|
|
148
|
+
/** Localized display text of the answer */
|
|
149
|
+
text: string;
|
|
150
|
+
/** Per-language overrides for the answer text */
|
|
151
|
+
_translations: {
|
|
152
|
+
[key: string]: {
|
|
153
|
+
text: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
}[];
|
|
157
|
+
/** URL of an image associated with the question */
|
|
158
|
+
question_image?: string;
|
|
159
|
+
/** Correct answer value after resolution */
|
|
160
|
+
result?: QuizAnswersValueType;
|
|
161
|
+
/** Custom question text displayed to the user */
|
|
162
|
+
custom_question: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* GamePickEventMeta describes metadata for a MatchX or Quiz event, including team info and sport context
|
|
167
|
+
*/
|
|
168
|
+
export interface GamePickEventMeta extends QuizEventMeta {
|
|
169
|
+
/** Display name of the event/match */
|
|
170
|
+
event_name?: string;
|
|
171
|
+
/** Name of the first team (home) */
|
|
172
|
+
team1_name: string;
|
|
173
|
+
/** URL of the first team's logo image */
|
|
174
|
+
team1_image: string;
|
|
175
|
+
/** Name of the second team (away) */
|
|
176
|
+
team2_name: string;
|
|
177
|
+
/** URL of the second team's logo image */
|
|
178
|
+
team2_image: string;
|
|
179
|
+
/** Actual result score for team 1 after resolution */
|
|
180
|
+
team1_result?: number;
|
|
181
|
+
/** Actual result score for team 2 after resolution */
|
|
182
|
+
team2_result?: number;
|
|
183
|
+
/** Betradar sport type ID for the event */
|
|
184
|
+
sport_type_id?: number;
|
|
185
|
+
/** Whether the event has been canceled */
|
|
186
|
+
is_canceled?: boolean;
|
|
187
|
+
/** Whether auto-resolution from live data feed is enabled */
|
|
188
|
+
auto_resolve_enabled?: boolean;
|
|
189
|
+
/** ISO date string for when auto-resolution is expected */
|
|
190
|
+
auto_resolve_date?: string;
|
|
191
|
+
/** Auto-resolved score for team 1 from live data feed */
|
|
192
|
+
team1_auto_result?: number;
|
|
193
|
+
/** Auto-resolved score for team 2 from live data feed */
|
|
194
|
+
team2_auto_result?: number;
|
|
195
|
+
/** Auto-resolved answer value from live data feed (for quiz events) */
|
|
196
|
+
auto_result?: string;
|
|
197
|
+
/** Per-language overrides for team names, event name, and custom question */
|
|
198
|
+
_translations: {
|
|
199
|
+
[key: string]: {
|
|
200
|
+
team1_name: string;
|
|
201
|
+
team2_name: string;
|
|
202
|
+
event_name: string;
|
|
203
|
+
custom_question: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* GamePickEvent describes a single event (match or question) within a round, including the user's prediction and resolution
|
|
210
|
+
*/
|
|
211
|
+
export interface GamePickEvent {
|
|
212
|
+
/** Unique identifier of the event */
|
|
213
|
+
gp_event_id: number;
|
|
214
|
+
/** Timestamp (ms) when the event was resolved, null if not yet resolved */
|
|
215
|
+
event_resolution_date: number;
|
|
216
|
+
/** Timestamp (ms) of the match/event start time */
|
|
217
|
+
match_date: number;
|
|
218
|
+
/** Market type defining the prediction format (e.g. two-team score, quiz question, custom) */
|
|
219
|
+
market_type_id: SAWGPMarketType;
|
|
220
|
+
/** Event metadata containing team names, images, sport type, and question details */
|
|
221
|
+
event_meta: GamePickEventMeta;
|
|
222
|
+
/** Whether the current user has submitted a prediction for this event */
|
|
223
|
+
user_placed_bet: boolean;
|
|
224
|
+
/** User's predicted score for team 1 (MatchX only). Can be a number or a range object */
|
|
225
|
+
team1_user_selection?: number | { from: number; to: number };
|
|
226
|
+
/** User's predicted score for team 2 (MatchX only). Can be a number or a range object */
|
|
227
|
+
team2_user_selection?: number | { from: number; to: number };
|
|
228
|
+
/** User's selected answer (Quiz only). Value depends on market type (e.g. '1', '2', 'x', 'yes', 'no') */
|
|
229
|
+
user_selection?: QuizAnswersValueType;
|
|
230
|
+
/** How the user's prediction was scored after resolution */
|
|
231
|
+
resolution_type_id: GamePickResolutionType;
|
|
232
|
+
/** Points awarded for this event based on prediction accuracy */
|
|
233
|
+
resolution_score?: number;
|
|
234
|
+
/** Whether this event is still accepting predictions */
|
|
235
|
+
is_open_for_bets?: boolean;
|
|
236
|
+
/** Betting odds details for the event outcomes */
|
|
237
|
+
odds_details?: { odd_value: { [key: string]: number } };
|
|
238
|
+
/** URL of a question-specific image (quiz events) */
|
|
239
|
+
question_image?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* GamePickRoundPublicMeta describes the public-facing metadata and translations for a round, configured in the BackOffice
|
|
244
|
+
*/
|
|
245
|
+
export interface GamePickRoundPublicMeta {
|
|
246
|
+
/** Localized round name */
|
|
247
|
+
round_name: string;
|
|
248
|
+
/** Localized round description */
|
|
249
|
+
round_description: string;
|
|
250
|
+
/** URL of the promotional image for the round */
|
|
251
|
+
promo_image: string;
|
|
252
|
+
/** Promotional text displayed with the round */
|
|
253
|
+
promo_text: string;
|
|
254
|
+
/** Whether to hide the round from the UI after it has been resolved */
|
|
255
|
+
hide_resolved_round: boolean;
|
|
256
|
+
/** URL of the final screen image for desktop */
|
|
257
|
+
final_screen_image_desktop: string;
|
|
258
|
+
/** URL of the final screen image for mobile */
|
|
259
|
+
final_screen_image_mobile: string;
|
|
260
|
+
/** Message displayed on the final/results screen */
|
|
261
|
+
final_screen_message: string;
|
|
262
|
+
/** Label for the CTA button on the final screen */
|
|
263
|
+
final_screen_cta_button_title: string;
|
|
264
|
+
/** Deep link triggered by the CTA button on the final screen */
|
|
265
|
+
final_screen_cta_dp: string;
|
|
266
|
+
/** Whether users can edit their answers after initial submission (within betting window) */
|
|
267
|
+
allow_edit_answers?: boolean;
|
|
268
|
+
/** Per-language overrides for round display content */
|
|
269
|
+
_translations: {
|
|
270
|
+
[key: string]: {
|
|
271
|
+
round_name: string;
|
|
272
|
+
round_description: string;
|
|
273
|
+
promo_image: string;
|
|
274
|
+
promo_text: string;
|
|
275
|
+
final_screen_image_desktop: string;
|
|
276
|
+
final_screen_image_mobile: string;
|
|
277
|
+
final_screen_message: string;
|
|
278
|
+
final_screen_cta_button_title: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* GamePickRoundBase describes a game round's metadata (without events or user-specific data)
|
|
285
|
+
*/
|
|
286
|
+
export interface GamePickRoundBase {
|
|
287
|
+
/** Unique round identifier */
|
|
288
|
+
round_id: number;
|
|
289
|
+
/** Sequential row ID used for ordering rounds */
|
|
290
|
+
round_row_id: number;
|
|
291
|
+
/** Localized display name of the round */
|
|
292
|
+
round_name: string;
|
|
293
|
+
/** Localized description of the round */
|
|
294
|
+
round_description: string;
|
|
295
|
+
/** Label for the CTA button on the final/results screen */
|
|
296
|
+
final_screen_cta_button_title: string;
|
|
297
|
+
/** Message displayed on the final/results screen */
|
|
298
|
+
final_screen_message: string;
|
|
299
|
+
/** URL of the final screen image (desktop) */
|
|
300
|
+
final_screen_image_desktop: string;
|
|
301
|
+
/** URL of the final screen image (mobile) */
|
|
302
|
+
final_screen_image_mobile: string;
|
|
303
|
+
/** URL of the promotional image for the round */
|
|
304
|
+
promo_image: string;
|
|
305
|
+
/** Promotional text displayed with the round */
|
|
306
|
+
promo_text: string;
|
|
307
|
+
/** Timestamp (ms) when the round opens for participation */
|
|
308
|
+
open_date: number;
|
|
309
|
+
/** Timestamp (ms) of the last moment bets are accepted */
|
|
310
|
+
last_bet_date: number;
|
|
311
|
+
/** Timestamp (ms) when the round is expected to be resolved */
|
|
312
|
+
resolution_date: number;
|
|
313
|
+
/** Points awarded for a fully correct prediction */
|
|
314
|
+
score_full_win: number;
|
|
315
|
+
/** Points awarded for a partially correct prediction */
|
|
316
|
+
score_part_win: number;
|
|
317
|
+
/** Points awarded (or deducted) for an incorrect prediction */
|
|
318
|
+
score_lost: number;
|
|
319
|
+
/** Whether the round is currently active for participation */
|
|
320
|
+
is_active_now: boolean;
|
|
321
|
+
/** Whether the round has been fully resolved and scored */
|
|
322
|
+
is_resolved: boolean;
|
|
323
|
+
/** Current lifecycle status of the round */
|
|
324
|
+
round_status_id: GPRoundStatus;
|
|
325
|
+
/** Total number of events in the round */
|
|
326
|
+
events_total: number;
|
|
327
|
+
/** Number of events that have been resolved */
|
|
328
|
+
events_resolved: number;
|
|
329
|
+
/** Scoring method used for this round */
|
|
330
|
+
score_type_id: GamePickScoreType;
|
|
331
|
+
/** How events are ordered for display */
|
|
332
|
+
order_events: GameRoundOrderType;
|
|
333
|
+
/** Maximum number of users shown on the leaderboard */
|
|
334
|
+
board_users_count: number;
|
|
335
|
+
/** Whether other users' predictions are hidden until resolution */
|
|
336
|
+
hide_users_predictions: boolean;
|
|
337
|
+
/** Public metadata including translations and display settings from the BackOffice */
|
|
338
|
+
public_meta: GamePickRoundPublicMeta;
|
|
339
|
+
/** Timestamp (ms) when the next round opens, if available */
|
|
340
|
+
next_round_open_date: number;
|
|
341
|
+
/** Whether to show aggregated user preference percentages for each outcome */
|
|
342
|
+
show_users_preference: boolean;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* GamePickRound describes a round with its events and the current user's prediction data
|
|
347
|
+
*/
|
|
348
|
+
export interface GamePickRound extends GamePickRoundBase {
|
|
349
|
+
/** List of events (matches/questions) in this round */
|
|
350
|
+
events: GamePickEvent[];
|
|
351
|
+
/** Current user's total score in this round */
|
|
352
|
+
user_score: number;
|
|
353
|
+
/** Whether the current user has submitted any predictions in this round */
|
|
354
|
+
user_placed_bet: boolean;
|
|
355
|
+
/** Whether there are events still open for betting */
|
|
356
|
+
has_open_for_bet_events?: boolean;
|
|
357
|
+
/** Whether the user has unsaved changes to their predictions */
|
|
358
|
+
has_not_submitted_changes?: boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* GamePickRoundBoard describes a round's leaderboard with ranked users
|
|
363
|
+
*/
|
|
364
|
+
export interface GamePickRoundBoard extends GamePickRoundBase {
|
|
365
|
+
/** Current user's leaderboard entry, or null if user hasn't participated */
|
|
366
|
+
my_user: GamePickBoardUser;
|
|
367
|
+
/** Ranked list of users on the leaderboard */
|
|
368
|
+
users: GamePickBoardUser[];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* GamePickBoardUser describes a user's entry on the round leaderboard
|
|
373
|
+
*/
|
|
374
|
+
export interface GamePickBoardUser {
|
|
375
|
+
/** External user ID (Smartico numeric user ID) */
|
|
376
|
+
ext_user_id: string;
|
|
377
|
+
/** Internal user ID within the games system */
|
|
378
|
+
int_user_id: number;
|
|
379
|
+
/** Display name shown on the leaderboard */
|
|
380
|
+
public_username: string;
|
|
381
|
+
/** URL of the user's avatar image */
|
|
382
|
+
avatar_url: string;
|
|
383
|
+
/** User's rank position on the leaderboard, null if not yet ranked */
|
|
384
|
+
gp_position: number;
|
|
385
|
+
/** User's total score in this round/season */
|
|
386
|
+
resolution_score: number;
|
|
387
|
+
/** Number of fully correct predictions */
|
|
388
|
+
full_wins_count: number;
|
|
389
|
+
/** Number of partially correct predictions */
|
|
390
|
+
part_wins_count: number;
|
|
391
|
+
/** Number of incorrect predictions */
|
|
392
|
+
lost_count: number;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* GamePickUserInfo describes the current user's profile in the games system
|
|
397
|
+
*/
|
|
398
|
+
export interface GamePickUserInfo {
|
|
399
|
+
/** External user ID (Smartico numeric user ID) */
|
|
400
|
+
ext_user_id: string;
|
|
401
|
+
/** Internal user ID within the games system */
|
|
402
|
+
int_user_id: number;
|
|
403
|
+
/** Display name */
|
|
404
|
+
public_username: string;
|
|
405
|
+
/** URL of the user's avatar image */
|
|
406
|
+
avatar_url: string;
|
|
407
|
+
/** User's leaderboard rank position */
|
|
408
|
+
gp_position?: number;
|
|
409
|
+
/** Number of fully correct predictions */
|
|
410
|
+
full_wins_count?: number;
|
|
411
|
+
/** Number of partially correct predictions */
|
|
412
|
+
part_wins_count?: number;
|
|
413
|
+
/** User's total score */
|
|
414
|
+
resolution_score?: number;
|
|
415
|
+
/** Last time the user's balance was synced from the Smartico platform */
|
|
416
|
+
last_wallet_sync_time?: Date;
|
|
417
|
+
/** User's current points balance */
|
|
418
|
+
ach_points_balance?: number;
|
|
419
|
+
/** User's current gems balance */
|
|
420
|
+
ach_gems_balance?: number;
|
|
421
|
+
/** User's current diamonds balance */
|
|
422
|
+
ach_diamonds_balance?: number;
|
|
423
|
+
/** Whether the user has set a custom public username */
|
|
424
|
+
pubic_username_set?: boolean;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* GamePickGameInfo describes the game configuration including SAW template, rounds list, and label settings
|
|
429
|
+
*/
|
|
430
|
+
export interface GamePickGameInfo {
|
|
431
|
+
/** Game template configuration (SAW template) with UI settings, buy-in type, cost, and spin count */
|
|
432
|
+
sawTemplate: SAWTemplate;
|
|
433
|
+
/** List of all rounds (metadata only, no events) */
|
|
434
|
+
allRounds: GamePickRoundBase[];
|
|
435
|
+
/** Label/brand configuration and settings */
|
|
436
|
+
labelInfo: any;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* GamesApiResponse is the standard response wrapper for all GamePick/Quiz API calls
|
|
441
|
+
*/
|
|
442
|
+
export interface GamesApiResponse<T> {
|
|
443
|
+
/** Error code: 0 on success, non-zero on failure */
|
|
444
|
+
errCode: number;
|
|
445
|
+
/** Human-readable error message when errCode is non-zero */
|
|
446
|
+
errMessage?: string;
|
|
447
|
+
/** Response payload, present on success */
|
|
448
|
+
data?: T;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* GamePickRequestParams describes the base parameters required for GamePick API calls
|
|
453
|
+
*/
|
|
454
|
+
export interface GamePickRequestParams {
|
|
455
|
+
/** ID of the MatchX or Quiz game template */
|
|
456
|
+
saw_template_id: number;
|
|
457
|
+
/** External user ID */
|
|
458
|
+
ext_user_id: string;
|
|
459
|
+
/** Smartico external user ID used for platform API calls */
|
|
460
|
+
smartico_ext_user_id: string;
|
|
461
|
+
/** Language code for translations (e.g. 'EN', 'DE') */
|
|
462
|
+
lang?: string;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* GamePickRoundRequestParams extends base params with a specific round ID
|
|
467
|
+
*/
|
|
468
|
+
export interface GamePickRoundRequestParams extends GamePickRequestParams {
|
|
469
|
+
/** ID of the specific round */
|
|
470
|
+
round_id: number;
|
|
471
|
+
}
|
|
@@ -11,6 +11,7 @@ export enum SAWGameType {
|
|
|
11
11
|
Voyager = 10,
|
|
12
12
|
Plinko = 11,
|
|
13
13
|
CoinFlip = 12,
|
|
14
|
+
CustomMinigame = 13,
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export enum SAWGameTypeName {
|
|
@@ -26,6 +27,7 @@ export enum SAWGameTypeName {
|
|
|
26
27
|
Voyager = 'voyager',
|
|
27
28
|
Plinko = 'plinko',
|
|
28
29
|
CoinFlip = 'coin_flip',
|
|
30
|
+
CustomMinigame = 'custom_minigame',
|
|
29
31
|
Unknown = 'unknown',
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -45,6 +47,7 @@ export const SAWGameTypeNamed = (type: SAWGameType): SAWGameTypeName => {
|
|
|
45
47
|
[SAWGameType.Voyager]: SAWGameTypeName.Voyager,
|
|
46
48
|
[SAWGameType.Plinko]: SAWGameTypeName.Plinko,
|
|
47
49
|
[SAWGameType.CoinFlip]: SAWGameTypeName.CoinFlip,
|
|
50
|
+
[SAWGameType.CustomMinigame]: SAWGameTypeName.CustomMinigame,
|
|
48
51
|
}[type] || SAWGameTypeName.Unknown
|
|
49
52
|
);
|
|
50
53
|
};
|
|
@@ -455,6 +455,16 @@ export interface SAWTemplateUI {
|
|
|
455
455
|
*/
|
|
456
456
|
game_difficulty?: SAWGameDifficultyType;
|
|
457
457
|
|
|
458
|
+
// ─── Custom Minigame specific ─────────────────────────────────────────────
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* URL of the operator-hosted custom mini-game, loaded inside an iframe by
|
|
462
|
+
* the widget for `SAWGameType.CustomMinigame`. The operator is trusted, so
|
|
463
|
+
* the iframe is rendered without a sandbox.
|
|
464
|
+
* Back-Office label: _"Game URL"_.
|
|
465
|
+
*/
|
|
466
|
+
custom_game_url?: string;
|
|
467
|
+
|
|
458
468
|
/**
|
|
459
469
|
* Minutes for the Voyager seed window.
|
|
460
470
|
* The seed window is the range of seeds that can be used to generate the map.
|
package/src/SmarticoAPI.ts
CHANGED
|
@@ -148,13 +148,7 @@ import { GetJackpotWinnersResponse, GetJackpotWinnersResponseTransform, JackpotW
|
|
|
148
148
|
import { GetJackpotWinnersRequest } from './Jackpots/GetJackpotWinnersRequest';
|
|
149
149
|
import { GetJackpotEligibleGamesRequest } from './Jackpots/GetJackpotEligibleGamesRequest';
|
|
150
150
|
import { GetJackpotEligibleGamesResponse, GetJackpotEligibleGamesResponseTransform, JackpotEligibleGame, TGetJackpotEligibleGamesResponse } from './Jackpots/GetJackpotEligibleGamesResponse';
|
|
151
|
-
import {
|
|
152
|
-
GamesApiResponse,
|
|
153
|
-
GamePickRound,
|
|
154
|
-
GamePickRoundBoard,
|
|
155
|
-
GamePickUserInfo,
|
|
156
|
-
GamePickGameInfo,
|
|
157
|
-
} from './WSAPI/WSAPITypes';
|
|
151
|
+
import { GamePickGameInfo, GamePickRound, GamePickRoundBoard, GamePickUserInfo, GamesApiResponse } from './GamePick';
|
|
158
152
|
|
|
159
153
|
const PUBLIC_API_URL = 'https://papi{ENV_ID}.smartico.ai/services/public';
|
|
160
154
|
const C_SOCKET_PROD = 'wss://api{ENV_ID}.smartico.ai/websocket/services';
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GamesApiResponse,
|
|
3
|
-
GamePickRound,
|
|
4
|
-
GamePickRoundBoard,
|
|
5
|
-
GamePickUserInfo,
|
|
6
|
-
GamePickGameInfo,
|
|
7
|
-
GamePickRequestParams,
|
|
8
|
-
GamePickRoundRequestParams,
|
|
9
|
-
} from './WSAPITypes';
|
|
1
|
+
import { GamePickGameInfo, GamePickRequestParams, GamePickRound, GamePickRoundBoard, GamePickRoundRequestParams, GamePickUserInfo, GamesApiResponse } from 'src/GamePick';
|
|
10
2
|
import { WSAPIAvatars } from './WSAPIAvatars';
|
|
11
3
|
|
|
12
4
|
/** @group GamePick */
|