@jetthai/cuora 1.0.302-sl-2 → 1.1.0

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +3 -848
  2. package/README.md +0 -6
  3. package/dist/bundle.mjs +18461 -0
  4. package/package.json +9 -6
  5. package/rollup.config.js +16 -0
  6. package/src/api/activity.js +2 -43
  7. package/src/api/auth.js +7 -22
  8. package/src/api/common.js +1 -3
  9. package/src/api/game.js +7 -20
  10. package/src/api/mailbox.js +5 -9
  11. package/src/api/payment.js +19 -167
  12. package/src/api/user.js +0 -7
  13. package/src/machine/activity/activity.js +26 -111
  14. package/src/machine/activity/{friend_invite_friends_activity.js → affiliate_invite_friends_activity.js} +41 -70
  15. package/src/machine/activity/continue_deposit_activity.js +2 -11
  16. package/src/machine/activity/deposit_activity.js +4 -13
  17. package/src/machine/activity/diamond_shop_activity_vn.js +89 -54
  18. package/src/machine/activity/fafafa_activity.js +19 -34
  19. package/src/machine/activity/index.js +4 -22
  20. package/src/machine/activity/invite_friends_activity.js +14 -14
  21. package/src/machine/activity/ranking_activity.js +2 -11
  22. package/src/machine/activity/sign_in_activity.js +14 -21
  23. package/src/machine/activity/specify_bets_activity.js +3 -25
  24. package/src/machine/activity/specify_turnover_activity.js +3 -25
  25. package/src/machine/activity/time_bomb_activity.js +2 -11
  26. package/src/machine/auth.js +21 -134
  27. package/src/machine/auth_otp.js +201 -0
  28. package/src/machine/auth_otp_v2.js +4 -10
  29. package/src/machine/auth_otp_v3.js +3 -11
  30. package/src/machine/bank_binding.js +12 -112
  31. package/src/machine/common.js +25 -113
  32. package/src/machine/deposit/crypto.js +29 -50
  33. package/src/machine/deposit/crypto_button.js +39 -174
  34. package/src/machine/deposit/deposit_fc.js +5 -8
  35. package/src/machine/deposit/direct.js +16 -111
  36. package/src/machine/deposit/index.js +2 -43
  37. package/src/machine/deposit/loadcard_vn.js +43 -191
  38. package/src/machine/deposit/manual_vn.js +60 -182
  39. package/src/machine/deposit/qrcode_v2.js +52 -285
  40. package/src/machine/deposit/qrcode_vn.js +206 -0
  41. package/src/machine/game.js +285 -0
  42. package/src/machine/game_favorite.js +123 -0
  43. package/src/machine/game_favorite_v2.js +28 -74
  44. package/src/machine/game_search.js +244 -0
  45. package/src/machine/game_search_v2.js +24 -64
  46. package/src/machine/game_v2.js +356 -0
  47. package/src/machine/inbox.js +34 -259
  48. package/src/machine/index.js +17 -24
  49. package/src/machine/leaderboard.js +8 -31
  50. package/src/machine/reward.js +7 -74
  51. package/src/machine/setting.js +2 -5
  52. package/src/machine/side_v2.js +28 -33
  53. package/src/machine/user_sign_up.js +17 -117
  54. package/src/machine/{withdraw/withdraw_crypto.js → withdraw_crypto.js} +69 -220
  55. package/src/machine/{withdraw/withdraw_fc.js → withdraw_fc.js} +2 -2
  56. package/src/machine/{withdraw/withdraw_amb.js → withdraw_vn.js} +78 -146
  57. package/src/request/request.js +5 -10
  58. package/src/util/constant.js +1 -19
  59. package/src/util/deviceToken.js +8 -18
  60. package/src/util/index.js +1 -2
  61. package/src/util/storage.js +22 -22
  62. package/.husky/pre-commit +0 -4
  63. package/.prettierignore +0 -1
  64. package/src/lib/fingerprint.js +0 -9779
  65. package/src/machine/activity/activity_cash.js +0 -159
  66. package/src/machine/activity/cash_rain_activity.js +0 -153
  67. package/src/machine/activity/diamond_shop_activity_cash.js +0 -179
  68. package/src/machine/activity/instant_rebate_activity.js +0 -217
  69. package/src/machine/activity/jackpot.js +0 -74
  70. package/src/machine/activity/otp_verified_activity.js +0 -74
  71. package/src/machine/activity/roulette_activity_v2.js +0 -90
  72. package/src/machine/activity/sign_in_monthly_activity.js +0 -65
  73. package/src/machine/activity/vip_card_activity.js +0 -140
  74. package/src/machine/bank_binding_amb.js +0 -145
  75. package/src/machine/deposit/amb.js +0 -92
  76. package/src/machine/deposit/crypto_bank.js +0 -317
  77. package/src/machine/deposit/crypto_bank_cash.js +0 -287
  78. package/src/machine/deposit/crypto_cash.js +0 -255
  79. package/src/machine/deposit/crypto_qrcode.js +0 -148
  80. package/src/machine/deposit/crypto_qrcode_cash.js +0 -131
  81. package/src/machine/deposit/crypto_way.js +0 -239
  82. package/src/machine/deposit/crypto_way_cash.js +0 -256
  83. package/src/machine/deposit/direct_cash.js +0 -217
  84. package/src/machine/deposit/float.js +0 -366
  85. package/src/machine/deposit/krway.js +0 -151
  86. package/src/machine/deposit/loadcard_cash.js +0 -207
  87. package/src/machine/deposit/manual_cash.js +0 -356
  88. package/src/machine/deposit/qrcode_cash.js +0 -217
  89. package/src/machine/deposit/usdt.js +0 -144
  90. package/src/machine/deposit/usdt_cash.js +0 -138
  91. package/src/machine/deposit/vpay.js +0 -359
  92. package/src/machine/game_info.js +0 -57
  93. package/src/machine/game_search_cash.js +0 -390
  94. package/src/machine/game_v2_1.js +0 -662
  95. package/src/machine/honor_board_cash.js +0 -63
  96. package/src/machine/navbar.js +0 -57
  97. package/src/machine/promotions.js +0 -171
  98. package/src/machine/reward_cash.js +0 -219
  99. package/src/machine/roulette_v2.js +0 -276
  100. package/src/machine/side_cash.js +0 -110
  101. package/src/machine/user_photo.js +0 -65
  102. package/src/machine/withdraw/index.js +0 -23
  103. package/src/machine/withdraw/withdraw_crypto2.js +0 -540
  104. package/src/machine/withdraw/withdraw_crypto_cash.js +0 -319
  105. package/src/machine/withdraw/withdraw_krway.js +0 -207
  106. package/src/machine/withdraw/withdraw_manual.js +0 -595
  107. package/src/machine/withdraw/withdraw_manual_cash.js +0 -303
  108. package/src/machine/withdraw/withdraw_vn.js +0 -533
  109. package/src/machine/withdraw/withdraw_vn2.js +0 -548
  110. package/src/util/math.js +0 -4
