@jetthai/cuora 1.1.126 → 1.1.128-dev-2

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 (71) hide show
  1. package/CHANGELOG.md +428 -0
  2. package/package.json +1 -1
  3. package/src/api/activity.js +28 -0
  4. package/src/api/auth.js +6 -0
  5. package/src/api/common.js +2 -1
  6. package/src/api/game.js +5 -4
  7. package/src/api/mailbox.js +9 -5
  8. package/src/api/payment.js +103 -8
  9. package/src/api/user.js +2 -0
  10. package/src/machine/activity/activity.js +56 -16
  11. package/src/machine/activity/activity_cash.js +78 -14
  12. package/src/machine/activity/cash_rain_activity.js +153 -0
  13. package/src/machine/activity/diamond_shop_activity_cash.js +57 -92
  14. package/src/machine/activity/diamond_shop_activity_vn.js +54 -89
  15. package/src/machine/activity/fafafa_activity.js +8 -1
  16. package/src/machine/activity/friend_invite_friends_activity.js +3 -1
  17. package/src/machine/activity/index.js +6 -0
  18. package/src/machine/activity/instant_rebate_activity.js +214 -0
  19. package/src/machine/activity/roulette_activity_v2.js +11 -2
  20. package/src/machine/activity/sign_in_activity.js +20 -13
  21. package/src/machine/activity/vip_card_activity.js +140 -0
  22. package/src/machine/auth.js +54 -5
  23. package/src/machine/bank_binding.js +112 -12
  24. package/src/machine/bank_binding_amb.js +6 -1
  25. package/src/machine/common.js +92 -24
  26. package/src/machine/deposit/amb.js +5 -3
  27. package/src/machine/deposit/crypto.js +14 -10
  28. package/src/machine/deposit/crypto_bank.js +317 -0
  29. package/src/machine/deposit/crypto_bank_cash.js +280 -0
  30. package/src/machine/deposit/crypto_button.js +9 -5
  31. package/src/machine/deposit/crypto_cash.js +2 -5
  32. package/src/machine/deposit/crypto_qrcode.js +147 -0
  33. package/src/machine/deposit/crypto_qrcode_cash.js +131 -0
  34. package/src/machine/deposit/crypto_way.js +220 -0
  35. package/src/machine/deposit/crypto_way_cash.js +242 -0
  36. package/src/machine/deposit/direct.js +2 -11
  37. package/src/machine/deposit/direct_cash.js +6 -26
  38. package/src/machine/deposit/float.js +5 -3
  39. package/src/machine/deposit/index.js +14 -0
  40. package/src/machine/deposit/krway.js +151 -0
  41. package/src/machine/deposit/loadcard_cash.js +6 -27
  42. package/src/machine/deposit/loadcard_vn.js +2 -10
  43. package/src/machine/deposit/manual_cash.js +89 -38
  44. package/src/machine/deposit/manual_vn.js +104 -48
  45. package/src/machine/deposit/qrcode_cash.js +12 -23
  46. package/src/machine/deposit/qrcode_v2.js +3 -8
  47. package/src/machine/deposit/usdt_cash.js +0 -2
  48. package/src/machine/deposit/vpay.js +5 -3
  49. package/src/machine/game_info.js +57 -0
  50. package/src/machine/game_search_cash.js +390 -0
  51. package/src/machine/game_search_v2.js +4 -4
  52. package/src/machine/game_v2_1.js +131 -7
  53. package/src/machine/honor_board_cash.js +63 -0
  54. package/src/machine/inbox.js +259 -34
  55. package/src/machine/index.js +8 -2
  56. package/src/machine/leaderboard.js +31 -8
  57. package/src/machine/reward_cash.js +1 -1
  58. package/src/machine/side_v2.js +1 -1
  59. package/src/machine/user_photo.js +65 -0
  60. package/src/machine/user_sign_up.js +71 -7
  61. package/src/machine/withdraw/index.js +6 -0
  62. package/src/machine/withdraw/withdraw_crypto.js +1 -66
  63. package/src/machine/withdraw/withdraw_crypto2.js +540 -0
  64. package/src/machine/withdraw/withdraw_krway.js +207 -0
  65. package/src/machine/withdraw/withdraw_manual.js +595 -0
  66. package/src/machine/withdraw/withdraw_manual_cash.js +44 -14
  67. package/src/machine/withdraw/withdraw_vn.js +42 -7
  68. package/src/machine/withdraw/withdraw_vn2.js +64 -37
  69. package/src/util/constant.js +18 -0
  70. package/src/util/deviceToken.js +2 -2
  71. package/src/machine/game_search.js +0 -244
