@smartico/public-api 0.0.136 → 0.0.138

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.
Files changed (57) hide show
  1. package/dist/Jackpots/JackpotDetails.d.ts +16 -0
  2. package/dist/Jackpots/JackpotPot.d.ts +6 -0
  3. package/dist/Jackpots/JackpotPublicMeta.d.ts +7 -0
  4. package/dist/MiniGames/SAWTemplateUI.d.ts +2 -2
  5. package/dist/SmarticoAPI.d.ts +1 -1
  6. package/dist/SmarticoLib/index.d.ts +4 -2
  7. package/dist/Store/GetStoreHistoryRequest.d.ts +1 -1
  8. package/dist/Store/GetStoreHistoryResponse.d.ts +1 -1
  9. package/dist/WSAPI/WSAPI.d.ts +42 -11
  10. package/dist/WSAPI/WSAPITypes.d.ts +1 -0
  11. package/dist/index.js +51 -22
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.modern.mjs +43 -13
  14. package/dist/index.modern.mjs.map +1 -1
  15. package/docs/README.md +19 -1
  16. package/docs/classes/WSAPI.md +93 -11
  17. package/docs/enums/JackpotContributionType.md +13 -0
  18. package/docs/enums/JackpotType.md +7 -0
  19. package/docs/enums/LeaderBoardPeriodType.md +19 -0
  20. package/docs/enums/SAWGameTypeName.md +6 -0
  21. package/docs/interfaces/AchRelatedGame-1.md +28 -0
  22. package/docs/interfaces/AchRelatedGame.md +14 -12
  23. package/docs/interfaces/GetJackpotsPotsRequest.md +43 -0
  24. package/docs/interfaces/GetJackpotsPotsResponse.md +63 -0
  25. package/docs/interfaces/GetJackpotsRequest.md +49 -0
  26. package/docs/interfaces/GetJackpotsResponse.md +63 -0
  27. package/docs/interfaces/JackPotWinner.md +31 -0
  28. package/docs/interfaces/JackpotDetails.md +85 -0
  29. package/docs/interfaces/JackpotHtmlTemplate.md +13 -0
  30. package/docs/interfaces/JackpotPot.md +41 -0
  31. package/docs/interfaces/JackpotPublicMeta.md +57 -0
  32. package/docs/interfaces/JackpotWinPush.md +49 -0
  33. package/docs/interfaces/JackpotsOptinRequest.md +43 -0
  34. package/docs/interfaces/JackpotsOptinResponse.md +57 -0
  35. package/docs/interfaces/JackpotsOptoutRequest.md +43 -0
  36. package/docs/interfaces/JackpotsOptoutResponse.md +57 -0
  37. package/docs/interfaces/LeaderBoardDetailsT.md +1 -1
  38. package/docs/interfaces/TAchCategory.md +6 -0
  39. package/docs/interfaces/TMiniGameTemplate.md +2 -0
  40. package/docs/interfaces/TMissionOrBadge.md +6 -7
  41. package/docs/interfaces/TStoreCategory.md +6 -0
  42. package/docs/interfaces/TTournament.md +6 -0
  43. package/docs/interfaces/TTournamentDetailed.md +11 -1
  44. package/package.json +1 -1
  45. package/src/Base/AchRelatedGame.ts +3 -1
  46. package/src/Jackpots/JackpotDetails.ts +16 -0
  47. package/src/Jackpots/JackpotPot.ts +7 -1
  48. package/src/Jackpots/JackpotPublicMeta.ts +7 -0
  49. package/src/MiniGames/SAWTemplateUI.ts +2 -2
  50. package/src/SmarticoAPI.ts +5 -6
  51. package/src/SmarticoLib/index.ts +4 -2
  52. package/src/Store/GetStoreHistoryRequest.ts +1 -1
  53. package/src/Store/GetStoreHistoryResponse.ts +1 -1
  54. package/src/Tournaments/Tournament.ts +1 -0
  55. package/src/WSAPI/WSAPI.ts +42 -13
  56. package/src/WSAPI/WSAPITypes.ts +2 -0
  57. package/tsconfig.json +3 -0
