@jetthai/cuora 1.0.205 → 1.0.302-dev-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/.husky/pre-commit +4 -0
- package/.prettierignore +1 -0
- package/CHANGELOG.md +846 -0
- package/README.md +6 -0
- package/package.json +6 -9
- package/src/api/activity.js +43 -2
- package/src/api/auth.js +22 -7
- package/src/api/common.js +3 -1
- package/src/api/game.js +20 -7
- package/src/api/mailbox.js +9 -5
- package/src/api/payment.js +167 -19
- package/src/api/user.js +7 -0
- package/src/lib/fingerprint.js +9779 -0
- package/src/machine/activity/activity.js +111 -26
- package/src/machine/activity/activity_cash.js +159 -0
- package/src/machine/activity/cash_rain_activity.js +153 -0
- package/src/machine/activity/continue_deposit_activity.js +11 -2
- package/src/machine/activity/deposit_activity.js +13 -4
- package/src/machine/activity/diamond_shop_activity_cash.js +179 -0
- package/src/machine/activity/diamond_shop_activity_vn.js +54 -89
- package/src/machine/activity/fafafa_activity.js +34 -19
- package/src/machine/activity/{affiliate_invite_friends_activity.js → friend_invite_friends_activity.js} +70 -41
- package/src/machine/activity/index.js +22 -4
- package/src/machine/activity/instant_rebate_activity.js +217 -0
- package/src/machine/activity/invite_friends_activity.js +14 -14
- package/src/machine/activity/jackpot.js +74 -0
- package/src/machine/activity/otp_verified_activity.js +74 -0
- package/src/machine/activity/ranking_activity.js +11 -2
- package/src/machine/activity/roulette_activity_v2.js +90 -0
- package/src/machine/activity/sign_in_activity.js +21 -14
- package/src/machine/activity/sign_in_monthly_activity.js +65 -0
- package/src/machine/activity/specify_bets_activity.js +25 -3
- package/src/machine/activity/specify_turnover_activity.js +25 -3
- package/src/machine/activity/time_bomb_activity.js +11 -2
- package/src/machine/activity/vip_card_activity.js +140 -0
- package/src/machine/auth.js +141 -27
- package/src/machine/auth_otp_v2.js +10 -4
- package/src/machine/auth_otp_v3.js +11 -3
- package/src/machine/bank_binding.js +112 -12
- package/src/machine/bank_binding_amb.js +145 -0
- package/src/machine/common.js +113 -25
- package/src/machine/deposit/amb.js +92 -0
- package/src/machine/deposit/crypto.js +50 -29
- package/src/machine/deposit/crypto_bank.js +317 -0
- package/src/machine/deposit/crypto_bank_cash.js +287 -0
- package/src/machine/deposit/crypto_button.js +174 -39
- package/src/machine/deposit/crypto_cash.js +255 -0
- package/src/machine/deposit/crypto_qrcode.js +148 -0
- package/src/machine/deposit/crypto_qrcode_cash.js +131 -0
- package/src/machine/deposit/crypto_way.js +239 -0
- package/src/machine/deposit/crypto_way_cash.js +256 -0
- package/src/machine/deposit/deposit_fc.js +8 -5
- package/src/machine/deposit/direct.js +111 -16
- package/src/machine/deposit/direct_cash.js +217 -0
- package/src/machine/deposit/float.js +366 -0
- package/src/machine/deposit/index.js +43 -2
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_cash.js +207 -0
- package/src/machine/deposit/loadcard_vn.js +191 -43
- package/src/machine/deposit/manual_cash.js +356 -0
- package/src/machine/deposit/manual_vn.js +182 -60
- package/src/machine/deposit/qrcode_cash.js +217 -0
- package/src/machine/deposit/qrcode_v2.js +285 -52
- package/src/machine/deposit/usdt.js +144 -0
- package/src/machine/deposit/usdt_cash.js +138 -0
- package/src/machine/deposit/vpay.js +359 -0
- package/src/machine/game_favorite_v2.js +70 -28
- package/src/machine/game_info.js +57 -0
- package/src/machine/game_search_cash.js +390 -0
- package/src/machine/game_search_v2.js +64 -24
- package/src/machine/game_v2_1.js +662 -0
- package/src/machine/honor_board_cash.js +63 -0
- package/src/machine/inbox.js +259 -34
- package/src/machine/index.js +24 -17
- package/src/machine/leaderboard.js +31 -8
- package/src/machine/navbar.js +57 -0
- package/src/machine/promotions.js +171 -0
- package/src/machine/reward.js +74 -7
- package/src/machine/reward_cash.js +219 -0
- package/src/machine/roulette_v2.js +276 -0
- package/src/machine/setting.js +5 -2
- package/src/machine/side_cash.js +110 -0
- package/src/machine/side_v2.js +33 -28
- package/src/machine/user_photo.js +65 -0
- package/src/machine/user_sign_up.js +117 -17
- package/src/machine/withdraw/index.js +23 -0
- package/src/machine/{withdraw_vn.js → withdraw/withdraw_amb.js} +146 -78
- package/src/machine/{withdraw_crypto.js → withdraw/withdraw_crypto.js} +220 -69
- package/src/machine/withdraw/withdraw_crypto2.js +540 -0
- package/src/machine/withdraw/withdraw_crypto_cash.js +319 -0
- package/src/machine/{withdraw_fc.js → withdraw/withdraw_fc.js} +2 -2
- package/src/machine/withdraw/withdraw_krway.js +207 -0
- package/src/machine/withdraw/withdraw_manual.js +595 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +303 -0
- package/src/machine/withdraw/withdraw_vn.js +533 -0
- package/src/machine/withdraw/withdraw_vn2.js +548 -0
- package/src/request/request.js +10 -5
- package/src/util/constant.js +19 -1
- package/src/util/deviceToken.js +18 -8
- package/src/util/index.js +2 -1
- package/src/util/math.js +4 -0
- package/src/util/storage.js +22 -22
- package/dist/bundle.mjs +0 -18462
- package/rollup.config.js +0 -16
- package/src/machine/auth_otp.js +0 -201
- package/src/machine/deposit/qrcode_vn.js +0 -206
- package/src/machine/game.js +0 -285
- package/src/machine/game_favorite.js +0 -123
- package/src/machine/game_search.js +0 -244
- package/src/machine/game_v2.js +0 -356
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import findLastIndex from 'lodash/findLastIndex.js'
|
|
3
|
-
import payment from '
|
|
4
|
-
import common from '
|
|
5
|
-
import user from '
|
|
6
|
-
import api from '
|
|
7
|
-
|
|
8
|
-
// const findLastIndex = require('lodash/findLastIndex')
|
|
3
|
+
import payment from '../../api/payment.js'
|
|
4
|
+
import common from '../../api/common.js'
|
|
5
|
+
import user from '../../api/user.js'
|
|
6
|
+
import api from '../../api/payment.js'
|
|
9
7
|
|
|
10
8
|
export default function (request) {
|
|
11
9
|
const { appSecret } = request.config
|
|
@@ -25,7 +23,10 @@ export default function (request) {
|
|
|
25
23
|
targetWithdrawLimit: null,
|
|
26
24
|
|
|
27
25
|
maxWithdrawAmount: null,
|
|
28
|
-
|
|
26
|
+
enableWithdraw: false,
|
|
27
|
+
withdrawRules: [],
|
|
28
|
+
|
|
29
|
+
attachmentType: null, // null | 'withdraw' | 'pool'
|
|
29
30
|
|
|
30
31
|
networks: [],
|
|
31
32
|
selectedNetwork: null,
|
|
@@ -34,6 +35,12 @@ export default function (request) {
|
|
|
34
35
|
|
|
35
36
|
charge: null,
|
|
36
37
|
realAmount: null,
|
|
38
|
+
|
|
39
|
+
// otp
|
|
40
|
+
requestId: null,
|
|
41
|
+
status: null,
|
|
42
|
+
target: null,
|
|
43
|
+
ttl: null,
|
|
37
44
|
},
|
|
38
45
|
states: {
|
|
39
46
|
loading: {
|
|
@@ -41,7 +48,7 @@ export default function (request) {
|
|
|
41
48
|
src: 'fetchInitData',
|
|
42
49
|
onDone: {
|
|
43
50
|
target: 'mode',
|
|
44
|
-
actions: ['setInitData', 'preset'],
|
|
51
|
+
actions: ['setInitData', 'preset', 'updateWithdrawCondition'],
|
|
45
52
|
},
|
|
46
53
|
onError: {
|
|
47
54
|
target: 'fail',
|
|
@@ -52,43 +59,59 @@ export default function (request) {
|
|
|
52
59
|
always: [{ target: 'free', cond: 'isFree' }, { target: 'cash' }],
|
|
53
60
|
},
|
|
54
61
|
free: {
|
|
55
|
-
initial: '
|
|
62
|
+
initial: 'checking',
|
|
56
63
|
states: {
|
|
57
|
-
|
|
64
|
+
checking: {
|
|
65
|
+
always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
|
|
66
|
+
},
|
|
67
|
+
notConvertible: {
|
|
68
|
+
on: {
|
|
69
|
+
GIVE_UP: {
|
|
70
|
+
target: 'givingUp',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
givingUp: {
|
|
58
75
|
invoke: {
|
|
59
|
-
src: '
|
|
76
|
+
src: 'giveUp',
|
|
60
77
|
onDone: {
|
|
61
|
-
target: '
|
|
62
|
-
actions: 'updateWithdrawCondition',
|
|
78
|
+
target: 'gaveUp',
|
|
63
79
|
},
|
|
64
80
|
onError: {
|
|
65
|
-
target: '
|
|
81
|
+
target: 'convertible',
|
|
66
82
|
},
|
|
67
83
|
},
|
|
68
84
|
},
|
|
69
|
-
|
|
70
|
-
always: [{ target: 'convertible', cond: 'isConvertible' }, { target: 'notConvertible' }],
|
|
71
|
-
},
|
|
72
|
-
notConvertible: {},
|
|
85
|
+
gaveUp: {},
|
|
73
86
|
convertible: {
|
|
74
87
|
on: {
|
|
75
88
|
SUBMIT: {
|
|
76
89
|
target: 'converting',
|
|
90
|
+
actions: 'setAttachmentType',
|
|
77
91
|
},
|
|
78
92
|
},
|
|
79
93
|
},
|
|
80
94
|
converting: {
|
|
81
95
|
invoke: {
|
|
82
|
-
src: '
|
|
83
|
-
onDone:
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
src: 'convertFreeCredit',
|
|
97
|
+
onDone: [
|
|
98
|
+
{
|
|
99
|
+
target: '#withdraw_crypto.otp',
|
|
100
|
+
actions: 'setOtp',
|
|
101
|
+
cond: 'isOtpRequired',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
target: 'converted',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
86
107
|
onError: {
|
|
87
108
|
target: 'convertible',
|
|
88
109
|
},
|
|
89
110
|
},
|
|
90
111
|
},
|
|
91
|
-
converted: {
|
|
112
|
+
converted: {
|
|
113
|
+
always: [{ target: '#withdraw_crypto.cash.withdrawable', cond: 'hasAttachmentType' }],
|
|
114
|
+
},
|
|
92
115
|
},
|
|
93
116
|
},
|
|
94
117
|
cash: {
|
|
@@ -122,6 +145,17 @@ export default function (request) {
|
|
|
122
145
|
target: 'submittable',
|
|
123
146
|
cond: 'isSubmittable',
|
|
124
147
|
},
|
|
148
|
+
SET_ATTACHMENT_TYPE: {
|
|
149
|
+
actions: 'setAttachmentType',
|
|
150
|
+
cond: 'isNewWalletMode',
|
|
151
|
+
},
|
|
152
|
+
POOL: {
|
|
153
|
+
target: 'pooling',
|
|
154
|
+
cond: (context, event) => {
|
|
155
|
+
const { amount, attachmentType } = context
|
|
156
|
+
return attachmentType === 'pool' && amount > 0
|
|
157
|
+
},
|
|
158
|
+
},
|
|
125
159
|
},
|
|
126
160
|
},
|
|
127
161
|
calculating: {
|
|
@@ -139,9 +173,18 @@ export default function (request) {
|
|
|
139
173
|
},
|
|
140
174
|
submittable: {
|
|
141
175
|
on: {
|
|
142
|
-
SUBMIT:
|
|
143
|
-
|
|
144
|
-
|
|
176
|
+
SUBMIT: [
|
|
177
|
+
{
|
|
178
|
+
target: 'pooling',
|
|
179
|
+
cond: (context, event) => {
|
|
180
|
+
const { amount, attachmentType } = context
|
|
181
|
+
return attachmentType === 'pool' && amount > 0
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
target: 'submitting',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
145
188
|
BACK: {
|
|
146
189
|
target: 'withdrawable',
|
|
147
190
|
},
|
|
@@ -150,16 +193,97 @@ export default function (request) {
|
|
|
150
193
|
submitting: {
|
|
151
194
|
invoke: {
|
|
152
195
|
src: 'submitWithdraw',
|
|
153
|
-
onDone:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
196
|
+
onDone: [
|
|
197
|
+
{
|
|
198
|
+
target: '#withdraw_crypto.otp',
|
|
199
|
+
actions: 'setOtp',
|
|
200
|
+
cond: 'isOtpRequired',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
target: 'submitted',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
157
206
|
onError: {
|
|
158
207
|
target: 'withdrawable',
|
|
159
208
|
},
|
|
160
209
|
},
|
|
161
210
|
},
|
|
162
211
|
submitted: {},
|
|
212
|
+
pooling: {
|
|
213
|
+
invoke: {
|
|
214
|
+
src: 'pool',
|
|
215
|
+
onDone: { target: 'pooled' },
|
|
216
|
+
onError: {
|
|
217
|
+
target: 'withdrawable',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
pooled: {},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
otp: {
|
|
225
|
+
type: 'parallel',
|
|
226
|
+
states: {
|
|
227
|
+
countdown: {
|
|
228
|
+
after: {
|
|
229
|
+
1000: {
|
|
230
|
+
target: 'countdown',
|
|
231
|
+
actions: 'decreaseTtl',
|
|
232
|
+
cond: (context) => context.ttl > 0,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
verification: {
|
|
237
|
+
initial: 'idle',
|
|
238
|
+
states: {
|
|
239
|
+
idle: {
|
|
240
|
+
on: {
|
|
241
|
+
ACKNOWLEDGE: {
|
|
242
|
+
target: 'acknowledging',
|
|
243
|
+
},
|
|
244
|
+
RESET_OTP: {
|
|
245
|
+
target: 'reset',
|
|
246
|
+
},
|
|
247
|
+
BACK: [
|
|
248
|
+
{
|
|
249
|
+
target: '#withdraw_crypto.free.convertible',
|
|
250
|
+
cond: 'isFree',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
target: '#withdraw_crypto.cash.submittable',
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
acknowledging: {
|
|
259
|
+
invoke: {
|
|
260
|
+
src: 'acknowledge',
|
|
261
|
+
onDone: [
|
|
262
|
+
{
|
|
263
|
+
target: '#withdraw_crypto.free.converted',
|
|
264
|
+
cond: 'isFree',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
target: '#withdraw_crypto.cash.submitted',
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
onError: {
|
|
271
|
+
target: 'idle',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
reset: {
|
|
276
|
+
invoke: {
|
|
277
|
+
src: 'resetOtp',
|
|
278
|
+
onDone: {
|
|
279
|
+
target: 'idle',
|
|
280
|
+
actions: 'setVerificationData',
|
|
281
|
+
},
|
|
282
|
+
onError: { target: 'idle' },
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
163
287
|
},
|
|
164
288
|
},
|
|
165
289
|
fail: {},
|
|
@@ -187,11 +311,6 @@ export default function (request) {
|
|
|
187
311
|
}) || [],
|
|
188
312
|
}
|
|
189
313
|
}),
|
|
190
|
-
setPaymentData: assign((context, event) => {
|
|
191
|
-
return {
|
|
192
|
-
paymentDetail: event.data.paymentDetail,
|
|
193
|
-
}
|
|
194
|
-
}),
|
|
195
314
|
preset: assign((context, event) => {
|
|
196
315
|
const { userInfo, siteConfig } = event.data
|
|
197
316
|
const { withdraw_limit, target_withdraw_limit } = userInfo || {}
|
|
@@ -204,24 +323,21 @@ export default function (request) {
|
|
|
204
323
|
balance,
|
|
205
324
|
siteConfig,
|
|
206
325
|
userInfo,
|
|
326
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
207
327
|
}
|
|
208
328
|
}),
|
|
209
329
|
updateWithdrawCondition: assign((context, event) => {
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const
|
|
330
|
+
const { enableWithdraw, enableWithdrawAmount } = event.data?.withdrawRule
|
|
331
|
+
const withdrawRules = event.data?.withdrawRule?.rules || []
|
|
332
|
+
const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
|
|
333
|
+
const { balance } = context
|
|
213
334
|
const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
|
|
214
335
|
|
|
215
|
-
let maxWithdrawAmount = 0
|
|
216
|
-
availableWithdrawAmount = 0
|
|
336
|
+
let maxWithdrawAmount = 0
|
|
217
337
|
|
|
218
338
|
if (lastMatchedIndex > -1) {
|
|
219
339
|
rules[lastMatchedIndex].match = true
|
|
220
340
|
maxWithdrawAmount = rules[lastMatchedIndex].maxWithdrawAmount
|
|
221
|
-
|
|
222
|
-
if (withdrawLimit === 0) {
|
|
223
|
-
availableWithdrawAmount = Math.min(balance, maxWithdrawAmount)
|
|
224
|
-
}
|
|
225
341
|
} else if (rules.length > 0) {
|
|
226
342
|
maxWithdrawAmount = rules[0].maxWithdrawAmount
|
|
227
343
|
} else {
|
|
@@ -230,7 +346,9 @@ export default function (request) {
|
|
|
230
346
|
|
|
231
347
|
return {
|
|
232
348
|
maxWithdrawAmount,
|
|
233
|
-
|
|
349
|
+
enableWithdrawAmount: +enableWithdrawAmount,
|
|
350
|
+
enableWithdraw,
|
|
351
|
+
withdrawRules,
|
|
234
352
|
}
|
|
235
353
|
}),
|
|
236
354
|
setNetwork: assign((context, event) => {
|
|
@@ -258,10 +376,32 @@ export default function (request) {
|
|
|
258
376
|
charge: null,
|
|
259
377
|
}
|
|
260
378
|
}),
|
|
261
|
-
|
|
262
|
-
const {
|
|
379
|
+
setOtp: assign((context, event) => {
|
|
380
|
+
const { requestId, status, target, ttl } = event.data
|
|
381
|
+
return {
|
|
382
|
+
requestId,
|
|
383
|
+
status,
|
|
384
|
+
target,
|
|
385
|
+
ttl,
|
|
386
|
+
}
|
|
387
|
+
}),
|
|
388
|
+
decreaseTtl: assign((context, evnet) => {
|
|
389
|
+
const second = context.ttl
|
|
263
390
|
return {
|
|
264
|
-
|
|
391
|
+
ttl: Math.max(second - 1, 0),
|
|
392
|
+
}
|
|
393
|
+
}),
|
|
394
|
+
setVerificationData: assign((context, event) => {
|
|
395
|
+
const { requestId, ttl, target } = event.data
|
|
396
|
+
return {
|
|
397
|
+
requestId,
|
|
398
|
+
ttl,
|
|
399
|
+
target,
|
|
400
|
+
}
|
|
401
|
+
}),
|
|
402
|
+
setAttachmentType: assign((context, event) => {
|
|
403
|
+
return {
|
|
404
|
+
attachmentType: event.data,
|
|
265
405
|
}
|
|
266
406
|
}),
|
|
267
407
|
},
|
|
@@ -269,53 +409,48 @@ export default function (request) {
|
|
|
269
409
|
isFree: (context, event) => {
|
|
270
410
|
return context.userInfo?.withdraw_rule !== 'DEFAULT'
|
|
271
411
|
},
|
|
412
|
+
hasAttachmentType: (context, event) => {
|
|
413
|
+
return ['withdraw', 'pool'].includes(context.attachmentType)
|
|
414
|
+
},
|
|
272
415
|
haveProcessing: (context, event) => {
|
|
273
416
|
return (context.paymentDetail?.[0]?.processing || []).length > 0
|
|
274
417
|
},
|
|
275
|
-
isWithdrawDisable: (context, event) => {
|
|
276
|
-
const { siteConfig } = context
|
|
277
|
-
const methods = siteConfig?.paymentMethods?.withdraw || []
|
|
278
|
-
return methods.length === 0
|
|
279
|
-
},
|
|
280
418
|
isSubmittable: (context, event) => {
|
|
281
419
|
const { selectedNetwork, address, amount, charge } = context
|
|
282
420
|
return selectedNetwork && address && amount && charge
|
|
283
421
|
},
|
|
284
422
|
isConvertible: (context, event) => {
|
|
285
|
-
const {
|
|
286
|
-
return
|
|
423
|
+
const { enableWithdraw } = context
|
|
424
|
+
return enableWithdraw
|
|
287
425
|
},
|
|
288
426
|
isNotWithdrawable: (context, event) => {
|
|
289
|
-
const {
|
|
290
|
-
|
|
291
|
-
return withdrawLimit !== 0 || balance < minWithdrawAmount
|
|
427
|
+
const { enableWithdraw } = context
|
|
428
|
+
return !enableWithdraw
|
|
292
429
|
},
|
|
293
430
|
isCalculable: (context, event) => {
|
|
294
431
|
const { selectedNetwork, amount } = context
|
|
295
432
|
return selectedNetwork && amount
|
|
296
433
|
},
|
|
434
|
+
isOtpRequired: (context, event) => {
|
|
435
|
+
return event.data?.status === 'otp-verifying'
|
|
436
|
+
},
|
|
437
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
297
438
|
},
|
|
298
439
|
services: {
|
|
299
440
|
fetchInitData: async (context, event) => {
|
|
300
|
-
const [{ config }, userInfo, paymentDetail = []] = await Promise.all([
|
|
441
|
+
const [{ config }, userInfo, paymentDetail = [], withdrawRule] = await Promise.all([
|
|
301
442
|
request.send(common.getConfig({ appSecret })),
|
|
302
443
|
request.send(user.getUserInfo()),
|
|
303
444
|
request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' })),
|
|
445
|
+
request.send(payment.getCurrentWithdrawRule()),
|
|
304
446
|
])
|
|
305
447
|
const siteConfig = JSON.parse(window.atob(config))
|
|
306
|
-
return { siteConfig, userInfo, paymentDetail }
|
|
307
|
-
},
|
|
308
|
-
fetchPaymentData: async (context, event) => {
|
|
309
|
-
const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
|
|
310
|
-
return { paymentDetail }
|
|
311
|
-
},
|
|
312
|
-
fetchWithdrawRules: async (context, event) => {
|
|
313
|
-
return await request.send(payment.getCurrentWithdrawRule())
|
|
448
|
+
return { siteConfig, userInfo, paymentDetail, withdrawRule }
|
|
314
449
|
},
|
|
315
450
|
submitWithdraw: async (context, event) => {
|
|
316
451
|
const { crypto, selectedNetwork, address, amount } = context
|
|
317
452
|
return await request.send(
|
|
318
|
-
api.
|
|
453
|
+
api.submitWithdrawTransactionCrypto({
|
|
319
454
|
method: crypto.method,
|
|
320
455
|
amount,
|
|
321
456
|
cryptoCurrency: crypto.channel,
|
|
@@ -324,7 +459,7 @@ export default function (request) {
|
|
|
324
459
|
})
|
|
325
460
|
)
|
|
326
461
|
},
|
|
327
|
-
|
|
462
|
+
convertFreeCredit: async (context, event) => {
|
|
328
463
|
return await request.send(payment.convertFreeCredit({ exchangeType: 1 }))
|
|
329
464
|
},
|
|
330
465
|
fetchCalculation: async (context, event) => {
|
|
@@ -338,6 +473,22 @@ export default function (request) {
|
|
|
338
473
|
})
|
|
339
474
|
)
|
|
340
475
|
},
|
|
476
|
+
resetOtp: async (context, event) => {
|
|
477
|
+
const { requestId, target } = context
|
|
478
|
+
return await request.send(user.otpReset({ requestId, target }))
|
|
479
|
+
},
|
|
480
|
+
acknowledge: async (context, event) => {
|
|
481
|
+
const { requestId, target } = context
|
|
482
|
+
const code = event.data
|
|
483
|
+
return await request.send(user.otpAcknowledge({ requestId, target, code }))
|
|
484
|
+
},
|
|
485
|
+
pool: async (context, event) => {
|
|
486
|
+
const { amount } = context
|
|
487
|
+
return await request.send(payment.restore({ amount }))
|
|
488
|
+
},
|
|
489
|
+
giveUp: async (context, event) => {
|
|
490
|
+
return await request.send(payment.giveUp())
|
|
491
|
+
},
|
|
341
492
|
},
|
|
342
493
|
}
|
|
343
494
|
)
|