@jetthai/cuora 1.1.19 → 1.1.21
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 +4 -0
- package/dist/bundle.mjs +60 -115
- package/package.json +1 -1
- package/src/machine/deposit/crypto_button.js +1 -1
- package/src/machine/deposit/loadcard_vn.js +1 -1
- package/src/machine/deposit/qrcode_v2.js +1 -1
- package/src/machine/promotions.js +3 -31
- package/src/machine/reward.js +2 -8
- package/src/machine/withdraw_vn.js +52 -73
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.21](https://github.com/jetthai/cuora-module/compare/v1.1.20...v1.1.21) (2022-12-30)
|
|
6
|
+
|
|
7
|
+
### [1.1.20](https://github.com/jetthai/cuora-module/compare/v1.1.19...v1.1.20) (2022-12-30)
|
|
8
|
+
|
|
5
9
|
### [1.1.19](https://github.com/jetthai/cuora-module/compare/v1.1.18...v1.1.19) (2022-12-29)
|
|
6
10
|
|
|
7
11
|
### [1.1.18](https://github.com/jetthai/cuora-module/compare/v1.1.17...v1.1.18) (2022-12-28)
|
package/dist/bundle.mjs
CHANGED
|
@@ -13013,13 +13013,7 @@ function reward (request) {
|
|
|
13013
13013
|
rewardList: [],
|
|
13014
13014
|
activityNo: null,
|
|
13015
13015
|
receiveNo: null,
|
|
13016
|
-
|
|
13017
|
-
originalTurnoverLimit: 0,
|
|
13018
|
-
originalMaxWithdrawAmount: 0,
|
|
13019
|
-
originalLimitGameDetail: [],
|
|
13020
|
-
newTurnoverLimit: 0,
|
|
13021
|
-
newMaxWithdrawAmount: 0,
|
|
13022
|
-
newLimitGameDetail: [],
|
|
13016
|
+
withdrawRule: {},
|
|
13023
13017
|
callback: () => {},
|
|
13024
13018
|
},
|
|
13025
13019
|
states: {
|
|
@@ -13150,7 +13144,7 @@ function reward (request) {
|
|
|
13150
13144
|
},
|
|
13151
13145
|
setWithdrawRulePreview: (context, event) => {
|
|
13152
13146
|
return {
|
|
13153
|
-
|
|
13147
|
+
withdrawRule: event.data,
|
|
13154
13148
|
}
|
|
13155
13149
|
},
|
|
13156
13150
|
},
|
|
@@ -14806,7 +14800,7 @@ function withdraw_vn (request) {
|
|
|
14806
14800
|
src: 'fetchInitData',
|
|
14807
14801
|
onDone: {
|
|
14808
14802
|
target: 'mode',
|
|
14809
|
-
actions: ['setInitData', 'preset'],
|
|
14803
|
+
actions: ['setInitData', 'preset', 'updateWithdrawCondition'],
|
|
14810
14804
|
},
|
|
14811
14805
|
onError: {
|
|
14812
14806
|
target: 'fail',
|
|
@@ -14817,20 +14811,20 @@ function withdraw_vn (request) {
|
|
|
14817
14811
|
always: [{ target: 'free', cond: 'isFree' }, { target: 'cash' }],
|
|
14818
14812
|
},
|
|
14819
14813
|
free: {
|
|
14820
|
-
initial: '
|
|
14814
|
+
initial: 'checking',
|
|
14821
14815
|
states: {
|
|
14822
|
-
loading: {
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
},
|
|
14816
|
+
// loading: {
|
|
14817
|
+
// invoke: {
|
|
14818
|
+
// src: 'fetchWithdrawRules',
|
|
14819
|
+
// onDone: {
|
|
14820
|
+
// target: 'checking',
|
|
14821
|
+
// actions: 'updateWithdrawCondition',
|
|
14822
|
+
// },
|
|
14823
|
+
// onError: {
|
|
14824
|
+
// target: 'notConvertible',
|
|
14825
|
+
// },
|
|
14826
|
+
// },
|
|
14827
|
+
// },
|
|
14834
14828
|
checking: {
|
|
14835
14829
|
always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
|
|
14836
14830
|
},
|
|
@@ -14857,39 +14851,8 @@ function withdraw_vn (request) {
|
|
|
14857
14851
|
on: {
|
|
14858
14852
|
SUBMIT: {
|
|
14859
14853
|
target: 'converting',
|
|
14860
|
-
},
|
|
14861
|
-
ATTACH: {
|
|
14862
|
-
target: 'attachment',
|
|
14863
|
-
actions: 'setAttachmentType',
|
|
14864
|
-
},
|
|
14865
|
-
},
|
|
14866
|
-
},
|
|
14867
|
-
attachment: {
|
|
14868
|
-
on: {
|
|
14869
|
-
SET_ATTACHMENT_TYPE: {
|
|
14870
14854
|
actions: 'setAttachmentType',
|
|
14871
14855
|
},
|
|
14872
|
-
SET_CURRENT_BANK: {
|
|
14873
|
-
actions: assign((context, event) => {
|
|
14874
|
-
return {
|
|
14875
|
-
bank: event.data,
|
|
14876
|
-
}
|
|
14877
|
-
}),
|
|
14878
|
-
},
|
|
14879
|
-
SET_AMOUNT: {
|
|
14880
|
-
actions: assign((context, event) => {
|
|
14881
|
-
return {
|
|
14882
|
-
amount: event.data,
|
|
14883
|
-
}
|
|
14884
|
-
}),
|
|
14885
|
-
},
|
|
14886
|
-
SUBMIT: {
|
|
14887
|
-
target: 'converting',
|
|
14888
|
-
cond: (context, event) => {
|
|
14889
|
-
const { enableWithdrawAmount, amount } = context;
|
|
14890
|
-
return +enableWithdrawAmount >= +amount
|
|
14891
|
-
},
|
|
14892
|
-
},
|
|
14893
14856
|
},
|
|
14894
14857
|
},
|
|
14895
14858
|
converting: {
|
|
@@ -14909,21 +14872,8 @@ function withdraw_vn (request) {
|
|
|
14909
14872
|
},
|
|
14910
14873
|
},
|
|
14911
14874
|
converted: {
|
|
14912
|
-
always: [
|
|
14913
|
-
{ target: '#withdraw_vn.cash.submitting', cond: 'shouldGoToWithdraw' },
|
|
14914
|
-
{ target: 'pooling', cond: 'shouldGoToPool' },
|
|
14915
|
-
],
|
|
14916
|
-
},
|
|
14917
|
-
pooling: {
|
|
14918
|
-
invoke: {
|
|
14919
|
-
src: 'pool',
|
|
14920
|
-
onDone: { target: 'pooled' },
|
|
14921
|
-
onError: {
|
|
14922
|
-
target: 'pooled',
|
|
14923
|
-
},
|
|
14924
|
-
},
|
|
14875
|
+
always: [{ target: '#withdraw_vn.cash.withdrawable', cond: 'hasAttachmentType' }],
|
|
14925
14876
|
},
|
|
14926
|
-
pooled: {},
|
|
14927
14877
|
},
|
|
14928
14878
|
},
|
|
14929
14879
|
cash: {
|
|
@@ -14958,10 +14908,23 @@ function withdraw_vn (request) {
|
|
|
14958
14908
|
}
|
|
14959
14909
|
}),
|
|
14960
14910
|
},
|
|
14961
|
-
|
|
14962
|
-
|
|
14963
|
-
cond: '
|
|
14911
|
+
SET_ATTACHMENT_TYPE: {
|
|
14912
|
+
actions: 'setAttachmentType',
|
|
14913
|
+
cond: 'isNewWalletMode',
|
|
14964
14914
|
},
|
|
14915
|
+
SUBMIT: [
|
|
14916
|
+
{
|
|
14917
|
+
target: 'pooling',
|
|
14918
|
+
cond: (context, event) => {
|
|
14919
|
+
const { amount, attachmentType } = context;
|
|
14920
|
+
return attachmentType === 'pool' && amount > 0
|
|
14921
|
+
},
|
|
14922
|
+
},
|
|
14923
|
+
{
|
|
14924
|
+
target: 'submitting',
|
|
14925
|
+
cond: 'isSubmittable',
|
|
14926
|
+
},
|
|
14927
|
+
],
|
|
14965
14928
|
},
|
|
14966
14929
|
},
|
|
14967
14930
|
submitting: {
|
|
@@ -14998,6 +14961,16 @@ function withdraw_vn (request) {
|
|
|
14998
14961
|
},
|
|
14999
14962
|
},
|
|
15000
14963
|
},
|
|
14964
|
+
pooling: {
|
|
14965
|
+
invoke: {
|
|
14966
|
+
src: 'pool',
|
|
14967
|
+
onDone: { target: 'pooled' },
|
|
14968
|
+
onError: {
|
|
14969
|
+
target: 'withdrawable',
|
|
14970
|
+
},
|
|
14971
|
+
},
|
|
14972
|
+
},
|
|
14973
|
+
pooled: {},
|
|
15001
14974
|
},
|
|
15002
14975
|
},
|
|
15003
14976
|
otp: {
|
|
@@ -15103,17 +15076,18 @@ function withdraw_vn (request) {
|
|
|
15103
15076
|
balance,
|
|
15104
15077
|
siteConfig,
|
|
15105
15078
|
userInfo,
|
|
15079
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
15106
15080
|
}
|
|
15107
15081
|
}),
|
|
15108
15082
|
updateWithdrawCondition: assign((context, event) => {
|
|
15109
15083
|
const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
|
|
15110
|
-
event.data;
|
|
15084
|
+
event.data?.withdrawRule;
|
|
15111
15085
|
|
|
15112
15086
|
return {
|
|
15113
15087
|
// maxWithdrawAmount: maximumWithdrawAmount,
|
|
15114
15088
|
// availableWithdrawAmount: enableWithdrawAmount,
|
|
15115
|
-
maximumWithdrawAmount,
|
|
15116
|
-
enableWithdrawAmount,
|
|
15089
|
+
maximumWithdrawAmount: +maximumWithdrawAmount,
|
|
15090
|
+
enableWithdrawAmount: +enableWithdrawAmount,
|
|
15117
15091
|
amount: +enableWithdrawAmount,
|
|
15118
15092
|
}
|
|
15119
15093
|
}),
|
|
@@ -15150,11 +15124,8 @@ function withdraw_vn (request) {
|
|
|
15150
15124
|
isFree: (context, event) => {
|
|
15151
15125
|
return context.userInfo?.withdraw_rule !== 'DEFAULT'
|
|
15152
15126
|
},
|
|
15153
|
-
|
|
15154
|
-
return context.attachmentType
|
|
15155
|
-
},
|
|
15156
|
-
shouldGoToPool: (context, event) => {
|
|
15157
|
-
return context.attachmentType === 'pool'
|
|
15127
|
+
hasAttachmentType: (context, event) => {
|
|
15128
|
+
return ['withdraw', 'pool'].includes(context.attachmentType)
|
|
15158
15129
|
},
|
|
15159
15130
|
haveProcessing: (context, event) => {
|
|
15160
15131
|
return (context.paymentDetail?.[0]?.processing || []).length > 0
|
|
@@ -15169,7 +15140,7 @@ function withdraw_vn (request) {
|
|
|
15169
15140
|
},
|
|
15170
15141
|
isSubmittable: (context, event) => {
|
|
15171
15142
|
const { bank, amount } = context;
|
|
15172
|
-
return bank && amount
|
|
15143
|
+
return bank && amount > 0
|
|
15173
15144
|
},
|
|
15174
15145
|
isConvertible: (context, event) => {
|
|
15175
15146
|
const { balance, withdrawLimit } = context;
|
|
@@ -15183,14 +15154,16 @@ function withdraw_vn (request) {
|
|
|
15183
15154
|
isOtpRequired: (context, event) => {
|
|
15184
15155
|
return event.data?.status === 'otp-verifying'
|
|
15185
15156
|
},
|
|
15157
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
15186
15158
|
},
|
|
15187
15159
|
services: {
|
|
15188
15160
|
fetchInitData: async (context, event) => {
|
|
15189
|
-
const [{ config }, userInfo, paymentDetail = [], { bonus, bankInfo }] = await Promise.all([
|
|
15161
|
+
const [{ config }, userInfo, paymentDetail = [], { bonus, bankInfo }, withdrawRule] = await Promise.all([
|
|
15190
15162
|
request.send(common$1.getConfig({ appSecret })),
|
|
15191
15163
|
request.send(user.getUserInfo()),
|
|
15192
15164
|
request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' })),
|
|
15193
15165
|
request.send(payment.getPaymentInfo()),
|
|
15166
|
+
request.send(payment.getCurrentWithdrawRule()),
|
|
15194
15167
|
]);
|
|
15195
15168
|
const siteConfig = JSON.parse(window.atob(config));
|
|
15196
15169
|
const method = paymentDetail.find((payment) => payment.category === 'manual').method;
|
|
@@ -15198,7 +15171,7 @@ function withdraw_vn (request) {
|
|
|
15198
15171
|
const newBankInfo = bankInfo.map((item) => {
|
|
15199
15172
|
return { ...item, ...bankList.find((bank) => bank.bankCode === item.bankCode) }
|
|
15200
15173
|
});
|
|
15201
|
-
return { siteConfig, userInfo, paymentDetail, bonus, bankInfo: newBankInfo, bankList }
|
|
15174
|
+
return { siteConfig, userInfo, paymentDetail, bonus, bankInfo: newBankInfo, bankList, withdrawRule }
|
|
15202
15175
|
},
|
|
15203
15176
|
fetchPaymentData: async (context, event) => {
|
|
15204
15177
|
const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }));
|
|
@@ -16741,7 +16714,7 @@ function loadcard_vn (request) {
|
|
|
16741
16714
|
},
|
|
16742
16715
|
guards: {
|
|
16743
16716
|
isPromotionApplyMode: (context, event) => {
|
|
16744
|
-
return context.siteConfig?.
|
|
16717
|
+
return context.siteConfig?.walletMode === '2'
|
|
16745
16718
|
},
|
|
16746
16719
|
isSubmittable: (context, event) => {
|
|
16747
16720
|
const { cardNumber, serialNumber } = context;
|
|
@@ -17360,7 +17333,7 @@ function qrcode_v2 (request) {
|
|
|
17360
17333
|
},
|
|
17361
17334
|
guards: {
|
|
17362
17335
|
isPromotionApplyMode: (context, event) => {
|
|
17363
|
-
return context.siteConfig?.
|
|
17336
|
+
return context.siteConfig?.walletMode === '2'
|
|
17364
17337
|
},
|
|
17365
17338
|
},
|
|
17366
17339
|
services: {
|
|
@@ -18661,7 +18634,7 @@ function crypto_button (request) {
|
|
|
18661
18634
|
},
|
|
18662
18635
|
guards: {
|
|
18663
18636
|
isPromotionApplyMode: (context, event) => {
|
|
18664
|
-
return context.siteConfig?.
|
|
18637
|
+
return context.siteConfig?.walletMode === '2'
|
|
18665
18638
|
},
|
|
18666
18639
|
isConfirmable: (context, event) => {
|
|
18667
18640
|
const { selectedCrypto, selectedNetwork } = context;
|
|
@@ -20257,36 +20230,8 @@ function promotions (request) {
|
|
|
20257
20230
|
id: 'promotions',
|
|
20258
20231
|
initial: 'loading',
|
|
20259
20232
|
context: {
|
|
20260
|
-
noBonus: {
|
|
20261
|
-
|
|
20262
|
-
title: 'No Bonus',
|
|
20263
|
-
adSmallUrl: [
|
|
20264
|
-
{
|
|
20265
|
-
url: '~/assets/images/deposit/deposit_img_nobonus_normal.png',
|
|
20266
|
-
name: 'No Bonus',
|
|
20267
|
-
},
|
|
20268
|
-
],
|
|
20269
|
-
descrip: 'no_bonus',
|
|
20270
|
-
minimumAmount: 0,
|
|
20271
|
-
turnoverLimitMultiple: 1,
|
|
20272
|
-
promotionDetail: [],
|
|
20273
|
-
withdrawLimitDetail: [
|
|
20274
|
-
{
|
|
20275
|
-
greaterEqualThen: 0,
|
|
20276
|
-
lessEqualThen: -1,
|
|
20277
|
-
maxWithdrawAmount: -1,
|
|
20278
|
-
turnoverLimitMultiple: 1,
|
|
20279
|
-
},
|
|
20280
|
-
],
|
|
20281
|
-
limitGameDetail: [],
|
|
20282
|
-
},
|
|
20283
|
-
turnoverLimitStatus: '',
|
|
20284
|
-
originalTurnoverLimit: 0,
|
|
20285
|
-
originalMaxWithdrawAmount: 0,
|
|
20286
|
-
originalLimitGameDetail: [],
|
|
20287
|
-
newTurnoverLimit: 0,
|
|
20288
|
-
newMaxWithdrawAmount: 0,
|
|
20289
|
-
newLimitGameDetail: [],
|
|
20233
|
+
noBonus: {},
|
|
20234
|
+
withdrawRule: {},
|
|
20290
20235
|
promotionsList: [],
|
|
20291
20236
|
selectedPromo: {},
|
|
20292
20237
|
},
|
|
@@ -20375,7 +20320,7 @@ function promotions (request) {
|
|
|
20375
20320
|
}),
|
|
20376
20321
|
setWithdrawRulePreview: assign((context, event) => {
|
|
20377
20322
|
return {
|
|
20378
|
-
|
|
20323
|
+
withdrawRule: event.data,
|
|
20379
20324
|
}
|
|
20380
20325
|
}),
|
|
20381
20326
|
reset: assign((context, event) => {
|
package/package.json
CHANGED
|
@@ -401,7 +401,7 @@ export default function (request) {
|
|
|
401
401
|
},
|
|
402
402
|
guards: {
|
|
403
403
|
isPromotionApplyMode: (context, event) => {
|
|
404
|
-
return context.siteConfig?.
|
|
404
|
+
return context.siteConfig?.walletMode === '2'
|
|
405
405
|
},
|
|
406
406
|
isConfirmable: (context, event) => {
|
|
407
407
|
const { selectedCrypto, selectedNetwork } = context
|
|
@@ -322,7 +322,7 @@ export default function (request) {
|
|
|
322
322
|
},
|
|
323
323
|
guards: {
|
|
324
324
|
isPromotionApplyMode: (context, event) => {
|
|
325
|
-
return context.siteConfig?.
|
|
325
|
+
return context.siteConfig?.walletMode === '2'
|
|
326
326
|
},
|
|
327
327
|
isSubmittable: (context, event) => {
|
|
328
328
|
const { cardNumber, serialNumber } = context
|
|
@@ -7,36 +7,8 @@ export default function (request) {
|
|
|
7
7
|
id: 'promotions',
|
|
8
8
|
initial: 'loading',
|
|
9
9
|
context: {
|
|
10
|
-
noBonus: {
|
|
11
|
-
|
|
12
|
-
title: 'No Bonus',
|
|
13
|
-
adSmallUrl: [
|
|
14
|
-
{
|
|
15
|
-
url: '~/assets/images/deposit/deposit_img_nobonus_normal.png',
|
|
16
|
-
name: 'No Bonus',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
descrip: 'no_bonus',
|
|
20
|
-
minimumAmount: 0,
|
|
21
|
-
turnoverLimitMultiple: 1,
|
|
22
|
-
promotionDetail: [],
|
|
23
|
-
withdrawLimitDetail: [
|
|
24
|
-
{
|
|
25
|
-
greaterEqualThen: 0,
|
|
26
|
-
lessEqualThen: -1,
|
|
27
|
-
maxWithdrawAmount: -1,
|
|
28
|
-
turnoverLimitMultiple: 1,
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
limitGameDetail: [],
|
|
32
|
-
},
|
|
33
|
-
turnoverLimitStatus: '',
|
|
34
|
-
originalTurnoverLimit: 0,
|
|
35
|
-
originalMaxWithdrawAmount: 0,
|
|
36
|
-
originalLimitGameDetail: [],
|
|
37
|
-
newTurnoverLimit: 0,
|
|
38
|
-
newMaxWithdrawAmount: 0,
|
|
39
|
-
newLimitGameDetail: [],
|
|
10
|
+
noBonus: {},
|
|
11
|
+
withdrawRule: {},
|
|
40
12
|
promotionsList: [],
|
|
41
13
|
selectedPromo: {},
|
|
42
14
|
},
|
|
@@ -125,7 +97,7 @@ export default function (request) {
|
|
|
125
97
|
}),
|
|
126
98
|
setWithdrawRulePreview: assign((context, event) => {
|
|
127
99
|
return {
|
|
128
|
-
|
|
100
|
+
withdrawRule: event.data,
|
|
129
101
|
}
|
|
130
102
|
}),
|
|
131
103
|
reset: assign((context, event) => {
|
package/src/machine/reward.js
CHANGED
|
@@ -14,13 +14,7 @@ export default function (request) {
|
|
|
14
14
|
rewardList: [],
|
|
15
15
|
activityNo: null,
|
|
16
16
|
receiveNo: null,
|
|
17
|
-
|
|
18
|
-
originalTurnoverLimit: 0,
|
|
19
|
-
originalMaxWithdrawAmount: 0,
|
|
20
|
-
originalLimitGameDetail: [],
|
|
21
|
-
newTurnoverLimit: 0,
|
|
22
|
-
newMaxWithdrawAmount: 0,
|
|
23
|
-
newLimitGameDetail: [],
|
|
17
|
+
withdrawRule: {},
|
|
24
18
|
callback: () => {},
|
|
25
19
|
},
|
|
26
20
|
states: {
|
|
@@ -151,7 +145,7 @@ export default function (request) {
|
|
|
151
145
|
},
|
|
152
146
|
setWithdrawRulePreview: (context, event) => {
|
|
153
147
|
return {
|
|
154
|
-
|
|
148
|
+
withdrawRule: event.data,
|
|
155
149
|
}
|
|
156
150
|
},
|
|
157
151
|
},
|
|
@@ -48,7 +48,7 @@ export default function (request) {
|
|
|
48
48
|
src: 'fetchInitData',
|
|
49
49
|
onDone: {
|
|
50
50
|
target: 'mode',
|
|
51
|
-
actions: ['setInitData', 'preset'],
|
|
51
|
+
actions: ['setInitData', 'preset', 'updateWithdrawCondition'],
|
|
52
52
|
},
|
|
53
53
|
onError: {
|
|
54
54
|
target: 'fail',
|
|
@@ -59,20 +59,20 @@ export default function (request) {
|
|
|
59
59
|
always: [{ target: 'free', cond: 'isFree' }, { target: 'cash' }],
|
|
60
60
|
},
|
|
61
61
|
free: {
|
|
62
|
-
initial: '
|
|
62
|
+
initial: 'checking',
|
|
63
63
|
states: {
|
|
64
|
-
loading: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
64
|
+
// loading: {
|
|
65
|
+
// invoke: {
|
|
66
|
+
// src: 'fetchWithdrawRules',
|
|
67
|
+
// onDone: {
|
|
68
|
+
// target: 'checking',
|
|
69
|
+
// actions: 'updateWithdrawCondition',
|
|
70
|
+
// },
|
|
71
|
+
// onError: {
|
|
72
|
+
// target: 'notConvertible',
|
|
73
|
+
// },
|
|
74
|
+
// },
|
|
75
|
+
// },
|
|
76
76
|
checking: {
|
|
77
77
|
always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
|
|
78
78
|
},
|
|
@@ -99,39 +99,8 @@ export default function (request) {
|
|
|
99
99
|
on: {
|
|
100
100
|
SUBMIT: {
|
|
101
101
|
target: 'converting',
|
|
102
|
-
},
|
|
103
|
-
ATTACH: {
|
|
104
|
-
target: 'attachment',
|
|
105
|
-
actions: 'setAttachmentType',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
attachment: {
|
|
110
|
-
on: {
|
|
111
|
-
SET_ATTACHMENT_TYPE: {
|
|
112
102
|
actions: 'setAttachmentType',
|
|
113
103
|
},
|
|
114
|
-
SET_CURRENT_BANK: {
|
|
115
|
-
actions: assign((context, event) => {
|
|
116
|
-
return {
|
|
117
|
-
bank: event.data,
|
|
118
|
-
}
|
|
119
|
-
}),
|
|
120
|
-
},
|
|
121
|
-
SET_AMOUNT: {
|
|
122
|
-
actions: assign((context, event) => {
|
|
123
|
-
return {
|
|
124
|
-
amount: event.data,
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
},
|
|
128
|
-
SUBMIT: {
|
|
129
|
-
target: 'converting',
|
|
130
|
-
cond: (context, event) => {
|
|
131
|
-
const { enableWithdrawAmount, amount } = context
|
|
132
|
-
return +enableWithdrawAmount >= +amount
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
104
|
},
|
|
136
105
|
},
|
|
137
106
|
converting: {
|
|
@@ -151,21 +120,8 @@ export default function (request) {
|
|
|
151
120
|
},
|
|
152
121
|
},
|
|
153
122
|
converted: {
|
|
154
|
-
always: [
|
|
155
|
-
{ target: '#withdraw_vn.cash.submitting', cond: 'shouldGoToWithdraw' },
|
|
156
|
-
{ target: 'pooling', cond: 'shouldGoToPool' },
|
|
157
|
-
],
|
|
158
|
-
},
|
|
159
|
-
pooling: {
|
|
160
|
-
invoke: {
|
|
161
|
-
src: 'pool',
|
|
162
|
-
onDone: { target: 'pooled' },
|
|
163
|
-
onError: {
|
|
164
|
-
target: 'pooled',
|
|
165
|
-
},
|
|
166
|
-
},
|
|
123
|
+
always: [{ target: '#withdraw_vn.cash.withdrawable', cond: 'hasAttachmentType' }],
|
|
167
124
|
},
|
|
168
|
-
pooled: {},
|
|
169
125
|
},
|
|
170
126
|
},
|
|
171
127
|
cash: {
|
|
@@ -200,10 +156,23 @@ export default function (request) {
|
|
|
200
156
|
}
|
|
201
157
|
}),
|
|
202
158
|
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
cond: '
|
|
159
|
+
SET_ATTACHMENT_TYPE: {
|
|
160
|
+
actions: 'setAttachmentType',
|
|
161
|
+
cond: 'isNewWalletMode',
|
|
206
162
|
},
|
|
163
|
+
SUBMIT: [
|
|
164
|
+
{
|
|
165
|
+
target: 'pooling',
|
|
166
|
+
cond: (context, event) => {
|
|
167
|
+
const { amount, attachmentType } = context
|
|
168
|
+
return attachmentType === 'pool' && amount > 0
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
target: 'submitting',
|
|
173
|
+
cond: 'isSubmittable',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
207
176
|
},
|
|
208
177
|
},
|
|
209
178
|
submitting: {
|
|
@@ -240,6 +209,16 @@ export default function (request) {
|
|
|
240
209
|
},
|
|
241
210
|
},
|
|
242
211
|
},
|
|
212
|
+
pooling: {
|
|
213
|
+
invoke: {
|
|
214
|
+
src: 'pool',
|
|
215
|
+
onDone: { target: 'pooled' },
|
|
216
|
+
onError: {
|
|
217
|
+
target: 'withdrawable',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
pooled: {},
|
|
243
222
|
},
|
|
244
223
|
},
|
|
245
224
|
otp: {
|
|
@@ -345,17 +324,18 @@ export default function (request) {
|
|
|
345
324
|
balance,
|
|
346
325
|
siteConfig,
|
|
347
326
|
userInfo,
|
|
327
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
348
328
|
}
|
|
349
329
|
}),
|
|
350
330
|
updateWithdrawCondition: assign((context, event) => {
|
|
351
331
|
const { differAmountLimit, enableWithdraw, enableWithdrawAmount, maxWithdrawStatus, maximumWithdrawAmount, minimumWithdrawAmount } =
|
|
352
|
-
event.data
|
|
332
|
+
event.data?.withdrawRule
|
|
353
333
|
|
|
354
334
|
return {
|
|
355
335
|
// maxWithdrawAmount: maximumWithdrawAmount,
|
|
356
336
|
// availableWithdrawAmount: enableWithdrawAmount,
|
|
357
|
-
maximumWithdrawAmount,
|
|
358
|
-
enableWithdrawAmount,
|
|
337
|
+
maximumWithdrawAmount: +maximumWithdrawAmount,
|
|
338
|
+
enableWithdrawAmount: +enableWithdrawAmount,
|
|
359
339
|
amount: +enableWithdrawAmount,
|
|
360
340
|
}
|
|
361
341
|
}),
|
|
@@ -392,11 +372,8 @@ export default function (request) {
|
|
|
392
372
|
isFree: (context, event) => {
|
|
393
373
|
return context.userInfo?.withdraw_rule !== 'DEFAULT'
|
|
394
374
|
},
|
|
395
|
-
|
|
396
|
-
return context.attachmentType
|
|
397
|
-
},
|
|
398
|
-
shouldGoToPool: (context, event) => {
|
|
399
|
-
return context.attachmentType === 'pool'
|
|
375
|
+
hasAttachmentType: (context, event) => {
|
|
376
|
+
return ['withdraw', 'pool'].includes(context.attachmentType)
|
|
400
377
|
},
|
|
401
378
|
haveProcessing: (context, event) => {
|
|
402
379
|
return (context.paymentDetail?.[0]?.processing || []).length > 0
|
|
@@ -411,7 +388,7 @@ export default function (request) {
|
|
|
411
388
|
},
|
|
412
389
|
isSubmittable: (context, event) => {
|
|
413
390
|
const { bank, amount } = context
|
|
414
|
-
return bank && amount
|
|
391
|
+
return bank && amount > 0
|
|
415
392
|
},
|
|
416
393
|
isConvertible: (context, event) => {
|
|
417
394
|
const { balance, withdrawLimit } = context
|
|
@@ -425,14 +402,16 @@ export default function (request) {
|
|
|
425
402
|
isOtpRequired: (context, event) => {
|
|
426
403
|
return event.data?.status === 'otp-verifying'
|
|
427
404
|
},
|
|
405
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
428
406
|
},
|
|
429
407
|
services: {
|
|
430
408
|
fetchInitData: async (context, event) => {
|
|
431
|
-
const [{ config }, userInfo, paymentDetail = [], { bonus, bankInfo }] = await Promise.all([
|
|
409
|
+
const [{ config }, userInfo, paymentDetail = [], { bonus, bankInfo }, withdrawRule] = await Promise.all([
|
|
432
410
|
request.send(common.getConfig({ appSecret })),
|
|
433
411
|
request.send(user.getUserInfo()),
|
|
434
412
|
request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' })),
|
|
435
413
|
request.send(payment.getPaymentInfo()),
|
|
414
|
+
request.send(payment.getCurrentWithdrawRule()),
|
|
436
415
|
])
|
|
437
416
|
const siteConfig = JSON.parse(window.atob(config))
|
|
438
417
|
const method = paymentDetail.find((payment) => payment.category === 'manual').method
|
|
@@ -440,7 +419,7 @@ export default function (request) {
|
|
|
440
419
|
const newBankInfo = bankInfo.map((item) => {
|
|
441
420
|
return { ...item, ...bankList.find((bank) => bank.bankCode === item.bankCode) }
|
|
442
421
|
})
|
|
443
|
-
return { siteConfig, userInfo, paymentDetail, bonus, bankInfo: newBankInfo, bankList }
|
|
422
|
+
return { siteConfig, userInfo, paymentDetail, bonus, bankInfo: newBankInfo, bankList, withdrawRule }
|
|
444
423
|
},
|
|
445
424
|
fetchPaymentData: async (context, event) => {
|
|
446
425
|
const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
|