@@ -0,0 +1,57 @@
1
+ # Interface: JackpotPublicMeta
2
+
3
+ ## Properties
4
+
5
+ ### name
6
+
7
+ • **name**: `string`
8
+
9
+ name of the jackpot
10
+
11
+ ___
12
+
13
+ ### description
14
+
15
+ • **description**: `string`
16
+
17
+ description/rules of the jackpot
18
+
19
+ ___
20
+
21
+ ### image\_url
22
+
23
+ • **image\_url**: `string`
24
+
25
+ image url of the jackpot
26
+
27
+ ___
28
+
29
+ ### winner\_template
30
+
31
+ • **winner\_template**: [`JackpotHtmlTemplate`](JackpotHtmlTemplate.md)
32
+
33
+ HTML template for the winner of the jackpt
34
+
35
+ ___
36
+
37
+ ### not\_winner\_template
38
+
39
+ • **not\_winner\_template**: [`JackpotHtmlTemplate`](JackpotHtmlTemplate.md)
40
+
41
+ HTML template for the not winner of the jackpot
42
+
43
+ ___
44
+
45
+ ### placeholder1
46
+
47
+ • **placeholder1**: `string`
48
+
49
+ custom value of placeholder1 defined by operator and can be used in the HTML templates
50
+
51
+ ___
52
+
53
+ ### placeholder2
54
+
55
+ • **placeholder2**: `string`
56
+
57
+ custom value of placeholder2 defined by operator and can be used in the HTML templates
@@ -0,0 +1,49 @@
1
+ # Interface: JackpotWinPush
2
+
3
+ ## Hierarchy
4
+
5
+ - `ProtocolMessage`
6
+
7
+ ↳ **`JackpotWinPush`**
8
+
9
+ ## Properties
10
+
11
+ ### cid
12
+
13
+ • **cid**: `number`
14
+
15
+ #### Inherited from
16
+
17
+ ProtocolMessage.cid
18
+
19
+ ___
20
+
21
+ ### ts
22
+
23
+ • `Optional` **ts**: `number`
24
+
25
+ #### Inherited from
26
+
27
+ ProtocolMessage.ts
28
+
29
+ ___
30
+
31
+ ### uuid
32
+
33
+ • `Optional` **uuid**: `string`
34
+
35
+ #### Inherited from
36
+
37
+ ProtocolMessage.uuid
38
+
39
+ ___
40
+
41
+ ### jackpot
42
+
43
+ • **jackpot**: [`JackpotDetails`](JackpotDetails.md)
44
+
45
+ ___
46
+
47
+ ### winners
48
+
49
+ • **winners**: [`JackPotWinner`](JackPotWinner.md)[]
@@ -0,0 +1,43 @@
1
+ # Interface: JackpotsOptinRequest
2
+
3
+ ## Hierarchy
4
+
5
+ - `ProtocolMessage`
6
+
7
+ ↳ **`JackpotsOptinRequest`**
8
+
9
+ ## Properties
10
+
11
+ ### cid
12
+
13
+ • **cid**: `number`
14
+
15
+ #### Inherited from
16
+
17
+ ProtocolMessage.cid
18
+
19
+ ___
20
+
21
+ ### ts
22
+
23
+ • `Optional` **ts**: `number`
24
+
25
+ #### Inherited from
26
+
27
+ ProtocolMessage.ts
28
+
29
+ ___
30
+
31
+ ### uuid
32
+
33
+ • `Optional` **uuid**: `string`
34
+
35
+ #### Inherited from
36
+
37
+ ProtocolMessage.uuid
38
+
39
+ ___
40
+
41
+ ### jp\_template\_id
42
+
43
+ • **jp\_template\_id**: `number`
@@ -0,0 +1,57 @@
1
+ # Interface: JackpotsOptinResponse
2
+
3
+ ## Hierarchy
4
+
5
+ - `ProtocolResponse`
6
+
7
+ ↳ **`JackpotsOptinResponse`**
8
+
9
+ ## Properties
10
+
11
+ ### cid
12
+
13
+ • **cid**: `number`
14
+
15
+ #### Inherited from
16
+
17
+ ProtocolResponse.cid
18
+
19
+ ___
20
+
21
+ ### ts
22
+
23
+ • `Optional` **ts**: `number`
24
+
25
+ #### Inherited from
26
+
27
+ ProtocolResponse.ts
28
+
29
+ ___
30
+
31
+ ### uuid
32
+
33
+ • `Optional` **uuid**: `string`
34
+
35
+ #### Inherited from
36
+
37
+ ProtocolResponse.uuid
38
+
39
+ ___
40
+
41
+ ### errCode
42
+
43
+ • `Optional` **errCode**: `number`
44
+
45
+ #### Inherited from
46
+
47
+ ProtocolResponse.errCode
48
+
49
+ ___
50
+
51
+ ### errMsg
52
+
53
+ • `Optional` **errMsg**: `string`
54
+
55
+ #### Inherited from
56
+
57
+ ProtocolResponse.errMsg
@@ -0,0 +1,43 @@
1
+ # Interface: JackpotsOptoutRequest
2
+
3
+ ## Hierarchy
4
+
5
+ - `ProtocolMessage`
6
+
7
+ ↳ **`JackpotsOptoutRequest`**
8
+
9
+ ## Properties
10
+
11
+ ### cid
12
+
13
+ • **cid**: `number`
14
+
15
+ #### Inherited from
16
+
17
+ ProtocolMessage.cid
18
+
19
+ ___
20
+
21
+ ### ts
22
+
23
+ • `Optional` **ts**: `number`
24
+
25
+ #### Inherited from
26
+
27
+ ProtocolMessage.ts
28
+
29
+ ___
30
+
31
+ ### uuid
32
+
33
+ • `Optional` **uuid**: `string`
34
+
35
+ #### Inherited from
36
+
37
+ ProtocolMessage.uuid
38
+
39
+ ___
40
+
41
+ ### jp\_template\_id
42
+
43
+ • **jp\_template\_id**: `number`
@@ -0,0 +1,57 @@
1
+ # Interface: JackpotsOptoutResponse
2
+
3
+ ## Hierarchy
4
+
5
+ - `ProtocolResponse`
6
+
7
+ ↳ **`JackpotsOptoutResponse`**
8
+
9
+ ## Properties
10
+
11
+ ### cid
12
+
13
+ • **cid**: `number`
14
+
15
+ #### Inherited from
16
+
17
+ ProtocolResponse.cid
18
+
19
+ ___
20
+
21
+ ### ts
22
+
23
+ • `Optional` **ts**: `number`
24
+
25
+ #### Inherited from
26
+
27
+ ProtocolResponse.ts
28
+
29
+ ___
30
+
31
+ ### uuid
32
+
33
+ • `Optional` **uuid**: `string`
34
+
35
+ #### Inherited from
36
+
37
+ ProtocolResponse.uuid
38
+
39
+ ___
40
+
41
+ ### errCode
42
+
43
+ • `Optional` **errCode**: `number`
44
+
45
+ #### Inherited from
46
+
47
+ ProtocolResponse.errCode
48
+
49
+ ___
50
+
51
+ ### errMsg
52
+
53
+ • `Optional` **errMsg**: `string`
54
+
55
+ #### Inherited from
56
+
57
+ ProtocolResponse.errMsg
@@ -36,7 +36,7 @@ ___
36
36
 
