@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/dist/WSAPI/WSAPIMiniGames.d.ts +5 -10
- package/dist/WSAPI/WSAPITypes.d.ts +5 -0
- package/dist/index.js +7 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +7 -11
- package/dist/index.modern.mjs.map +1 -1
- package/package.json +1 -1
- package/src/WSAPI/WSAPIMiniGames.ts +6 -10
- package/src/WSAPI/WSAPITypes.ts +5 -0
package/package.json
CHANGED
|
@@ -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}
|
|
291
|
-
*
|
|
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
|
-
* //
|
|
409
|
-
*
|
|
410
|
-
*
|
|
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;
|
package/src/WSAPI/WSAPITypes.ts
CHANGED
|
@@ -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
|
/**
|