@jetthai/cuora 1.1.128-dev-2 → 1.1.128

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 (70) hide show
  1. package/CHANGELOG.md +0 -424
  2. package/package.json +1 -1
  3. package/src/api/activity.js +0 -28
  4. package/src/api/auth.js +0 -6
  5. package/src/api/common.js +1 -2
  6. package/src/api/game.js +4 -5
  7. package/src/api/mailbox.js +5 -9
  8. package/src/api/payment.js +8 -103
  9. package/src/api/user.js +0 -2
  10. package/src/machine/activity/activity.js +16 -56
  11. package/src/machine/activity/activity_cash.js +14 -78
  12. package/src/machine/activity/diamond_shop_activity_cash.js +92 -57
  13. package/src/machine/activity/diamond_shop_activity_vn.js +89 -54
  14. package/src/machine/activity/fafafa_activity.js +1 -8
  15. package/src/machine/activity/friend_invite_friends_activity.js +1 -3
  16. package/src/machine/activity/index.js +0 -6
  17. package/src/machine/activity/roulette_activity_v2.js +2 -11
  18. package/src/machine/activity/sign_in_activity.js +13 -20
  19. package/src/machine/auth.js +5 -54
  20. package/src/machine/bank_binding.js +12 -112
  21. package/src/machine/bank_binding_amb.js +1 -6
  22. package/src/machine/common.js +24 -92
  23. package/src/machine/deposit/amb.js +3 -5
  24. package/src/machine/deposit/crypto.js +10 -14
  25. package/src/machine/deposit/crypto_button.js +5 -9
  26. package/src/machine/deposit/crypto_cash.js +5 -2
  27. package/src/machine/deposit/direct.js +15 -2
  28. package/src/machine/deposit/direct_cash.js +26 -6
  29. package/src/machine/deposit/float.js +3 -5
  30. package/src/machine/deposit/index.js +0 -14
  31. package/src/machine/deposit/loadcard_cash.js +27 -6
  32. package/src/machine/deposit/loadcard_vn.js +13 -2
  33. package/src/machine/deposit/manual_cash.js +38 -89
  34. package/src/machine/deposit/manual_vn.js +53 -99
  35. package/src/machine/deposit/qrcode_cash.js +23 -12
  36. package/src/machine/deposit/qrcode_v2.js +14 -3
  37. package/src/machine/deposit/usdt_cash.js +2 -0
  38. package/src/machine/deposit/vpay.js +3 -5
  39. package/src/machine/game_search_cash.js +12 -137
  40. package/src/machine/game_search_v2.js +4 -4
  41. package/src/machine/game_v2_1.js +7 -131
  42. package/src/machine/inbox.js +34 -259
  43. package/src/machine/index.js +0 -6
  44. package/src/machine/leaderboard.js +8 -31
  45. package/src/machine/reward_cash.js +1 -1
  46. package/src/machine/side_v2.js +1 -1
  47. package/src/machine/user_sign_up.js +7 -71
  48. package/src/machine/withdraw/index.js +0 -6
  49. package/src/machine/withdraw/withdraw_crypto.js +66 -1
  50. package/src/machine/withdraw/withdraw_manual_cash.js +14 -44
  51. package/src/machine/withdraw/withdraw_vn.js +7 -42
  52. package/src/machine/withdraw/withdraw_vn2.js +37 -64
  53. package/src/util/constant.js +0 -18
  54. package/src/util/deviceToken.js +2 -2
  55. package/src/machine/activity/cash_rain_activity.js +0 -153
  56. package/src/machine/activity/instant_rebate_activity.js +0 -214
  57. package/src/machine/activity/vip_card_activity.js +0 -140
  58. package/src/machine/deposit/crypto_bank.js +0 -317
  59. package/src/machine/deposit/crypto_bank_cash.js +0 -280
  60. package/src/machine/deposit/crypto_qrcode.js +0 -147
  61. package/src/machine/deposit/crypto_qrcode_cash.js +0 -131
  62. package/src/machine/deposit/crypto_way.js +0 -220
  63. package/src/machine/deposit/crypto_way_cash.js +0 -242
  64. package/src/machine/deposit/krway.js +0 -151
  65. package/src/machine/game_info.js +0 -57
  66. package/src/machine/honor_board_cash.js +0 -63
  67. package/src/machine/user_photo.js +0 -65
  68. package/src/machine/withdraw/withdraw_crypto2.js +0 -540
  69. package/src/machine/withdraw/withdraw_krway.js +0 -207
  70. package/src/machine/withdraw/withdraw_manual.js +0 -595