37
37
  ### period\_type\_id
38
38
 
39
- • **period\_type\_id**: `LeaderBoardPeriodType`
39
+ • **period\_type\_id**: [`LeaderBoardPeriodType`](../enums/LeaderBoardPeriodType.md)
40
40
 
41
41
  Leaderboard period type ID
42
42
 
@@ -8,14 +8,20 @@ TAchCategory describes the badge category item. Each badge item can be assigned
8
8
 
9
9
  • **id**: `number`
10
10
 
11
+ ID of the badge category
12
+
11
13
  ___
12
14
 
13
15
  ### name
14
16
 
15
17
  • **name**: `string`
16
18
 
19
+ Name of the badge category
20
+
17
21
  ___
18
22
 
19
23
  ### order
20
24
 
21
25
  • **order**: `number`
26
+
27
+ Order of the badge category among other categories. Default value is 1
@@ -143,3 +143,5 @@ ___
143
143
  ### prizes
144
144
 
145
145
  • **prizes**: [`TMiniGamePrize`](TMiniGamePrize.md)[]
146
+
147
+ List of prizes for mini-games
@@ -170,7 +170,7 @@ ___
170
170
 
171
171
  ### related\_games
172
172
 
173
- • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame.md)[]
173
+ • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame-1.md)[]
174
174
 