@@ -28,13 +28,17 @@ export default function (request) {
28
28
  states: {
29
29
  idle: {
30
30
  on: {
31
+ SIGN_UP_ID: {
32
+ target: 'authentication',
33
+ actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpId'],
34
+ },
31
35
  SIGN_UP_PHONE: {
32
36
  target: 'authentication',
33
- actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpPhone'],
37
+ actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpPhone'],
34
38
  },
35
39
  SIGN_UP_EMAIL: {
36
40
  target: 'authentication',
37
- actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpEmail'],
41
+ actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpEmail'],
38
42
  },
39
43
  },
40
44
  },
@@ -66,32 +70,92 @@ export default function (request) {
66
70
  reCaptchaToken,
67
71
  }
68
72
  }),
69
- setAffiliate: assign((context, event) => {
73
+ setFriendCode: assign((context, event) => {
70
74
  const { fc } = event.data
75
+ return { fc }
76
+ }),
77
+ setSignUpId: assign((context, event) => {
78
+ const {
79
+ username,
80
+ nick_name,
81
+ password,
82
+ countryCode,
83
+ phone,
84
+ channel,
85
+ subchannel,
86
+ bankCode,
87
+ bankAccount,
88
+ holderName,
89
+ branch,
90
+ branchCode,
91
+ affiliateCode,
92
+ } = event.data
71
93
  return {
72
- fc,
94
+ signUpData: {
95
+ provider: 'local',
96
+ username,
97
+ nick_name,
98
+ password,
99
+ countryCode,
100
+ phone,
101
+ bankCode,
102
+ bankAccount,
103
+ holderName,
104
+ branch,
105
+ branchCode,
106
+ affiliateCode,
107
+ },
108
+ channel,
109
+ subchannel,
73
110
  }
74
111
  }),
75
112
  setSignUpPhone: assign((context, event) => {
76
- const { countryCode, phone, password, channel, subchannel } = event.data
113
+ const {
114
+ countryCode,
115
+ phone,
116
+ nick_name,
117
+ password,
118
+ channel,
119
+ subchannel,
120
+ bankCode,
121
+ bankAccount,
122
+ holderName,
123
+ branch,
124
+ branchCode,
125
+ affiliateCode,
126
+ } = event.data
77
127
  return {
78
128
  signUpData: {
79
129
  provider: 'phone',
80
130
  countryCode,
81
131
  phone,
132
+ nick_name,
82
133
  password,
134
+ bankCode,
135
+ bankAccount,
136
+ holderName,
137
+ branch,
138
+ branchCode,
139
+ affiliateCode,
83
140
  },
84
141
  channel,
85
142
  subchannel,
86
143
  }
87
144
  }),
88
145
  setSignUpEmail: assign((context, event) => {
89
- const { email, password, channel, subchannel } = event.data
146
+ const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
90
147
  return {
91
148
  signUpData: {
92
149
  provider: 'email',
93
150
  email,
151
+ nick_name,
94
152
  password,
153
+ bankCode,
154
+ bankAccount,
155
+ holderName,
156
+ branch,
157
+ branchCode,
158
+ affiliateCode,
95
159
  },
96
160
  channel,
97
161
  subchannel,
@@ -122,7 +186,7 @@ export default function (request) {
122
186
  const { channel, subchannel, signUpData, deviceTokenEnable } = context
123
187
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts, enable: deviceTokenEnable })
124
188
 
125
- const affiliateCode = storage.get('ac')
189
+ const affiliateCode = storage.get('ac') || signUpData?.affiliateCode
126
190
  const messages = {
127
191
  url: window.location.href,
128
192
  channelOrders: [
@@ -1,8 +1,11 @@
1
1
  import withdraw_fc from './withdraw_fc.js'
2
2
  import withdraw_vn from './withdraw_vn.js'
3
3
  import withdraw_vn2 from './withdraw_vn2.js'
4
+ import withdraw_manual from './withdraw_manual.js'
4
5
  import withdraw_crypto from './withdraw_crypto.js'
6
+ import withdraw_crypto2 from './withdraw_crypto2.js'
5
7
  import withdraw_amb from './withdraw_amb.js'
8
+ import withdraw_krway from './withdraw_krway.js'
6
9
  import withdraw_crypto_cash from './withdraw_crypto_cash.js'
7
10
  import withdraw_manual_cash from './withdraw_manual_cash.js'
8
11
 
@@ -10,8 +13,11 @@ export default {
10
13
  withdraw_fc,
11
14
  withdraw_vn,
12
15
  withdraw_vn2,
16
+ withdraw_manual,
13
17
  withdraw_crypto,
18
+ withdraw_crypto2,
14
19
  withdraw_amb,
20
+ withdraw_krway,
15
21
  withdraw_crypto_cash,
16
22
  withdraw_manual_cash,
17
23
  }
@@ -23,7 +23,6 @@ export default function (request) {
23
23
  targetWithdrawLimit: null,
24
24
 
25
25
  maxWithdrawAmount: null,
26
- availableWithdrawAmount: null,
27
26
  enableWithdraw: false,
28
27
  withdrawRules: [],
29
28
 
@@ -62,18 +61,6 @@ export default function (request) {
62
61
  free: {
63
62
  initial: 'checking',
64
63
  states: {
65
- // loading: {
66
- // invoke: {
67
- // src: 'fetchWithdrawRules',
68
- // onDone: {
69
- // target: 'checking',
70
- // actions: 'updateWithdrawCondition',
71
- // },
72
- // onError: {
73
- // target: 'notConvertible',
74
- // },
75
- // },
76
- // },
77
64
  checking: {
78
65
  always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
79
66
  },
@@ -324,11 +311,6 @@ export default function (request) {
324
311
  }) || [],
325
312
  }
326
313
  }),
327
- setPaymentData: assign((context, event) => {
328
- return {
329
- paymentDetail: event.data.paymentDetail,
330
- }
331
- }),
332
314
  preset: assign((context, event) => {
333
315
  const { userInfo, siteConfig } = event.data
334
316
  const { withdraw_limit, target_withdraw_limit } = userInfo || {}
@@ -345,12 +327,9 @@ export default function (request) {
345
327
  }
346
328
  }),
347
329
  updateWithdrawCondition: assign((context, event) => {
348
- const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
349
- event.data?.withdrawRule
350
-
330
+ const { enableWithdraw, enableWithdrawAmount } = event.data?.withdrawRule
351
331
  const withdrawRules = event.data?.withdrawRule?.rules || []
352
332
  const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
353
-
354
333
  const { balance } = context
355
334
  const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
356
335
 
@@ -371,32 +350,6 @@ export default function (request) {
371
350
  enableWithdraw,
372
351
  withdrawRules,
373
352
  }
374
-
375
- // const rules = event.data.rules.filter((rule) => rule.maxWithdrawAmount > 0)
376
- //
377
- // const { balance, withdrawLimit } = context
378
- // const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
379
- //
380
- // let maxWithdrawAmount = 0,
381
- // availableWithdrawAmount = 0
382
- //
383
- // if (lastMatchedIndex > -1) {
384
- // rules[lastMatchedIndex].match = true
385
- // maxWithdrawAmount = rules[lastMatchedIndex].maxWithdrawAmount
386
- //
387
- // if (withdrawLimit === 0) {
388
- // availableWithdrawAmount = Math.min(balance, maxWithdrawAmount)
389
- // }
390
- // } else if (rules.length > 0) {
391
- // maxWithdrawAmount = rules[0].maxWithdrawAmount
392
- // } else {
393
- // maxWithdrawAmount = balance
394
- // }
395
- //
396
- // return {
397
- // maxWithdrawAmount,
398
- // availableWithdrawAmount,
399
- // }
400
353
  }),
401
354
  setNetwork: assign((context, event) => {
402
355
  return {
@@ -423,12 +376,6 @@ export default function (request) {
423
376
  charge: null,
424
377
  }
425
378
  }),
426
- setTransaction: assign((context, event) => {
427
- const { realAmount } = event.data
428
- return {
429
- realAmount,
430
- }
431
- }),
432
379
  setOtp: assign((context, event) => {
433
380
  const { requestId, status, target, ttl } = event.data
434
381
  return {
@@ -468,11 +415,6 @@ export default function (request) {
468
415
  haveProcessing: (context, event) => {
469
416
  return (context.paymentDetail?.[0]?.processing || []).length > 0
470
417
  },
471
- isWithdrawDisable: (context, event) => {
472
- const { siteConfig } = context
473
- const methods = siteConfig?.paymentMethods?.withdraw || []
474
- return methods.length === 0
475
- },
476
418
  isSubmittable: (context, event) => {
477
419
  const { selectedNetwork, address, amount, charge } = context
478
420
  return selectedNetwork && address && amount && charge
@@ -505,13 +447,6 @@ export default function (request) {
505
447
  const siteConfig = JSON.parse(window.atob(config))
506
448
  return { siteConfig, userInfo, paymentDetail, withdrawRule }
507
449
  },
508
- fetchPaymentData: async (context, event) => {
509
- const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
510
- return { paymentDetail }
511
- },
512
- fetchWithdrawRules: async (context, event) => {
513
- return await request.send(payment.getCurrentWithdrawRule())
514
- },
515
450
  submitWithdraw: async (context, event) => {
516
451
  const { crypto, selectedNetwork, address, amount } = context
517
452
  return await request.send(