@jetthai/cuora 1.1.254 → 1.1.256-jackpot-1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.256-jackpot-1](https://github.com/jetthai/cuora-module/compare/v1.1.256...v1.1.256-jackpot-1) (2024-05-07)
6
+
7
+ ### [1.1.256](https://github.com/jetthai/cuora-module/compare/v1.1.255...v1.1.256) (2024-05-03)
8
+
9
+ ### [1.1.255](https://github.com/jetthai/cuora-module/compare/v1.1.254...v1.1.255) (2024-05-03)
10
+
5
11
  ### [1.1.254](https://github.com/jetthai/cuora-module/compare/v1.1.253...v1.1.254) (2024-05-03)
6
12
 
7
13
  ### [1.1.253](https://github.com/jetthai/cuora-module/compare/v1.1.252...v1.1.253) (2024-05-02)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.254",
3
+ "version": "1.1.256-jackpot-1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/game.js CHANGED
@@ -89,6 +89,11 @@ export default {
89
89
  method: 'get',
90
90
  params: { timestamp },
91
91
  }),
92
+ getJackpotList: ({ appSecret }) => ({
93
+ url: 'activities/jackpot/list',
94
+ method: 'get',
95
+ params: { appSecret },
96
+ }),
92
97
  addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
93
98
  removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
94
99
  }
@@ -86,12 +86,12 @@ export default {
86
86
  method: 'post',
87
87
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
88
88
  }),
89
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
89
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt }) => ({
90
90
  url: `payment/v2/${method}/transaction`,
91
91
  method: 'post',
92
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
92
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt },
93
93
  }),
94
- submitDepositTransactionCryptoBank: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, depositTime }) => ({
94
+ submitDepositTransactionCryptoBank: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, depositTime, receipt }) => ({
95
95
  url: `payment/v2/${method}/transaction`,
96
96
  method: 'post',
97
97
  params: {
@@ -102,6 +102,7 @@ export default {
102
102
  sourceAddress,
103
103
  promotionsNo,
104
104
  depositTime,
105
+ receipt,
105
106
  },
106
107
  }),
107
108
  submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
@@ -5,6 +5,7 @@ import { GAME_SEARCH } from '../util/constant.js'
5
5
 
6
6
  // 對應 intersectionObserver 版本
7
7
  export default function (request) {
8
+ const { appSecret } = request.config
8
9
  return createMachine(
9
10
  {
10
11
  id: 'game',
@@ -22,12 +23,14 @@ export default function (request) {
22
23
  parentCategoryId: null,
23
24
  totalPage: 0,
24
25
  },
26
+ jackpots: [],
25
27
  additionEnable: false,
26
28
  addition: {
27
29
  data: [],
28
30
  timestamp: null,
29
31
  totalPage: 0,
30
32
  },
33
+ isJackpot: true,
31
34
  staticData: [],
32
35
  // play params
33
36
  game: {
@@ -59,6 +62,9 @@ export default function (request) {
59
62
  SET_ADDITION_ENABLE: {
60
63
  actions: 'setAdditionEnable',
61
64
  },
65
+ SET_IS_JACKPOT: {
66
+ actions: 'setIsJackpot',
67
+ },
62
68
  LOAD: {
63
69
  target: 'routing',
64
70
  actions: 'setLoadable',
@@ -248,6 +254,11 @@ export default function (request) {
248
254
  additionEnable: event.data,
249
255
  }
250
256
  }),
257
+ setIsJackpot: assign((context, event) => {
258
+ return {
259
+ isJackpot: event.data,
260
+ }
261
+ }),
251
262
  setLoadable: assign((context, event) => {
252
263
  return {
253
264
  loadable: event.data,
@@ -288,9 +299,14 @@ export default function (request) {
288
299
  }
289
300
  }),
290
301
  appendContent: assign((context, event) => {
291
- const { room, additionEnable } = context
302
+ const { room, additionEnable, isJackpot } = context
292
303
  if (room.categoryId === GAME_SEARCH) {
293
304
  return
305
+ } else if (isJackpot) {
306
+ const [jackpots] = event.data
307
+ return {
308
+ jackpots,
309
+ }
294
310
  } else if (additionEnable) {
295
311
  const [content, addition] = event.data
296
312
  return {
@@ -415,9 +431,11 @@ export default function (request) {
415
431
  }
416
432
  },
417
433
  getPageContent: async (context, event) => {
418
- const { room, index, additionEnable, staticData } = context
434
+ const { room, index, additionEnable, isJackpot, staticData } = context
419
435
  if (room.categoryId === GAME_SEARCH) {
420
436
  return
437
+ } else if (isJackpot) {
438
+ return await Promise.all([request.send(api.getJackpotList({ appSecret }))])
421
439
  } else if (!request.getToken()) {
422
440
  const list = staticData.find((data) => data.category == room.categoryId)?.info || []
423
441