175
175
  List of casino games (or other types of entities) related to the mission or badge
176
176
 
@@ -232,23 +232,22 @@ The date/timestamp indicating when the prize was claimed by the user
232
232
 
233
233
  ___
234
234
 
235
- ### completed\_date
235
+ ### complete\_date
236
236
 
237
- • `Optional` **completed\_date**: `string`
237
+ • `Optional` **complete\_date**: `string`
238
238
 
239
239
  Time in hours that took this player to complete mission
240
240
 
241
241
  ___
242
242
 
243
- ### completed\_date_ts
243
+ ### complete\_date\_ts
244
244
 
245
- • `Optional` **completed\_date\_ts**: `number`
245
+ • `Optional` **complete\_date\_ts**: `number`
246
246
 
247
247
  Time of mission/badge being completed, this property shows the epoch time in UTC
248
248
 
249
249
  ___
250
250
 
251
-
252
251
  ### completed\_today
253
252
 
254
253
  • `Optional` **completed\_today**: `boolean`
@@ -269,4 +268,4 @@ ___
269
268
 
270
269
  • `Optional` **completed\_this\_month**: `boolean`
271
270
 
272
- Flag for mission/badge indicating that mission/badge completed this month
271
+ Flag for mission/badge indicating that mission/badge completed this month
@@ -8,14 +8,20 @@ TStoreCategory describes the store category item. Each store item can be assigne
8
8
 
9
9
  • **id**: `number`
10
10
 
11
+ ID of the store category
12
+
11
13
  ___
12
14
 
13
15
  ### name
14
16
 
15
17
  • **name**: `string`
16
18
 
19
+ Name of the store category
20
+
17
21
  ___
18
22
 
19
23
  ### order
20
24
 
21
25
  • **order**: `number`
26
+
27
+ Order of the store category among other categories. Default value is 1
@@ -54,6 +54,12 @@ ___
54
54
 
55
55
  ___
56
56
 
57
+ ### image2\_mobile
58
+
59
+ • **image2\_mobile**: `string`
60
+
61
+ ___
62
+
57
63
  ### prize\_pool\_short
58
64
 
59
65
  • **prize\_pool\_short**: `string`
@@ -78,6 +78,16 @@ ___
78
78
 
79
79
  ___
80
80
 
81
+ ### image2\_mobile
82
+
83
+ • **image2\_mobile**: `string`
84
+
85
+ #### Inherited from
86
+
87
+ [TTournament](TTournament.md).[image2_mobile](TTournament.md#image2_mobile)
88
+
89
+ ___
90
+
81
91
  ### prize\_pool\_short
82
92
 
83
93
  • **prize\_pool\_short**: `string`
@@ -365,7 +375,7 @@ ___
365
375
 
366
376
  ### related\_games
367
377
 
368
- • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame.md)[]
378
+ • `Optional` **related\_games**: [`AchRelatedGame`](AchRelatedGame-1.md)[]
369
379
 
