@jetthai/cuora 1.0.307-dev-2 → 1.1.1
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 -853
- package/README.md +0 -6
- package/dist/bundle.mjs +18461 -0
- package/package.json +9 -6
- package/rollup.config.js +16 -0
- package/src/api/activity.js +2 -43
- package/src/api/auth.js +7 -22
- package/src/api/common.js +1 -3
- package/src/api/game.js +7 -20
- package/src/api/mailbox.js +5 -9
- package/src/api/payment.js +19 -167
- package/src/api/user.js +0 -7
- package/src/machine/activity/activity.js +26 -111
- package/src/machine/activity/{friend_invite_friends_activity.js → affiliate_invite_friends_activity.js} +41 -70
- package/src/machine/activity/continue_deposit_activity.js +2 -11
- package/src/machine/activity/deposit_activity.js +4 -13
- package/src/machine/activity/diamond_shop_activity_vn.js +89 -54
- package/src/machine/activity/fafafa_activity.js +19 -34
- package/src/machine/activity/index.js +4 -22
- package/src/machine/activity/invite_friends_activity.js +14 -14
- package/src/machine/activity/ranking_activity.js +2 -11
- package/src/machine/activity/sign_in_activity.js +14 -21
- package/src/machine/activity/specify_bets_activity.js +3 -25
- package/src/machine/activity/specify_turnover_activity.js +3 -25
- package/src/machine/activity/time_bomb_activity.js +2 -11
- package/src/machine/auth.js +25 -141
- package/src/machine/auth_otp.js +201 -0
- package/src/machine/auth_otp_v2.js +4 -10
- package/src/machine/auth_otp_v3.js +3 -11
- package/src/machine/bank_binding.js +12 -112
- package/src/machine/common.js +30 -110
- package/src/machine/deposit/crypto.js +29 -50
- package/src/machine/deposit/crypto_button.js +39 -174
- package/src/machine/deposit/deposit_fc.js +5 -8
- package/src/machine/deposit/direct.js +16 -111
- package/src/machine/deposit/index.js +2 -43
- package/src/machine/deposit/loadcard_vn.js +43 -191
- package/src/machine/deposit/manual_vn.js +60 -182
- package/src/machine/deposit/qrcode_v2.js +52 -285
- package/src/machine/deposit/qrcode_vn.js +206 -0
- package/src/machine/game.js +285 -0
- package/src/machine/game_favorite.js +123 -0
- package/src/machine/game_favorite_v2.js +28 -74
- package/src/machine/game_search.js +244 -0
- package/src/machine/game_search_v2.js +24 -64
- package/src/machine/game_v2.js +356 -0
- package/src/machine/inbox.js +34 -259
- package/src/machine/index.js +17 -26
- package/src/machine/leaderboard.js +8 -31
- package/src/machine/reward.js +7 -74
- package/src/machine/setting.js +2 -5
- package/src/machine/side_v2.js +28 -33
- package/src/machine/user_sign_up.js +21 -112
- package/src/machine/{withdraw/withdraw_crypto.js → withdraw_crypto.js} +69 -220
- package/src/machine/{withdraw/withdraw_fc.js → withdraw_fc.js} +2 -2
- package/src/machine/{withdraw/withdraw_amb.js → withdraw_vn.js} +78 -146
- package/src/request/request.js +5 -10
- package/src/util/constant.js +1 -19
- package/src/util/deviceToken.js +8 -18
- package/src/util/index.js +1 -2
- package/src/util/storage.js +22 -22
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -1
- package/src/lib/fingerprint.js +0 -9779
- package/src/machine/activity/activity_cash.js +0 -159
- package/src/machine/activity/cash_rain_activity.js +0 -153
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -179
- package/src/machine/activity/instant_rebate_activity.js +0 -195
- package/src/machine/activity/jackpot.js +0 -74
- package/src/machine/activity/otp_verified_activity.js +0 -74
- package/src/machine/activity/roulette_activity_v2.js +0 -90
- package/src/machine/activity/sign_in_monthly_activity.js +0 -65
- package/src/machine/activity/vip_card_activity.js +0 -140
- package/src/machine/bank_binding_amb.js +0 -145
- package/src/machine/deposit/amb.js +0 -92
- package/src/machine/deposit/crypto_bank.js +0 -317
- package/src/machine/deposit/crypto_bank_cash.js +0 -287
- package/src/machine/deposit/crypto_cash.js +0 -255
- package/src/machine/deposit/crypto_qrcode.js +0 -148
- package/src/machine/deposit/crypto_qrcode_cash.js +0 -131
- package/src/machine/deposit/crypto_way.js +0 -239
- package/src/machine/deposit/crypto_way_cash.js +0 -256
- package/src/machine/deposit/direct_cash.js +0 -217
- package/src/machine/deposit/float.js +0 -366
- package/src/machine/deposit/krway.js +0 -151
- package/src/machine/deposit/loadcard_cash.js +0 -207
- package/src/machine/deposit/manual_cash.js +0 -356
- package/src/machine/deposit/qrcode_cash.js +0 -217
- package/src/machine/deposit/usdt.js +0 -144
- package/src/machine/deposit/usdt_cash.js +0 -138
- package/src/machine/deposit/vpay.js +0 -359
- package/src/machine/game_info.js +0 -57
- package/src/machine/game_search_cash.js +0 -390
- package/src/machine/game_v2_1.js +0 -662
- package/src/machine/honor_board.js +0 -118
- package/src/machine/honor_board_cash.js +0 -89
- package/src/machine/navbar.js +0 -57
- package/src/machine/promotions.js +0 -171
- package/src/machine/reward_cash.js +0 -219
- package/src/machine/roulette_v2.js +0 -276
- package/src/machine/side_cash.js +0 -110
- package/src/machine/user_photo.js +0 -65
- package/src/machine/withdraw/index.js +0 -23
- package/src/machine/withdraw/withdraw_crypto2.js +0 -540
- package/src/machine/withdraw/withdraw_crypto_cash.js +0 -319
- package/src/machine/withdraw/withdraw_krway.js +0 -220
- package/src/machine/withdraw/withdraw_manual.js +0 -610
- package/src/machine/withdraw/withdraw_manual_cash.js +0 -303
- package/src/machine/withdraw/withdraw_vn.js +0 -546
- package/src/machine/withdraw/withdraw_vn2.js +0 -561
- 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
|
-
|
|
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: '
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
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
|
-
|
|
216
|
-
|
|
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: '
|
|
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
|
|
269
|
-
const cards =
|
|
270
|
-
const selectedCard = cards[0]
|
|
161
|
+
const paymentDetails = event.data
|
|
162
|
+
const cards = paymentDetails.filter((element) => element.category === context.currentCategory)
|
|
271
163
|
return {
|
|
272
|
-
|
|
273
|
-
paymentDetail,
|
|
164
|
+
paymentDetails,
|
|
274
165
|
cards,
|
|
275
|
-
selectedCard,
|
|
276
|
-
currentMethod:
|
|
277
|
-
options:
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
},
|