@smartico/public-api 0.0.166 → 0.0.167

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.
@@ -1296,6 +1296,9 @@ class WSAPI {
1296
1296
  }
1297
1297
  /**
1298
1298
  * Returns all the bonuses for the current user
1299
+ * The returned bonuss are cached for 30 seconds. But you can pass the onUpdate callback as a parameter.
1300
+ * Note that each time you call getBonuses with a new onUpdate callback, the old one will be overwritten by the new one.
1301
+ * The onUpdate callback will be called on bonus claimed and the updated bonuses will be passed to it.
1299
1302
  *
1300
1303
  * **Visitor mode: not supported**
1301
1304
  */
@@ -1858,6 +1861,28 @@ class WSAPI {
1858
1861
  const result = await this.api.jackpotOptOut(null, filter);
1859
1862
  return result;
1860
1863
  }
1864
+ /**
1865
+ * Returns all the related tournaments and missions for the provided game id for the current user
1866
+ * The provided Game ID should correspond to the ID from the Games Catalog - https://help.smartico.ai/welcome/technical-guides/games-catalog-api
1867
+ *
1868
+ * **Example**:
1869
+ * ```
1870
+ * _smartico.api.getRelatedItemsForGame('gold-slot2').then((result) => {
1871
+ * console.log(result);
1872
+ * });
1873
+ * ```
1874
+ *
1875
+ * **Example in the Visitor mode**:
1876
+ * ```
1877
+ * _smartico.vapi('EN').getRelatedItemsForGame('gold-slot2').then((result) => {
1878
+ * console.log(result);
1879
+ * });
1880
+ * ```
1881
+ */
1882
+ async getRelatedItemsForGame(related_game_id) {
1883
+ const result = await this.api.getRelatedItemsForGame(null, related_game_id);
1884
+ return result;
1885
+ }
1861
1886
  }
1862
1887
 
1863
1888
  const pointsRewardTransform = reward_points => {
@@ -2533,6 +2558,12 @@ class SmarticoAPI {
2533
2558
  getWSCalls() {
2534
2559
  return new WSAPI(this);
2535
2560
  }
2561
+ async getRelatedItemsForGame(user_ext_id, related_game_id) {
2562
+ const message = this.buildMessage(user_ext_id, ClassId.GET_RELATED_ACH_N_TOURNAMENTS_REQUEST, {
2563
+ related_game_id: related_game_id
2564
+ });
2565
+ return await this.send(message, ClassId.GET_RELATED_ACH_N_TOURNAMENTS_RESPONSE);
2566
+ }
2536
2567
  }
2537
2568
 
2538
2569
  class CookieStore {