@@ -1,15 +1,12 @@
1
1
  import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
- import common from '../../api/common.js'
4
3
 
5
4
  export default function (request) {
6
- const { appSecret } = request.config
7
5
  return createMachine(
8
6
  {
9
7
  id: 'loadcard',
10
8
  initial: 'loading',
11
9
  context: {
12
- siteConfig: null,
13
10
  cards: [],
14
11
  options: [],
15
12
 
@@ -20,22 +17,17 @@ export default function (request) {
20
17
 
21
18
  calculation: null,
22
19
 
23
- paymentDetail: [],
20
+ paymentDetails: [],
24
21
  currentCategory: 'loadcard',
25
22
  currentMethod: null,
26
23
  currentPayment: null,
27
- result: null,
28
-
29
- // use for wallet mode 4
30
- promotion: null,
31
- bonusPreviewData: [],
32
24
  },
33
25
  states: {
34
26
  loading: {
35
27
  invoke: {
36
28
  src: 'fetchInitData',
37
29
  onDone: {
38
- target: 'checking',
30
+ target: 'loaded',
39
31
  actions: 'setInitData',
40
32
  },
41
33
  onError: {
@@ -43,72 +35,15 @@ export default function (request) {
43
35
  },
44
36
  },
45
37
  },
46
- checking: {
47
- always: [
48
- {
49
- target: 'fetching',
50
- cond: (context, event) => {
51
- const { siteConfig = {}, promotion = {}, selectedCard } = context
52
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
53
- return !!selectedCard && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
54
- },
55
- },
56
- { target: 'loaded' },
57
- ],
58
- },
59
- fetching: {
60
- invoke: {
61
- src: 'fetchBonusPreview',
62
- onDone: {
63
- target: 'loaded',
64
- actions: 'setBonusPreview',
65
- },
66
- onError: {
67
- target: 'loaded',
68
- },
69
- },
70
- },
71
- fail: {},
72
38
  loaded: {
73
39
  entry: 'reset',
74
40
  on: {
75
- SELECT_CARD: [
76
- {
77
- target: 'fetching',
78
- actions: 'setCard',
79
- cond: (context, event) => {
80
- const { siteConfig = {}, promotion = {} } = context
81
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
82
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
83
- },
84
- },
85
- {
86
- actions: 'setCard',
87
- },
88
- ],
89
- SELECT_AMOUNT: [
90
- {
91
- target: 'pending',
92
- actions: 'setAmount',
93
- cond: 'isFreeWalletMode',
94
- },
95
- {
96
- target: 'debouncing',
97
- actions: 'setAmount',
98
- },
99
- ],
100
- },
101
- },
102
- pending: {
103
- on: {
104
- SELECT_AMOUNT: {
105
- actions: 'setAmount',
41
+ SELECT_CARD: {
42
+ actions: 'setCard',
106
43
  },
107
- CONFIRM: {
44
+ SELECT_AMOUNT: {
108
45
  target: 'debouncing',
109
- },
110
- BACK: {
111
- target: 'loaded',
46
+ actions: 'setAmount',
112
47
  },
113
48
  },
114
49
  },
@@ -128,67 +63,43 @@ export default function (request) {
128
63
  },
129
64
  },
130
65
  },
131
- calculating: {
132
- invoke: {
133
- src: 'fetchCalculation',
134
- onDone: [
135
- {
136
- target: 'submitting',
137
- actions: 'setCalculation',
138
- cond: (context, event) => {
139
- const { siteConfig = {}, selectedCard = {} } = context
140
- return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
141
- },
142
- },
143
- {
144
- target: 'cardInfo',
145
- actions: 'setCalculation',
146
- cond: 'isFreeWalletMode',
147
- },
148
- {
149
- target: 'calculated',
150
- actions: 'setCalculation',
151
- },
152
- ],
153
- onError: {
154
- target: 'calculable',
155
- },
156
- },
157
- },
66
+ fail: {},
158
67
  calculable: {
159
68
  entry: 'clearCalculation',
160
69
  on: {
161
- SELECT_AMOUNT: [
162
- {
163
- target: 'pending',
164
- actions: 'setAmount',
165
- cond: 'isFreeWalletMode',
166
- },
167
- {
168
- target: 'debouncing',
169
- actions: 'setAmount',
170
- },
171
- ],
70
+ SELECT_AMOUNT: {
71
+ target: 'debouncing',
72
+ actions: 'setAmount',
73
+ },
74
+ CALCULATE: {
75
+ target: 'debouncing',
76
+ },
172
77
  BACK: {
173
78
  target: 'loaded',
174
79
  },
175
80
  },
176
81
  },
82
+ calculating: {
83
+ invoke: {
84
+ src: 'fetchCalculation',
85
+ onDone: {
86
+ target: 'calculated',
87
+ actions: 'setCalculation',
88
+ },
89
+ onError: {
90
+ target: 'calculable',
91
+ },
92
+ },
93
+ },
177
94
  calculated: {
178
95
  on: {
179
96
  SELECT_AMOUNT: {
180
97
  target: 'debouncing',
181
98
  actions: 'setAmount',
182
99
  },
183
- CONFIRM: [
184
- {
185
- target: 'submitting',
186
- cond: 'jumpLinkEnable',
187
- },
188
- {
189
- target: 'cardInfo',
190
- },
191
- ],
100
+ CONFIRM: {
101
+ target: 'cardInfo',
102
+ },
192
103
  BACK: {
193
104
  target: 'loaded',
194
105
  },
@@ -210,21 +121,10 @@ export default function (request) {
210
121
  target: 'submitting',
211
122
  cond: 'isSubmittable',
212
123
  },
213
- SELECT_CARD: [
214
- {
215
- target: 'fetching',
216
- actions: 'setCard',
217
- cond: (context, event) => {
218
- const { siteConfig = {}, promotion = {} } = context
219
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
220
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
221
- },
222
- },
223
- {
224
- target: 'loaded',
225
- actions: 'setCard',
226
- },
227
- ],
124
+ SELECT_CARD: {
125
+ target: 'loaded',
126
+ actions: 'setCard',
127
+ },
228
128
  },
229
129
  },
230
130
  submitting: {
@@ -232,10 +132,9 @@ export default function (request) {
232
132
  src: 'submitDeposit',
233
133
  onDone: {
234
134
  target: 'submitted',
235
- actions: 'setResult',
236
135
  },
237
136
  onError: {
238
- target: 'loaded',
137
+ target: 'cardInfo',
239
138
  },
240
139
  },
241
140
  },
@@ -247,11 +146,6 @@ export default function (request) {
247
146
  },
248
147
  },
249
148
  },
250
- on: {
251
- SET_PROMOTION: {
252
- actions: 'setPromotion',
253
- },
254
- },
255
149
  },
256
150
  {
257
151
  actions: {
@@ -261,25 +155,17 @@ export default function (request) {
261
155
  cardNumber: null,
262
156
  serialNumber: null,
263
157
  calculation: null,
264
- result: null,
265
158
  }
266
159
  }),
267
160
  setInitData: assign((context, event) => {
268
- const { siteConfig, paymentDetail } = event.data
269
- const cards = paymentDetail.filter((element) => element.category === context.currentCategory)
270
- const selectedCard = cards[0]
161
+ const paymentDetails = event.data
162
+ const cards = paymentDetails.filter((element) => element.category === context.currentCategory)
271
163
  return {
272
- siteConfig,
273
- paymentDetail,
164
+ paymentDetails,
274
165
  cards,
275
- selectedCard,
276
- currentMethod: selectedCard?.method,
277
- options: selectedCard?.optional,
278
- }
279
- }),
280
- setBonusPreview: assign((context, event) => {
281
- return {
282
- bonusPreviewData: event.data.bonus,
166
+ selectedCard: cards[0],
167
+ currentMethod: cards[0].method,
168
+ options: cards[0].optional
283
169
  }
284
170
  }),
285
171
  setCard: assign((context, event) => {
@@ -312,61 +198,28 @@ export default function (request) {
312
198
  calculation: null,
313
199
  }
314
200
  }),
315
- setResult: assign((context, event) => {
316
- return {
317
- result: event.data,
318
- }
319
- }),
320
- setPromotion: assign((context, event) => {
321
- const promotion = event.data
322
- return {
323
- promotion,
324
- }
325
- }),
326
201
  },
327
202
  guards: {
328
- isFreeWalletMode: (context, event) => {
329
- return context.siteConfig?.walletMode === '2'
330
- },
331
203
  isSubmittable: (context, event) => {
332
204
  const { cardNumber, serialNumber } = context
333
205
  return cardNumber && serialNumber
334
206
  },
335
- jumpLinkEnable: (context, event) => {
336
- const { selectedCard } = context
337
- return selectedCard.jumpLinkEnable === 1
338
- },
339
207
  },
340
208
  services: {
341
209
  fetchInitData: async (context, event) => {
342
- const [{ config }, paymentDetail = []] = await Promise.all([
343
- request.send(common.getConfig({ appSecret })),
344
- request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
345
- ])
346
- const siteConfig = JSON.parse(window.atob(config))
347
- return { siteConfig, paymentDetail }
348
- },
349
- fetchBonusPreview: async (context, event) => {
350
- const { currentMethod, promotion } = context
351
- return await request.send(
352
- payment.getBonusPreview({
353
- method: currentMethod,
354
- promotionsNo: promotion?.activityNo,
355
- })
356
- )
210
+ return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
357
211
  },
358
212
  fetchCalculation: async (context, event) => {
359
- const { currentMethod, selectedAmount, promotion } = context
213
+ const { currentMethod, selectedAmount } = context
360
214
  return await request.send(
361
215
  payment.getDepositExpectedResult({
362
216
  method: currentMethod,
363
217
  amount: selectedAmount,
364
- promotionsNo: promotion?.activityNo,
365
218
  })
366
219
  )
367
220
  },
368
221
  submitDeposit: async (context, event) => {
369
- const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber, promotion } = context
222
+ const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber } = context
370
223
  return await request.send(
371
224
  payment.submitDepositTransactionLoadcard({
372
225
  method: currentMethod,
@@ -374,7 +227,6 @@ export default function (request) {
374
227
  card_type: selectedCard.channel_id,
375
228
  card_code: cardNumber,
376
229
  card_seri: serialNumber,
377
- promotionsNo: promotion?.activityNo,
378
230
  })
379
231
  )
380
232
  },