@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.
@@ -256,10 +256,8 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
256
256
  * Pass `acknowledge: false` to skip that automatic step.
257
257
  * `playMiniGame` then resolves as soon as the spin result is known,
258
258
  * without waiting for the win to be marked delivered. You finalise
259
- * it later by calling {@link miniGameWinAcknowledgeRequest}. The
260
- * result does NOT carry the spin's request id — obtain it as the
261
- * `client_request_id` of the matching {@link getMiniGamesHistory}
262
- * row (the spin appears there with `is_claimed: false`).
259
+ * it later by calling {@link miniGameWinAcknowledgeRequest} with the
260
+ * `request_id` returned on this result.
263
261
  *
264
262
  * What `acknowledge: false` does and does NOT defer:
265
263
  * - For STANDARD prizes the value is credited at spin time
@@ -374,12 +372,9 @@ export declare class WSAPIMiniGames extends WSAPIRaffles {
374
372
  * // are credited only by the acknowledge below.
375
373
  * console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
376
374
  *
377
- * // The result has no request id — read it from history as client_request_id.
378
- * const [row] = await window._smartico.api.getMiniGamesHistory({ saw_template_id: game.id, limit: 1 });
379
- * if (row && !row.is_claimed) {
380
- * await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);
381
- * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
382
- * }
375
+ * // On the user's Claim click, finalise with the request_id from the result.
376
+ * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
377
+ * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
383
378
  * }
384
379
  * ```
385
380
  */
@@ -98,6 +98,11 @@ export interface TMiniGamePlayResult {
98
98
  * (including `prize_type === 'no-prize'` for a configured loss
99
99
  * slot). Always populated, even when `err_code !== 0`. */
100
100
  prize_id: number;
101
+ /** Correlation id of this spin. Pass it to
102
+ * {@link miniGameWinAcknowledgeRequest} to finalise the win when
103
+ * playing with `acknowledge: false` — no need to look it up via
104
+ * {@link getMiniGamesHistory}. */
105
+ request_id: string;
101
106
  }
102
107
  /**
103
108
  * TMiniGamePlayBatchResult describes one entry in the array returned
package/dist/index.js CHANGED
@@ -7378,10 +7378,8 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
7378
7378
  * Pass `acknowledge: false` to skip that automatic step.
7379
7379
  * `playMiniGame` then resolves as soon as the spin result is known,
7380
7380
  * without waiting for the win to be marked delivered. You finalise
7381
- * it later by calling {@link miniGameWinAcknowledgeRequest}. The
7382
- * result does NOT carry the spin's request id — obtain it as the
7383
- * `client_request_id` of the matching {@link getMiniGamesHistory}
7384
- * row (the spin appears there with `is_claimed: false`).
7381
+ * it later by calling {@link miniGameWinAcknowledgeRequest} with the
7382
+ * `request_id` returned on this result.
7385
7383
  *
7386
7384
  * What `acknowledge: false` does and does NOT defer:
7387
7385
  * - For STANDARD prizes the value is credited at spin time
@@ -7496,12 +7494,9 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
7496
7494
  * // are credited only by the acknowledge below.
7497
7495
  * console.log('[smartico] prize won — show the result / Claim CTA, then finalise');
7498
7496
  *
7499
- * // The result has no request id — read it from history as client_request_id.
7500
- * const [row] = await window._smartico.api.getMiniGamesHistory({ saw_template_id: game.id, limit: 1 });
7501
- * if (row && !row.is_claimed) {
7502
- * await window._smartico.api.miniGameWinAcknowledgeRequest(row.client_request_id);
7503
- * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
7504
- * }
7497
+ * // On the user's Claim click, finalise with the request_id from the result.
7498
+ * await window._smartico.api.miniGameWinAcknowledgeRequest(r.request_id);
7499
+ * console.log('[smartico] win finalised — refresh getUserProfile / getMiniGames to reflect it');
7505
7500
  * }
7506
7501
  * ```
7507
7502
  */
@@ -7521,7 +7516,8 @@ var WSAPIMiniGames = /*#__PURE__*/function (_WSAPIRaffles) {
7521
7516
  var o = {
7522
7517
  err_code: r.errCode,
7523
7518
  err_message: r.errMsg,
7524
- prize_id: r.saw_prize_id
7519
+ prize_id: r.saw_prize_id,
7520
+ request_id: r.request_id
7525
7521
  };
7526
7522
  return o;
7527
7523
  }