@smartico/public-api 0.0.399 → 0.0.400

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartico/public-api",
3
- "version": "0.0.399",
3
+ "version": "0.0.400",
4
4
  "description": "Smartico public API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -287,10 +287,8 @@ export class WSAPIMiniGames extends WSAPIRaffles {
287
287
  * Pass `acknowledge: false` to skip that automatic step.
288
288
  * `playMiniGame` then resolves as soon as the spin result is known,
289
289
  * without waiting for the win to be marked delivered. You finalise
290
- * it later by calling {@link miniGameWinAcknowledgeRequest}. The
291
- * result does NOT carry the spin's request id — obtain it as the
292
- * `client_request_id` of the matching {@link getMiniGamesHistory}
293
- * row (the spin appears there with `is_claimed: false`).
290
+ * it later by calling {@link miniGameWinAcknowledgeRequest} with the
291
+ * `request_id` returned on this result.
294
292
  *
295
293
  * What `acknowledge: false` does and does NOT defer:
296
294
  * - For STANDARD prizes the value is credited at spin time
@@ -405,12 +403,9 @@ export class WSAPIMiniGames extends WSAPIRaffles {
405
403
  * // are credited only by the acknowledge below.
406
404
  * console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
407
405
  *
408
- * // The result has no request id — read it from history as client_request_id.
409
- * const [row] = await window._smartico.api.getMiniGamesHistory({ saw_template_id: game.id, limit: 1 });
410
- * if (row && !row.is_claimed) {
411
- * await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);
412
- * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
413
- * }
406
+ * // On the user's Claim click, finalise with the request_id from the result.
407
+ * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
408
+ * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
414
409
  * }
415
410
  * ```
416
411
  */
@@ -430,6 +425,7 @@ export class WSAPIMiniGames extends WSAPIRaffles {
430
425
  err_code: r.errCode,
431
426
  err_message: r.errMsg,
432
427
  prize_id: r.saw_prize_id,
428
+ request_id: r.request_id,
433
429
  };
434
430
 
435
431
  return o;
@@ -102,6 +102,11 @@ export interface TMiniGamePlayResult {
102
102
  * (including `prize_type === 'no-prize'` for a configured loss
103
103
  * slot). Always populated, even when `err_code !== 0`. */
104
104
  prize_id: number;
105
+ /** Correlation id of this spin. Pass it to
106
+ * {@link miniGameWinAcknowledgeRequest} to finalise the win when
107
+ * playing with `acknowledge: false` — no need to look it up via
108
+ * {@link getMiniGamesHistory}. */
109
+ request_id: string;
105
110
  }
106
111
 
107
112
  /**