@smartico/public-api 0.0.382 → 0.0.384
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/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 +151 -15
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +151 -16
- 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/SmarticoAPI.ts +1 -7
- package/src/WSAPI/WSAPIBase.ts +1 -1
- package/src/WSAPI/WSAPIBonuses.ts +1 -1
- package/src/WSAPI/WSAPIClans.ts +1 -1
- package/src/WSAPI/WSAPIGamePick.ts +1 -9
- package/src/WSAPI/WSAPIInbox.ts +2 -2
- package/src/WSAPI/WSAPIJackpots.ts +1 -1
- package/src/WSAPI/WSAPIMiniGames.ts +3 -3
- package/src/WSAPI/WSAPIMissions.ts +1 -1
- package/src/WSAPI/WSAPIRaffles.ts +1 -1
- package/src/WSAPI/WSAPIStore.ts +2 -2
- package/src/WSAPI/WSAPITournaments.ts +1 -1
- package/src/WSAPI/WSAPITypes.ts +2 -471
- package/src/WSAPI/WSAPIUser.ts +1 -1
- 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
|
+
}
|
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';
|
package/src/WSAPI/WSAPIBase.ts
CHANGED
|
@@ -133,7 +133,7 @@ export class WSAPIBonuses extends WSAPIMissions {
|
|
|
133
133
|
* ```
|
|
134
134
|
*/
|
|
135
135
|
public async getBonuses({ onUpdate }: { onUpdate?: (data: TBonus[]) => void } = {}): Promise<TBonus[]> {
|
|
136
|
-
if (onUpdate) {
|
|
136
|
+
if (typeof onUpdate === 'function') {
|
|
137
137
|
this.onUpdateCallback.set(onUpdateContextKey.Bonuses, onUpdate);
|
|
138
138
|
}
|
|
139
139
|
|
package/src/WSAPI/WSAPIClans.ts
CHANGED
|
@@ -134,7 +134,7 @@ export class WSAPIClans extends WSAPITournaments {
|
|
|
134
134
|
* ```
|
|
135
135
|
*/
|
|
136
136
|
public async getClans({ onUpdate }: { onUpdate?: (data: TClans) => void } = {}): Promise<TClans> {
|
|
137
|
-
if (onUpdate) {
|
|
137
|
+
if (typeof onUpdate === 'function') {
|
|
138
138
|
this.onUpdateCallback.set(onUpdateContextKey.Clans, onUpdate);
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -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 */
|
package/src/WSAPI/WSAPIInbox.ts
CHANGED
|
@@ -265,7 +265,7 @@ export class WSAPIInbox extends WSAPILeaderBoard {
|
|
|
265
265
|
read_status?: InboxReadStatus;
|
|
266
266
|
onUpdate?: (data: TInboxMessage[]) => void;
|
|
267
267
|
} = {}): Promise<TInboxMessage[]> {
|
|
268
|
-
if (onUpdate) {
|
|
268
|
+
if (typeof onUpdate === 'function') {
|
|
269
269
|
this.onUpdateCallback.set(onUpdateContextKey.InboxMessages, onUpdate);
|
|
270
270
|
}
|
|
271
271
|
return await this.api.getInboxMessagesT(this.userExtId, from, to, onlyFavorite, categoryId, read_status);
|
|
@@ -321,7 +321,7 @@ export class WSAPIInbox extends WSAPILeaderBoard {
|
|
|
321
321
|
* ```
|
|
322
322
|
*/
|
|
323
323
|
public async getInboxUnreadCount({ onUpdate }: { onUpdate?: (unread_count: number) => void } = {}): Promise<number> {
|
|
324
|
-
if (onUpdate) {
|
|
324
|
+
if (typeof onUpdate === 'function') {
|
|
325
325
|
this.onUpdateCallback.set(onUpdateContextKey.InboxUnreadCount, onUpdate);
|
|
326
326
|
}
|
|
327
327
|
return OCache.use(
|
|
@@ -434,7 +434,7 @@ export class WSAPIJackpots extends WSAPIClans {
|
|
|
434
434
|
/** Optional callback; not auto-invoked today. */
|
|
435
435
|
onUpdate?: () => void,
|
|
436
436
|
}): Promise<TGetJackpotEligibleGamesResponse> {
|
|
437
|
-
if (onUpdate) {
|
|
437
|
+
if (typeof onUpdate === 'function') {
|
|
438
438
|
this.onUpdateCallback.set(onUpdateContextKey.JackpotEligibleGames, onUpdate);
|
|
439
439
|
}
|
|
440
440
|
|
|
@@ -111,7 +111,7 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
111
111
|
public async getMiniGames({ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {}): Promise<
|
|
112
112
|
TMiniGameTemplate[]
|
|
113
113
|
> {
|
|
114
|
-
if (onUpdate) {
|
|
114
|
+
if (typeof onUpdate === 'function') {
|
|
115
115
|
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -369,7 +369,7 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
369
369
|
template_id: number,
|
|
370
370
|
{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},
|
|
371
371
|
): Promise<TMiniGamePlayResult> {
|
|
372
|
-
if (onUpdate) {
|
|
372
|
+
if (typeof onUpdate === 'function') {
|
|
373
373
|
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
374
374
|
}
|
|
375
375
|
|
|
@@ -558,7 +558,7 @@ export class WSAPIMiniGames extends WSAPIRaffles {
|
|
|
558
558
|
spin_count: number,
|
|
559
559
|
{ onUpdate }: { onUpdate?: (data: TMiniGameTemplate[]) => void } = {},
|
|
560
560
|
): Promise<TMiniGamePlayBatchResult[]> {
|
|
561
|
-
if (onUpdate) {
|
|
561
|
+
if (typeof onUpdate === 'function') {
|
|
562
562
|
this.onUpdateCallback.set(onUpdateContextKey.Saw, onUpdate);
|
|
563
563
|
}
|
|
564
564
|
|
|
@@ -138,7 +138,7 @@ export class WSAPIMissions extends WSAPIGeneral {
|
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
140
|
public async getMissions({ onUpdate }: { onUpdate?: (data: TMissionOrBadge[]) => void } = {}): Promise<TMissionOrBadge[]> {
|
|
141
|
-
if (onUpdate) {
|
|
141
|
+
if (typeof onUpdate === 'function') {
|
|
142
142
|
this.onUpdateCallback.set(onUpdateContextKey.Missions, onUpdate);
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -133,7 +133,7 @@ export class WSAPIRaffles extends WSAPIJackpots {
|
|
|
133
133
|
* ```
|
|
134
134
|
*/
|
|
135
135
|
public async getRaffles({ onUpdate }: { onUpdate?: (data: TRaffle[]) => void } = {}): Promise<TRaffle[]> {
|
|
136
|
-
if (onUpdate) {
|
|
136
|
+
if (typeof onUpdate === 'function') {
|
|
137
137
|
this.onUpdateCallback.set(onUpdateContextKey.Raffles, onUpdate);
|
|
138
138
|
}
|
|
139
139
|
|
package/src/WSAPI/WSAPIStore.ts
CHANGED
|
@@ -194,7 +194,7 @@ export class WSAPIStore extends WSAPIBonuses {
|
|
|
194
194
|
* ```
|
|
195
195
|
*/
|
|
196
196
|
public async getStoreItems({ onUpdate }: { onUpdate?: (data: TStoreItem[]) => void } = {}): Promise<TStoreItem[]> {
|
|
197
|
-
if (onUpdate) {
|
|
197
|
+
if (typeof onUpdate === 'function') {
|
|
198
198
|
this.onUpdateCallback.set(onUpdateContextKey.StoreItems, onUpdate);
|
|
199
199
|
}
|
|
200
200
|
return OCache.use(
|
|
@@ -696,7 +696,7 @@ export class WSAPIStore extends WSAPIBonuses {
|
|
|
696
696
|
const requestOffset = offset === undefined ? 0 : offset;
|
|
697
697
|
const cacheKey = this.storeHistoryCacheKey(requestLimit, requestOffset);
|
|
698
698
|
|
|
699
|
-
if (onUpdate) {
|
|
699
|
+
if (typeof onUpdate === 'function') {
|
|
700
700
|
this.onUpdateCallback.set(onUpdateContextKey.StoreHistory, onUpdate);
|
|
701
701
|
this.storeHistoryOnUpdateParams = { limit: requestLimit, offset: requestOffset };
|
|
702
702
|
}
|
|
@@ -138,7 +138,7 @@ export class WSAPITournaments extends WSAPIStore {
|
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
140
|
public async getTournamentsList({ onUpdate }: { onUpdate?: (data: TTournament[]) => void } = {}): Promise<TTournament[]> {
|
|
141
|
-
if (onUpdate) {
|
|
141
|
+
if (typeof onUpdate === 'function') {
|
|
142
142
|
this.onUpdateCallback.set(onUpdateContextKey.TournamentList, onUpdate);
|
|
143
143
|
}
|
|
144
144
|
|