@jetthai/cuora 1.0.66-sabai-2 → 1.0.67
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 +0 -638
- package/README.md +0 -6
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +30 -0
- package/package.json +11 -13
- package/src/api/activity.js +3 -10
- package/src/api/auth.js +5 -47
- package/src/api/game.js +2 -64
- package/src/api/index.js +8 -8
- package/src/api/payment.js +7 -86
- package/src/api/user.js +0 -18
- package/src/index.js +5 -7
- package/src/machine/activity/activity.js +10 -97
- package/src/machine/activity/continue_deposit_activity.js +1 -1
- package/src/machine/activity/deposit_activity.js +1 -1
- package/src/machine/activity/{diamond_shop_activity_fc.js → diamond_shop_activity.js} +5 -33
- package/src/machine/activity/{diamond_shop_activity_vn.js → diamond_shop_activity_single_exchange.js} +21 -66
- package/src/machine/activity/fafafa_activity.js +2 -4
- package/src/machine/activity/index.js +10 -24
- package/src/machine/activity/invite_friends_activity.js +8 -3
- package/src/machine/activity/ranking_activity.js +46 -40
- package/src/machine/activity/return_bonus_activity.js +3 -5
- package/src/machine/activity/specify_bets_activity.js +1 -1
- package/src/machine/auth.js +79 -234
- package/src/machine/{auth_otp_v3.js → auth_otp.js} +17 -80
- package/src/machine/bank_binding.js +14 -15
- package/src/machine/common.js +17 -80
- package/src/machine/{deposit/deposit_fc.js → deposit.js} +15 -27
- package/src/machine/error.js +1 -1
- package/src/machine/game.js +10 -17
- package/src/machine/game_favorite.js +2 -2
- package/src/machine/game_hot_new.js +1 -1
- package/src/machine/game_search.js +7 -3
- package/src/machine/inbox.js +6 -5
- package/src/machine/index.js +25 -56
- package/src/machine/merge.js +2 -2
- package/src/machine/payment_data.js +5 -6
- package/src/machine/reward.js +3 -84
- package/src/machine/setting.js +2 -5
- package/src/machine/side.js +27 -34
- package/src/machine/user_info.js +1 -1
- package/src/machine/user_reset_password.js +2 -2
- package/src/machine/user_sign_up.js +56 -111
- package/src/machine/welcome.js +8 -6
- package/src/machine/withdraw.js +380 -0
- package/src/machine/withdraw_vn.js +65 -248
- package/src/request/config.js +1 -7
- package/src/request/cookie.js +52 -0
- package/src/request/request.js +15 -11
- package/webpack.config.js +33 -0
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -1
- package/dist/bundle.mjs +0 -27623
- package/rollup.config.js +0 -12
- package/src/lib/fingerprint.js +0 -5779
- package/src/machine/activity/affiliate_invite_friends_activity.js +0 -216
- package/src/machine/activity/mini_game_activity.js +0 -68
- package/src/machine/activity/roulette_activity_v2.js +0 -81
- package/src/machine/activity/sign_in_activity.js +0 -149
- package/src/machine/activity/specify_turnover_activity.js +0 -113
- package/src/machine/activity/time_bomb_activity.js +0 -80
- package/src/machine/auth_otp_v2.js +0 -177
- package/src/machine/bank_binding_amb.js +0 -140
- package/src/machine/bonus.js +0 -75
- package/src/machine/deposit/amb.js +0 -90
- package/src/machine/deposit/crypto.js +0 -267
- package/src/machine/deposit/crypto_button.js +0 -449
- package/src/machine/deposit/direct.js +0 -246
- package/src/machine/deposit/float.js +0 -295
- package/src/machine/deposit/index.js +0 -25
- package/src/machine/deposit/loadcard_vn.js +0 -390
- package/src/machine/deposit/manual_vn.js +0 -382
- package/src/machine/deposit/qrcode_v2.js +0 -451
- package/src/machine/deposit/usdt.js +0 -144
- package/src/machine/deposit/vpay.js +0 -292
- package/src/machine/game_favorite_v2.js +0 -119
- package/src/machine/game_search_v2.js +0 -379
- package/src/machine/game_v2.js +0 -381
- package/src/machine/game_v2_1.js +0 -442
- package/src/machine/leaderboard.js +0 -108
- package/src/machine/promotions.js +0 -170
- package/src/machine/reward_fc.js +0 -97
- package/src/machine/roulette_v2.js +0 -271
- package/src/machine/side_v2.js +0 -200
- package/src/machine/vip_table.js +0 -50
- package/src/machine/withdraw_amb.js +0 -373
- package/src/machine/withdraw_crypto.js +0 -560
- package/src/machine/withdraw_fc.js +0 -251
- package/src/util/constant.js +0 -2
- package/src/util/deviceToken.js +0 -33
- package/src/util/index.js +0 -6
- package/src/util/storage.js +0 -28
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import payment from '../../api/payment.js'
|
|
3
|
-
|
|
4
|
-
export default function (request) {
|
|
5
|
-
return createMachine(
|
|
6
|
-
{
|
|
7
|
-
id: 'direct',
|
|
8
|
-
initial: 'loading',
|
|
9
|
-
context: {
|
|
10
|
-
paymentDetails: [],
|
|
11
|
-
directs: [],
|
|
12
|
-
currentDirect: null,
|
|
13
|
-
banks: [],
|
|
14
|
-
selectedBank: null,
|
|
15
|
-
calculation: null,
|
|
16
|
-
currentCategory: 'direct',
|
|
17
|
-
currentMethod: null,
|
|
18
|
-
amount: null,
|
|
19
|
-
result: null,
|
|
20
|
-
|
|
21
|
-
// use for wallet mode 3
|
|
22
|
-
promotion: null,
|
|
23
|
-
},
|
|
24
|
-
states: {
|
|
25
|
-
loading: {
|
|
26
|
-
initial: 'init',
|
|
27
|
-
states: {
|
|
28
|
-
init: {
|
|
29
|
-
invoke: {
|
|
30
|
-
src: 'fetchInitData',
|
|
31
|
-
onDone: {
|
|
32
|
-
target: 'fetching',
|
|
33
|
-
actions: 'setInitData',
|
|
34
|
-
},
|
|
35
|
-
onError: {
|
|
36
|
-
target: '#direct.fail',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
fetching: {
|
|
41
|
-
invoke: {
|
|
42
|
-
src: 'fetchBanksList',
|
|
43
|
-
onDone: {
|
|
44
|
-
target: '#direct.promotion',
|
|
45
|
-
actions: 'setBanks',
|
|
46
|
-
},
|
|
47
|
-
onError: {
|
|
48
|
-
target: '#direct.fail',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
promotion: {
|
|
55
|
-
always: [
|
|
56
|
-
{
|
|
57
|
-
target: 'calculating',
|
|
58
|
-
actions: 'setPromotionDefaultAmount',
|
|
59
|
-
cond: 'hasMinPromotionDeposit',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
target: 'loaded',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
loaded: {
|
|
67
|
-
on: {
|
|
68
|
-
SELECT_DIRECT: {
|
|
69
|
-
actions: ['setDirect', 'reset'],
|
|
70
|
-
target: 'loading.fetching',
|
|
71
|
-
},
|
|
72
|
-
SELECT_BANK: {
|
|
73
|
-
actions: 'setSelectedBank',
|
|
74
|
-
},
|
|
75
|
-
SET_AMOUNT: {
|
|
76
|
-
actions: ['setAmount', 'clearCalculation'],
|
|
77
|
-
},
|
|
78
|
-
CLEAR_CALCULATION: {
|
|
79
|
-
actions: 'clearCalculation',
|
|
80
|
-
},
|
|
81
|
-
CALCULATE: {
|
|
82
|
-
target: 'calculating',
|
|
83
|
-
cond: 'isCalculable',
|
|
84
|
-
},
|
|
85
|
-
SUBMIT: {
|
|
86
|
-
target: 'submitting',
|
|
87
|
-
cond: 'isSubmittable',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
calculating: {
|
|
92
|
-
invoke: {
|
|
93
|
-
src: 'fetchCalculation',
|
|
94
|
-
onDone: {
|
|
95
|
-
target: 'loaded',
|
|
96
|
-
actions: 'setCalculation',
|
|
97
|
-
},
|
|
98
|
-
onError: {
|
|
99
|
-
target: 'loaded',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
submitting: {
|
|
104
|
-
invoke: {
|
|
105
|
-
src: 'submitDeposit',
|
|
106
|
-
onDone: {
|
|
107
|
-
target: 'submitted',
|
|
108
|
-
actions: 'setResult',
|
|
109
|
-
},
|
|
110
|
-
onError: {
|
|
111
|
-
target: 'loaded',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
submitted: {},
|
|
116
|
-
fail: {},
|
|
117
|
-
},
|
|
118
|
-
on: {
|
|
119
|
-
SET_PROMOTION: {
|
|
120
|
-
actions: 'setPromotion',
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
actions: {
|
|
126
|
-
reset: assign((context, event) => {
|
|
127
|
-
const { banks } = context
|
|
128
|
-
return {
|
|
129
|
-
amount: null,
|
|
130
|
-
selectedBank: banks[0],
|
|
131
|
-
calculation: null,
|
|
132
|
-
}
|
|
133
|
-
}),
|
|
134
|
-
setInitData: assign((context, event) => {
|
|
135
|
-
const paymentDetails = event.data
|
|
136
|
-
const directs = paymentDetails.filter((element) => element.category === context.currentCategory)
|
|
137
|
-
|
|
138
|
-
return {
|
|
139
|
-
paymentDetails,
|
|
140
|
-
directs,
|
|
141
|
-
currentDirect: directs[0],
|
|
142
|
-
currentMethod: directs[0]?.method,
|
|
143
|
-
}
|
|
144
|
-
}),
|
|
145
|
-
setBanks: assign((context, event) => {
|
|
146
|
-
const banks = event.data
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
banks,
|
|
150
|
-
selectedBank: banks[0],
|
|
151
|
-
}
|
|
152
|
-
}),
|
|
153
|
-
setDirect: assign((context, event) => {
|
|
154
|
-
return {
|
|
155
|
-
currentDirect: event.data,
|
|
156
|
-
currentMethod: event.data.method,
|
|
157
|
-
}
|
|
158
|
-
}),
|
|
159
|
-
setSelectedBank: assign((context, event) => {
|
|
160
|
-
return {
|
|
161
|
-
selectedBank: event.data,
|
|
162
|
-
}
|
|
163
|
-
}),
|
|
164
|
-
setAmount: assign((context, event) => {
|
|
165
|
-
return {
|
|
166
|
-
amount: event.data,
|
|
167
|
-
}
|
|
168
|
-
}),
|
|
169
|
-
setCalculation: assign((context, event) => {
|
|
170
|
-
return {
|
|
171
|
-
calculation: event.data,
|
|
172
|
-
}
|
|
173
|
-
}),
|
|
174
|
-
clearCalculation: assign((context, event) => {
|
|
175
|
-
return {
|
|
176
|
-
calculation: null,
|
|
177
|
-
}
|
|
178
|
-
}),
|
|
179
|
-
setResult: assign((context, event) => {
|
|
180
|
-
return {
|
|
181
|
-
result: event.data,
|
|
182
|
-
}
|
|
183
|
-
}),
|
|
184
|
-
setPromotion: assign((context, event) => {
|
|
185
|
-
return {
|
|
186
|
-
promotion: event.data,
|
|
187
|
-
}
|
|
188
|
-
}),
|
|
189
|
-
setPromotionDefaultAmount: assign((context, event) => {
|
|
190
|
-
return {
|
|
191
|
-
amount: context.promotion.minimumAmount,
|
|
192
|
-
}
|
|
193
|
-
}),
|
|
194
|
-
},
|
|
195
|
-
guards: {
|
|
196
|
-
isCalculable: (context, event) => {
|
|
197
|
-
const {
|
|
198
|
-
amount,
|
|
199
|
-
currentDirect: { maximum, minimum },
|
|
200
|
-
} = context
|
|
201
|
-
|
|
202
|
-
return amount && minimum <= +amount && +amount <= maximum
|
|
203
|
-
},
|
|
204
|
-
isSubmittable: (context, event) => {
|
|
205
|
-
const { amount, currentMethod, selectedBank } = context
|
|
206
|
-
return amount && currentMethod && selectedBank?.bankCode
|
|
207
|
-
},
|
|
208
|
-
hasMinPromotionDeposit: (context, event) => {
|
|
209
|
-
return context.promotion?.minimumAmount
|
|
210
|
-
},
|
|
211
|
-
},
|
|
212
|
-
services: {
|
|
213
|
-
fetchInitData: async (context, event) => {
|
|
214
|
-
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
215
|
-
},
|
|
216
|
-
fetchBanksList: async (context, event) => {
|
|
217
|
-
const { currentDirect } = context
|
|
218
|
-
const method = currentDirect.method
|
|
219
|
-
return await request.send(payment.getBankList(method))
|
|
220
|
-
},
|
|
221
|
-
fetchCalculation: async (context, event) => {
|
|
222
|
-
const { currentMethod, amount, promotion } = context
|
|
223
|
-
|
|
224
|
-
return await request.send(
|
|
225
|
-
payment.getDepositExpectedResult({
|
|
226
|
-
method: currentMethod,
|
|
227
|
-
amount,
|
|
228
|
-
promotionsNo: promotion?.activityNo,
|
|
229
|
-
})
|
|
230
|
-
)
|
|
231
|
-
},
|
|
232
|
-
submitDeposit: async (context, event) => {
|
|
233
|
-
const { currentMethod, amount, selectedBank, promotion } = context
|
|
234
|
-
return await request.send(
|
|
235
|
-
payment.submitDepositTransactionBank({
|
|
236
|
-
method: currentMethod,
|
|
237
|
-
amount,
|
|
238
|
-
applyerBankCode: selectedBank.bankCode,
|
|
239
|
-
promotionsNo: promotion?.activityNo,
|
|
240
|
-
})
|
|
241
|
-
)
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
}
|
|
245
|
-
)
|
|
246
|
-
}
|
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import payment from '../../api/payment.js'
|
|
3
|
-
|
|
4
|
-
export default function (request) {
|
|
5
|
-
return createMachine(
|
|
6
|
-
{
|
|
7
|
-
id: 'float',
|
|
8
|
-
initial: 'loading',
|
|
9
|
-
context: {
|
|
10
|
-
method: 'amb_float',
|
|
11
|
-
userAccount: {},
|
|
12
|
-
amount: 0,
|
|
13
|
-
|
|
14
|
-
bankList: [],
|
|
15
|
-
options: [],
|
|
16
|
-
minimum: 0,
|
|
17
|
-
maximum: 0,
|
|
18
|
-
|
|
19
|
-
calculation: null,
|
|
20
|
-
|
|
21
|
-
houseAccountName: null,
|
|
22
|
-
houseAccountNumber: null,
|
|
23
|
-
houseBankName: null,
|
|
24
|
-
calculatedAmount: 0,
|
|
25
|
-
|
|
26
|
-
grandTotalEnable: 1,
|
|
27
|
-
ttl: 120,
|
|
28
|
-
},
|
|
29
|
-
states: {
|
|
30
|
-
loading: {
|
|
31
|
-
initial: 'checkingUserAccount',
|
|
32
|
-
states: {
|
|
33
|
-
checkingUserAccount: {
|
|
34
|
-
invoke: {
|
|
35
|
-
src: 'fetchPaymentInfo',
|
|
36
|
-
onDone: [
|
|
37
|
-
{
|
|
38
|
-
target: 'initializing',
|
|
39
|
-
actions: 'setUserAccount',
|
|
40
|
-
cond: 'hasUserAccount',
|
|
41
|
-
},
|
|
42
|
-
{ target: '#float.accountUnbound' },
|
|
43
|
-
],
|
|
44
|
-
onError: {
|
|
45
|
-
target: '#float.unavailable',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
initializing: {
|
|
50
|
-
invoke: {
|
|
51
|
-
src: 'initialize',
|
|
52
|
-
onDone: { target: '#float.loaded', actions: 'setInitialization' },
|
|
53
|
-
onError: {
|
|
54
|
-
target: '#float.unavailable',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
loaded: {
|
|
61
|
-
entry: 'reset',
|
|
62
|
-
on: {
|
|
63
|
-
SELECT_AMOUNT: [
|
|
64
|
-
{
|
|
65
|
-
target: 'debouncing',
|
|
66
|
-
actions: 'addAmount',
|
|
67
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
target: 'debouncing',
|
|
71
|
-
actions: 'setAmount',
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
KEY_IN: {
|
|
75
|
-
target: 'calculating',
|
|
76
|
-
actions: 'setAmount',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
debouncing: {
|
|
81
|
-
on: {
|
|
82
|
-
SELECT_AMOUNT: [
|
|
83
|
-
{
|
|
84
|
-
target: 'debouncing',
|
|
85
|
-
actions: 'addAmount',
|
|
86
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
target: 'debouncing',
|
|
90
|
-
actions: 'setAmount',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
KEY_IN: {
|
|
94
|
-
target: 'debouncing',
|
|
95
|
-
actions: 'setAmount',
|
|
96
|
-
},
|
|
97
|
-
BACK: {
|
|
98
|
-
target: 'loaded',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
after: {
|
|
102
|
-
1000: {
|
|
103
|
-
target: 'calculating',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
calculable: {
|
|
108
|
-
entry: 'clearCalculation',
|
|
109
|
-
on: {
|
|
110
|
-
SELECT_AMOUNT: [
|
|
111
|
-
{
|
|
112
|
-
target: 'debouncing',
|
|
113
|
-
actions: 'addAmount',
|
|
114
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
target: 'debouncing',
|
|
118
|
-
actions: 'setAmount',
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
KEY_IN: {
|
|
122
|
-
target: 'debouncing',
|
|
123
|
-
actions: 'setAmount',
|
|
124
|
-
},
|
|
125
|
-
CALCULATE: {
|
|
126
|
-
target: 'debouncing',
|
|
127
|
-
},
|
|
128
|
-
BACK: {
|
|
129
|
-
target: 'loaded',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
calculating: {
|
|
134
|
-
invoke: {
|
|
135
|
-
src: 'fetchCalculation',
|
|
136
|
-
onDone: {
|
|
137
|
-
target: 'calculated',
|
|
138
|
-
actions: 'setCalculation',
|
|
139
|
-
},
|
|
140
|
-
onError: {
|
|
141
|
-
target: 'calculable',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
calculated: {
|
|
146
|
-
on: {
|
|
147
|
-
SELECT_AMOUNT: [
|
|
148
|
-
{
|
|
149
|
-
target: 'debouncing',
|
|
150
|
-
actions: 'addAmount',
|
|
151
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
target: 'debouncing',
|
|
155
|
-
actions: 'setAmount',
|
|
156
|
-
},
|
|
157
|
-
],
|
|
158
|
-
KEY_IN: {
|
|
159
|
-
target: 'debouncing',
|
|
160
|
-
actions: 'setAmount',
|
|
161
|
-
},
|
|
162
|
-
CONFIRM: {
|
|
163
|
-
target: 'submitting',
|
|
164
|
-
},
|
|
165
|
-
BACK: {
|
|
166
|
-
target: 'loaded',
|
|
167
|
-
},
|
|
168
|
-
CLEAR_CALCULATION: {
|
|
169
|
-
target: 'debouncing',
|
|
170
|
-
actions: 'clearCalculation',
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
submitting: {
|
|
175
|
-
invoke: {
|
|
176
|
-
src: 'submitDeposit',
|
|
177
|
-
onDone: { target: 'countdown', actions: 'setHouseBank' },
|
|
178
|
-
onError: {
|
|
179
|
-
target: 'calculated',
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
countdown: {
|
|
184
|
-
after: {
|
|
185
|
-
1000: [
|
|
186
|
-
{
|
|
187
|
-
target: 'countdown',
|
|
188
|
-
actions: 'decreaseTtl',
|
|
189
|
-
cond: (context) => context.ttl > 0,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
target: 'loaded',
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
accountUnbound: {},
|
|
198
|
-
unavailable: {},
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
actions: {
|
|
203
|
-
setUserAccount: assign((context, event) => {
|
|
204
|
-
return {
|
|
205
|
-
userAccount: event.data.bankInfo?.[0],
|
|
206
|
-
}
|
|
207
|
-
}),
|
|
208
|
-
setHouseBank: assign((context, event) => {
|
|
209
|
-
const { accountName, accountNumber, bankName, amount } = event.data
|
|
210
|
-
return {
|
|
211
|
-
houseAccountName: accountName,
|
|
212
|
-
houseAccountNumber: accountNumber,
|
|
213
|
-
houseBankName: bankName,
|
|
214
|
-
calculatedAmount: amount,
|
|
215
|
-
}
|
|
216
|
-
}),
|
|
217
|
-
setInitialization: assign((context, event) => {
|
|
218
|
-
const { housePayment, bankList } = event.data
|
|
219
|
-
const { optional, minimum, maximum, grandTotalEnable } = housePayment
|
|
220
|
-
return {
|
|
221
|
-
options: optional,
|
|
222
|
-
minimum,
|
|
223
|
-
maximum,
|
|
224
|
-
bankList,
|
|
225
|
-
grandTotalEnable,
|
|
226
|
-
}
|
|
227
|
-
}),
|
|
228
|
-
addAmount: assign((context, event) => {
|
|
229
|
-
const { amount, maximum } = context
|
|
230
|
-
return {
|
|
231
|
-
amount: Math.min(amount + event.data, maximum),
|
|
232
|
-
}
|
|
233
|
-
}),
|
|
234
|
-
setAmount: assign((context, event) => {
|
|
235
|
-
return { amount: event.data }
|
|
236
|
-
}),
|
|
237
|
-
clear: assign((context, event) => {
|
|
238
|
-
return {
|
|
239
|
-
amount: 0,
|
|
240
|
-
}
|
|
241
|
-
}),
|
|
242
|
-
setCalculation: assign((context, event) => {
|
|
243
|
-
return {
|
|
244
|
-
calculation: event.data,
|
|
245
|
-
}
|
|
246
|
-
}),
|
|
247
|
-
clearCalculation: assign((context, event) => {
|
|
248
|
-
return {
|
|
249
|
-
calculation: null,
|
|
250
|
-
}
|
|
251
|
-
}),
|
|
252
|
-
decreaseTtl: assign((context, evnet) => {
|
|
253
|
-
const ms = context.ttl
|
|
254
|
-
return {
|
|
255
|
-
ttl: Math.max(ms - 1, 0),
|
|
256
|
-
}
|
|
257
|
-
}),
|
|
258
|
-
},
|
|
259
|
-
guards: {
|
|
260
|
-
hasUserAccount: (context, event) => {
|
|
261
|
-
return event.data.bankInfo?.[0]
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
services: {
|
|
265
|
-
fetchPaymentInfo: async (context, event) => {
|
|
266
|
-
return await request.send(payment.getPaymentInfo())
|
|
267
|
-
},
|
|
268
|
-
initialize: async (context, event) => {
|
|
269
|
-
const [payments, bankList] = await Promise.all([
|
|
270
|
-
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
271
|
-
request.send(payment.getBankList('amb')),
|
|
272
|
-
])
|
|
273
|
-
return { housePayment: payments.find((payment) => payment.method === context.method), bankList }
|
|
274
|
-
},
|
|
275
|
-
submitDeposit: async (context, event) => {
|
|
276
|
-
return await request.send(
|
|
277
|
-
payment.submitDepositTransaction({
|
|
278
|
-
method: context.method,
|
|
279
|
-
amount: context.amount,
|
|
280
|
-
})
|
|
281
|
-
)
|
|
282
|
-
},
|
|
283
|
-
fetchCalculation: async (context, event) => {
|
|
284
|
-
const { currentMethod, selectedAmount } = context
|
|
285
|
-
return await request.send(
|
|
286
|
-
payment.getDepositExpectedResult({
|
|
287
|
-
method: context.method,
|
|
288
|
-
amount: context.amount,
|
|
289
|
-
})
|
|
290
|
-
)
|
|
291
|
-
},
|
|
292
|
-
},
|
|
293
|
-
}
|
|
294
|
-
)
|
|
295
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import manual_vn from './manual_vn.js'
|
|
2
|
-
import loadcard_vn from './loadcard_vn.js'
|
|
3
|
-
import qrcode_v2 from './qrcode_v2.js'
|
|
4
|
-
import deposit_fc from './deposit_fc.js'
|
|
5
|
-
import crypto from './crypto.js'
|
|
6
|
-
import crypto_button from './crypto_button.js'
|
|
7
|
-
import direct from './direct.js'
|
|
8
|
-
import amb from './amb.js'
|
|
9
|
-
import float from './float.js'
|
|
10
|
-
import vpay from './vpay.js'
|
|
11
|
-
import usdt from './usdt.js'
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
manual_vn,
|
|
15
|
-
loadcard_vn,
|
|
16
|
-
qrcode_v2,
|
|
17
|
-
deposit_fc,
|
|
18
|
-
crypto,
|
|
19
|
-
crypto_button,
|
|
20
|
-
direct,
|
|
21
|
-
amb,
|
|
22
|
-
float,
|
|
23
|
-
vpay,
|
|
24
|
-
usdt,
|
|
25
|
-
}
|