370
380
  List of casino games (or other types of entities) related to the tournament
371
381
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.136",
3
+ "version": "0.0.138",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,8 @@
1
1
  interface AchRelatedGame {
2
+ /* ID of the game on Smartico side */
2
3
  ach_game_id: number;
3
- ext_game_id: string;
4
+ /* ID of the game on operator side */
5
+ ext_game_id: string;
4
6
  game_public_meta: {
5
7
  name: string;
6
8
  link: string;
@@ -4,15 +4,31 @@ import { JackpotPot } from "./JackpotPot";
4
4
  import { JackpotPublicMeta } from "./JackpotPublicMeta";
5
5
  import { JackpotType } from "./JackpotType";
6
6
 
7
+ /**
8
+ * JackpotDetails the information about Jackpot template
9
+ * It also includes JackpotPot object that holds the current value of the jackpot
10
+ * Flag is_opted_in indicates if the current user is opted in to the jackpot
11
+ */
7
12
  interface JackpotDetails {
13
+ /** ID of the jackpot template */
8
14
  jp_template_id: number;
15
+ /** type of jackpot logic */
9
16
  jp_type_id: JackpotType;
17
+ /** UI information of jackpot, like name, description, etc. */
10
18
  jp_public_meta: JackpotPublicMeta;
19
+ /** base currency of the jackpot */
11
20
  jp_currency: string;
21
+ /** wallet currency of currently logged in user */
22
+ user_currency: string;
23
+ /** list of related games that are eligible for the jackpot */
12
24
  related_games?: AchRelatedGame[];
25
+ /** type of the user contribution to the jackpot */
13
26
  contribution_type: JackpotContributionType;
27
+ /** value of the user contribution. Fixed amount or percentage of bet depending on the contribution type */
14
28
  contribution_value: number;
29
+ /** information of current value of the jackpot */
15
30
  pot: JackpotPot;
31
+ /** indication if the current user is opted in to the jackpot */
16
32
  is_opted_in: boolean;
17
33
  }
18
34
 
@@ -1,8 +1,14 @@
1
1
 
2
2
  interface JackpotPot {
3
+ /** ID of the jackpot template */
3
4
  jp_template_id: number;
5
+ /** ID of the jackpot pot */
4
6
  jp_pot_id: number;
5
- current_pot_amount: number;
7
+ /** currency of the jackpot pot in the Jackput base currency */
8
+ current_pot_amount: number;
9
+ /** currency of the jackpot pot in the user wallet currency */
10
+ current_pot_amount_user_currency: number;
11
+ /** the date/time when this pot exploded */
6
12
  explode_date_ts: number;
7
13
  }
8
14
 
@@ -1,11 +1,18 @@
1
1
  import { JackpotHtmlTemplate } from './JackpotHtmlTemplate';
2
2
  interface JackpotPublicMeta {
3
+ /** name of the jackpot */
3
4
  name: string;
5
+ /** description/rules of the jackpot */
4
6
  description: string;
7
+ /** image url of the jackpot */
5
8
  image_url: string;
9
+ /** HTML template for the winner of the jackpt */
6
10
  winner_template: JackpotHtmlTemplate;
11
+ /** HTML template for the not winner of the jackpot */
7
12
  not_winner_template: JackpotHtmlTemplate;
13
+ /** custom value of placeholder1 defined by operator and can be used in the HTML templates */
8
14
  placeholder1: string;
15
+ /** custom value of placeholder2 defined by operator and can be used in the HTML templates */
9
16
  placeholder2: string;
10
17
  }
11
18
 
@@ -43,8 +43,8 @@ export interface SAWTemplateUI {
43
43
 
44
44
 
45
45
  // prize drop specific
46
- placeholder_1?: string;
47
- placeholder_2?: string;
46
+ placeholder1?: string;
47
+ placeholder2?: string;
48
48
  prize_drop_template?: {
49
49
  id: string;
50
50
  content: string;
@@ -464,19 +464,18 @@ class SmarticoAPI {
464
464
  public async storeGetCategoriesT(user_ext_id: string): Promise<TStoreCategory[]> {
465
465
  return StoreCategoryTransform((await this.storeGetCategories(user_ext_id)).categories);
466
466
  }
467
-
467
+
468
468
  public async storeGetPurchasedItems(user_ext_id: string, limit: number = 20, offset: number = 0): Promise<GetStoreHistoryResponse> {
469
+
469
470
  const message = this.buildMessage<GetStoreHistoryRequest, GetStoreHistoryResponse>(user_ext_id, ClassId.ACH_SHOP_ITEM_HISTORY_REQUEST, {
470
471
  limit,
471
- offset,
472
+ offset
472
473
  });
474
+
473
475
  return await this.send<GetStoreHistoryResponse>(message, ClassId.ACH_SHOP_ITEM_HISTORY_RESPONSE);
474
476
  }
475
477
 
476
- public async storeGetPurchasedItemsT(user_ext_id: string, from: number = 0, to: number = 20): Promise<TStoreItem[]> {
477
- const limit = (to - from) > 20 ? 20 : to - from;
478
- const offset = from;
479
-
478
+ public async storeGetPurchasedItemsT(user_ext_id: string, limit?: number, offset?: number): Promise<TStoreItem[]> {
480
479
  return StoreItemPurchasedTransform((await this.storeGetPurchasedItems(user_ext_id, limit, offset)).items);
481
480
  }
482
481
 
@@ -410,8 +410,8 @@ export interface SAWTemplateUI {
410
410
  custom_section_id?: number;
411
411
  only_in_custom_section?: boolean;
412
412
  custom_data: any;
413
- placeholder_1?: string;
414
- placeholder_2?: string;
413
+ placeholder1?: string;
414
+ placeholder2?: string;
415
415
  prize_drop_template?: {
416
416
  id: string;
417
417
  content: string;
@@ -514,6 +514,8 @@ export interface TournamentPublicMeta {
514
514
  image_url?: string;
515
515
  /** 2nd image */
516
516
  image_url2?: string;
517
+ /** 2nd image for mobile */
518
+ image_url2_mobile?: string;
517
519
  /** Description, html capable */
518
520
  description?: string;
519
521
  /** Short explanation of prize pool */
@@ -1,6 +1,6 @@
1
1
  import { ProtocolMessage } from "../Base/ProtocolMessage";
2
2
 
3
3
  export interface GetStoreHistoryRequest extends ProtocolMessage {
4
- offset?: number;
5
4
  limit?: number;
5
+ offset?: number;
6
6
  }
@@ -3,5 +3,5 @@ import { StoreItemPurchased } from "./StoreItemPurchased";
3
3
 
4
4
  export interface GetStoreHistoryResponse extends ProtocolResponse {
5
5
  items: StoreItemPurchased[];
6
- hasMore: boolean;
6
+ hasMore?: boolean;
7
7
  }
@@ -73,6 +73,7 @@ export const TournamentItemsTransform = (items: Tournament[]): TTournament[] =>
73
73
  segment_dont_match_message: r.publicMeta.segment_dont_match_message,
74
74
  image1: r.publicMeta.image_url,
75
75
  image2: r.publicMeta.image_url2,
76
+ image2_mobile: r.publicMeta.image_url2_mobile,
76
77
  prize_pool_short: r.publicMeta.prize_pool_short,
77
78
  custom_price_text: r.publicMeta.custom_price_text,
78
79
  custom_section_id: r.publicMeta.custom_section_id,