@@ -8,7 +8,6 @@ import game_favorite_v2 from './game_favorite_v2.js'
8
8
  import game_search_cash from './game_search_cash.js'
9
9
  import game_search_v2 from './game_search_v2.js'
10
10
  import game_hot_new from './game_hot_new.js'
11
- import game_info from './game_info.js'
12
11
  import inbox from './inbox.js'
13
12
  import merge from './merge.js'
14
13
  import payment_data from './payment_data.js'
@@ -33,8 +32,6 @@ import auth_otp_v3 from './auth_otp_v3.js'
33
32
  import vip_table from './vip_table.js'
34
33
  import promotions from './promotions.js'
35
34
  import roulette_v2 from './roulette_v2.js'
36
- import honor_board_cash from './honor_board_cash.js'
37
- import user_photo from './user_photo.js'
38
35
 
39
36
  export default {
40
37
  ...activity,
@@ -46,7 +43,6 @@ export default {
46
43
  game_search_cash,
47
44
  game_search_v2,
48
45
  game_hot_new,
49
- game_info,
50
46
  inbox,
51
47
  merge,
52
48
  payment_data,
@@ -71,7 +67,5 @@ export default {
71
67
  vip_table,
72
68
  promotions,
73
69
  roulette_v2,
74
- honor_board_cash,
75
- user_photo,
76
70
  ...withdraw,
77
71
  }
@@ -18,7 +18,7 @@ export default function (request) {
18
18
  invoke: {
19
19
  src: 'fetchActivityList',
20
20
  onDone: {
21
- target: 'idle',
21
+ target: 'checking',
22
22
  actions: 'setRankActivities',
23
23
  },
24
24
  onError: {
@@ -42,7 +42,7 @@ export default function (request) {
42
42
  },
43
43
  loading: {
44
44
  invoke: {
45
- src: 'fetchPublicActivityDetail',
45
+ src: 'fetchActivityDetail',
46
46
  onDone: {
47
47
  target: 'idle',
48
48
  actions: ['setActivityMap', 'setActivityDetail'],
@@ -62,6 +62,7 @@ export default function (request) {
62
62
  // 200: cl_activity
63
63
  return {
64
64
  rankActivities,
65
+ activityNo: rankActivities?.[0]?.activityNo,
65
66
  }
66
67
  }),
67
68
  setActivityNo: assign((context, event) => {
@@ -71,21 +72,8 @@ export default function (request) {
71
72
  }),
72
73
  setActivityMap: assign((context, event) => {
73
74
  const { activityMap, activityNo } = context
74
- if (event.data.rankingList) {
75
- return {
76
- activityMap: {
77
- ...activityMap,
78
- [activityNo]: {
79
- topRanking: event.data.rankingList,
80
- awards: event.data.awards,
81
- },
82
- },
83
- }
84
- } else {
85
- return {
86
- activityMap: { ...activityMap, [activityNo]: event.data },
87
- awards: event.data?.awards,
88
- }
75
+ return {
76
+ activityMap: { ...activityMap, [activityNo]: event.data },
89
77
  }
90
78
  }),
91
79
  setActivityDetail: assign((context, event) => {
@@ -106,24 +94,13 @@ export default function (request) {
106
94
  },
107
95
  services: {
108
96
  fetchActivityList: async (context, event) => {
109
- // delay 1s for backend request throttle
110
- await new Promise((resolve) => {
111
- setTimeout(resolve, 1000)
112
- })
113
-
114
97
  const { data } = await request.send(api.getActivityList({ appSecret }))
115
98
  return data
116
99
  },
117
- fetchPublicActivityDetail: async (context, event) => {
118
- const hasToken = request.getToken()
100
+ fetchActivityDetail: async (context, event) => {
119
101
  const { activityNo } = context
120
- let result = {}
121
- if (hasToken) {
122
- result = await request.send(api.getActivityDetail({ activityNo, appSecret }))
123
- } else {
124
- result = await request.send(api.getTournamentDetail({ activityNo, appSecret }))
125
- }
126
- return result.data
102
+ const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
103
+ return data
127
104
  },
128
105
  },
129
106
  }
@@ -187,7 +187,7 @@ export default function (request) {
187
187
  )
188
188
  const getOtherRewardAPI = request.send(
189
189
  activity.getRewardList({
190
- rewardType: 'CASH,FREE,PRIZE',
190
+ rewardType: 'CASH,FREE',
191
191
  count: 30,
192
192
  appSecret,
193
193
  })
@@ -127,7 +127,7 @@ export default function (request) {
127
127
  pushHistoryStack: assign((context, event) => {
128
128
  const { menuItemStack, historyStack } = context
129
129
  return {
130
- historyStack: [...historyStack, event.data],
130
+ historyStack: historyStack.concat(menuItemStack.slice(-1)),
131
131
  }
132
132
  }),
133
133
  popHistoryStack: assign((context, event) => {
@@ -28,17 +28,13 @@ 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
- },
35
31
  SIGN_UP_PHONE: {
36
32
  target: 'authentication',
37
- actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpPhone'],
33
+ actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpPhone'],
38
34
  },
39
35
  SIGN_UP_EMAIL: {
40
36
  target: 'authentication',
41
- actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpEmail'],
37
+ actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpEmail'],
42
38
  },
43
39
  },
44
40
  },
@@ -70,92 +66,32 @@ export default function (request) {
70
66
  reCaptchaToken,
71
67
  }
72
68
  }),
73
- setFriendCode: assign((context, event) => {
69
+ setAffiliate: assign((context, event) => {
74
70
  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
93
71
  return {
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,
72
+ fc,
110
73
  }
111
74
  }),
112
75
  setSignUpPhone: assign((context, event) => {
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
76
+ const { countryCode, phone, password, channel, subchannel } = event.data
127
77
  return {
128
78
  signUpData: {
129
79
  provider: 'phone',
130
80
  countryCode,
131
81
  phone,
132
- nick_name,
133
82
  password,
134
- bankCode,
135
- bankAccount,
136
- holderName,
137
- branch,
138
- branchCode,
139
- affiliateCode,
140
83
  },
141
84
  channel,
142
85
  subchannel,
143
86
  }
144
87
  }),
145
88
  setSignUpEmail: assign((context, event) => {
146
- const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
89
+ const { email, password, channel, subchannel } = event.data
147
90
  return {
148
91
  signUpData: {
149
92
  provider: 'email',
150
93
  email,
151
- nick_name,
152
94
  password,
153
- bankCode,
154
- bankAccount,
155
- holderName,
156
- branch,
157
- branchCode,
158
- affiliateCode,
159
95
  },
160
96
  channel,
161
97
  subchannel,
@@ -186,7 +122,7 @@ export default function (request) {
186
122
  const { channel, subchannel, signUpData, deviceTokenEnable } = context
187
123
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts, enable: deviceTokenEnable })
188
124
 
189
- const affiliateCode = storage.get('ac') || signUpData?.affiliateCode
125
+ const affiliateCode = storage.get('ac')
190
126
  const messages = {
191
127
  url: window.location.href,
192
128
  channelOrders: [
@@ -1,11 +1,8 @@
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'
5
4
  import withdraw_crypto from './withdraw_crypto.js'
6
- import withdraw_crypto2 from './withdraw_crypto2.js'
7
5
  import withdraw_amb from './withdraw_amb.js'
8
- import withdraw_krway from './withdraw_krway.js'
9
6
  import withdraw_crypto_cash from './withdraw_crypto_cash.js'
10
7
  import withdraw_manual_cash from './withdraw_manual_cash.js'
11
8
 
@@ -13,11 +10,8 @@ export default {
13
10
  withdraw_fc,
14
11
  withdraw_vn,
15
12
  withdraw_vn2,
16
- withdraw_manual,
17
13
  withdraw_crypto,
18
- withdraw_crypto2,
19
14
  withdraw_amb,
20
- withdraw_krway,
21
15
  withdraw_crypto_cash,
22
16
  withdraw_manual_cash,
23
17
  }
@@ -23,6 +23,7 @@ export default function (request) {
23
23
  targetWithdrawLimit: null,
24
24
 
25
25
  maxWithdrawAmount: null,
26
+ availableWithdrawAmount: null,
26
27
  enableWithdraw: false,
27
28
  withdrawRules: [],
28
29
 
@@ -61,6 +62,18 @@ export default function (request) {
61
62
  free: {
62
63
  initial: 'checking',
63
64
  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
+ // },
64
77
  checking: {
65
78
  always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
66
79
  },
@@ -311,6 +324,11 @@ export default function (request) {
311
324
  }) || [],
312
325
  }
313
326
  }),
327
+ setPaymentData: assign((context, event) => {
328
+ return {
329
+ paymentDetail: event.data.paymentDetail,
330
+ }
331
+ }),
314
332
  preset: assign((context, event) => {
315
333
  const { userInfo, siteConfig } = event.data
316
334
  const { withdraw_limit, target_withdraw_limit } = userInfo || {}
@@ -327,9 +345,12 @@ export default function (request) {
327
345
  }
328
346
  }),
329
347
  updateWithdrawCondition: assign((context, event) => {
330
- const { enableWithdraw, enableWithdrawAmount } = event.data?.withdrawRule
348
+ const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
349
+ event.data?.withdrawRule
350
+
331
351
  const withdrawRules = event.data?.withdrawRule?.rules || []
332
352
  const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
353
+
333
354
  const { balance } = context
334
355
  const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
335
356
 
@@ -350,6 +371,32 @@ export default function (request) {
350
371
  enableWithdraw,
351
372
  withdrawRules,
352
373
  }
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
+ // }
353
400
  }),
354
401
  setNetwork: assign((context, event) => {
355
402
  return {
@@ -376,6 +423,12 @@ export default function (request) {
376
423
  charge: null,
377
424
  }
378
425
  }),
426
+ setTransaction: assign((context, event) => {
427
+ const { realAmount } = event.data
428
+ return {
429
+ realAmount,
430
+ }
431
+ }),
379
432
  setOtp: assign((context, event) => {
380
433
  const { requestId, status, target, ttl } = event.data
381
434
  return {
@@ -415,6 +468,11 @@ export default function (request) {
415
468
  haveProcessing: (context, event) => {
416
469
  return (context.paymentDetail?.[0]?.processing || []).length > 0
417
470
  },
471
+ isWithdrawDisable: (context, event) => {
472
+ const { siteConfig } = context
473
+ const methods = siteConfig?.paymentMethods?.withdraw || []
474
+ return methods.length === 0
475
+ },
418
476
  isSubmittable: (context, event) => {
419
477
  const { selectedNetwork, address, amount, charge } = context
420
478
  return selectedNetwork && address && amount && charge
@@ -447,6 +505,13 @@ export default function (request) {
447
505
  const siteConfig = JSON.parse(window.atob(config))
448
506
  return { siteConfig, userInfo, paymentDetail, withdrawRule }
449
507
  },
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
+ },
450
515
  submitWithdraw: async (context, event) => {
451
516
  const { crypto, selectedNetwork, address, amount } = context
452
517
  return await request.send(
@@ -50,9 +50,6 @@ export default function (request, context) {
50
50
  SUBMIT: {
51
51
  target: 'submitting',
52
52
  },
53
- SUBMIT_CRYPTO: {
54
- target: 'submitting_crypto',
55
- },
56
53
  },
57
54
  },
58
55
  submitting: {
@@ -74,25 +71,6 @@ export default function (request, context) {
74
71
  },
75
72
  },
76
73
  },
77
- submitting_crypto: {
78
- invoke: {
79
- src: 'submitWithdrawCrypto',
80
- onDone: [
81
- {
82
- target: 'otp',
83
- actions: 'setOtp',
84
- cond: 'isOtpRequired',
85
- },
86
- {
87
- target: 'submitted',
88
- actions: 'setProcessing',
89
- },
90
- ],
91
- onError: {
92
- target: 'calculated',
93
- },
94
- },
95
- },
96
74
  submitted: {},
97
75
  otp: {
98
76
  type: 'parallel',
@@ -175,12 +153,18 @@ export default function (request, context) {
175
153
  {
176
154
  actions: {
177
155
  setInitData: assign((context, event) => {
178
- const { currentPayment, paymentInfo, withdrawRule, processing } = event.data
179
- const userBanks = [...paymentInfo.bankList, ...paymentInfo.cryptoList, ...paymentInfo.ewalletList]
156
+ const { currentPayment, banks, paymentInfo, withdrawRule, processing } = event.data
157
+
158
+ const userBanks = (paymentInfo?.bankInfo || []).map((bank) => {
159
+ bank.displayText = `${bank.bankCode} ${bank.accountNumber.slice(-5)}`
160
+ bank.imageUrl = banks.find((item) => item.bankCode === bank.bankCode)?.imageUrl
161
+ return bank
162
+ })
180
163
 
181
164
  return {
182
165
  currentPayment,
183
166
  processing,
167
+ banks,
184
168
  paymentInfo,
185
169
  withdrawRule,
186
170
  userBanks,
@@ -243,17 +227,18 @@ export default function (request, context) {
243
227
  },
244
228
  services: {
245
229
  fetchInitData: async (context, event) => {
246
- const { paymentDetail = [] } = context
247
- const currentPayment = paymentDetail.find((element) => element.category === 'manual' && element.transferType === 'withdraw')
230
+ const currentPayment = context.paymentDetail.find((element) => element.category === 'manual' && element.transferType === 'withdraw')
248
231
 
249
- const [paymentInfo, withdrawRule, orders] = await Promise.all([
250
- request.send(payment.getBindingPaymentInfo()),
232
+ const [banks, paymentInfo, withdrawRule, orders] = await Promise.all([
233
+ request.send(payment.getBankList(currentPayment.method)),
234
+ request.send(payment.getPaymentInfo()),
251
235
  request.send(payment.getDoubleWalletWithdrawRule({ walletType: 'CASH' })),
252
236
  request.send(payment.getPendingOrder({ transferType: 'WITHDRAW' })),
253
237
  ])
254
238
 
255
239
  return {
256
240
  currentPayment,
241
+ banks,
257
242
  paymentInfo,
258
243
  withdrawRule,
259
244
  processing: orders[0],
@@ -268,23 +253,8 @@ export default function (request, context) {
268
253
  amount: selectedAmount,
269
254
  applyerBankCode: selectedUserBank.bankCode,
270
255
  applyerAccountNumber: selectedUserBank.accountNumber,
271
- applyerIfscCode: selectedUserBank.ifscCode,
272
256
  branch: branchTemp,
273
- applyerHolderName: selectedUserBank.holderName,
274
- })
275
- )
276
- },
277
- submitWithdrawCrypto: async (context, event) => {
278
- const { currentPayment, selectedUserBank, selectedAmount } = context
279
- const branchTemp = ['GCASH', 'PAYM', 'PIX'].includes(selectedUserBank.bankCode) ? '' : selectedUserBank.branch
280
- return await request.send(
281
- payment.submitWithdrawTransactionCrypto({
282
- method: currentPayment.method,
283
- amount: selectedAmount,
284
- cryptoCurrency: selectedUserBank.cryptoCurrency,
285
- cryptoNetwork: selectedUserBank.cryptoNetwork,
286
- targetAddress: selectedUserBank.cryptoAddress,
287
- applyerHolderName: selectedUserBank.holderName,
257
+ holderName: selectedUserBank.holderName,
288
258
  })
289
259
  )
290
260
  },
@@ -28,7 +28,6 @@ export default function (request) {
28
28
  enableWithdrawAmount: 0,
29
29
  enableWithdraw: false,
30
30
  withdrawRules: [],
31
- withdrawCheck: null,
32
31
 
33
32
  amount: null,
34
33
  bank: null,
@@ -133,37 +132,11 @@ export default function (request) {
133
132
  checking: {
134
133
  always: [
135
134
  { target: 'inProcessing', cond: 'haveProcessing' },
135
+ { target: 'notWithdrawable', cond: 'isNotWithdrawable' },
136
136
  { target: 'unbound', cond: 'isBankNotBound' },
137
- { target: 'withdrawCheck' },
137
+ { target: 'withdrawable' },
138
138
  ],
139
139
  },
140
- withdrawCheck: {
141
- invoke: {
142
- src: 'withdrawCheck',
143
- onDone: [
144
- {
145
- target: 'notWithdrawMinDepositAmount',
146
- cond: 'isNotWithdrawMinDepositAmount',
147
- actions: assign((context, event) => {
148
- return {
149
- withdrawCheck: event.data,
150
- }
151
- }),
152
- },
153
- {
154
- target: 'notWithdrawable',
155
- cond: 'isNotWithdrawable',
156
- },
157
- {
158
- target: 'withdrawable',
159
- },
160
- ],
161
- onError: {
162
- target: '#withdraw_vn.fail',
163
- },
164
- },
165
- },
166
- notWithdrawMinDepositAmount: {},
167
140
  notWithdrawable: {},
168
141
  unbound: {
169
142
  // to bank_binding.js
@@ -448,9 +421,6 @@ export default function (request) {
448
421
  return event.data?.status === 'otp-verifying'
449
422
  },
450
423
  isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
451
- isNotWithdrawMinDepositAmount: (context, event) => {
452
- return !event.data?.enableWithdraw
453
- },
454
424
  },
455
425
  services: {
456
426
  fetchInitData: async (context, event) => {
@@ -462,13 +432,11 @@ export default function (request) {
462
432
  request.send(payment.getCurrentWithdrawRule()),
463
433
  ])
464
434
  const siteConfig = JSON.parse(window.atob(config))
465
- const bankList = await request.send(payment.getWithdrawBankList())
466
- const newBankInfo = bankInfo
467
- .map((item) => {
468
- const matchedBank = bankList.find((bank) => bank.bankCode === item.bankCode)
469
- return matchedBank ? { ...item, ...matchedBank } : null
470
- })
471
- .filter(Boolean)
435
+ const method = paymentDetail.find((payment) => payment.category === 'manual').method
436
+ const bankList = await request.send(payment.getBankList(method))
437
+ const newBankInfo = bankInfo.map((item) => {
438
+ return { ...item, ...bankList.find((bank) => bank.bankCode === item.bankCode) }
439
+ })
472
440
  return { siteConfig, userInfo, paymentDetail, bonus, bankInfo: newBankInfo, bankList, withdrawRule }
473
441
  },
474
442
  fetchPaymentData: async (context, event) => {
@@ -524,9 +492,6 @@ export default function (request) {
524
492
  giveUp: async (context, event) => {
525
493
  return await request.send(payment.giveUp())
526
494
  },
527
- withdrawCheck: async (context, event) => {
528
- return await request.send(payment.withdrawCheck())
529
- },
530
495
  },
531
496
  }
532
497
  )