@jetthai/cuora 1.1.272-jackpot-2 → 1.1.272
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
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
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.272-jackpot-2](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-4...v1.1.272-jackpot-2) (2024-05-29)
|
|
6
|
-
|
|
7
|
-
### [1.1.272-jackpot-1](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.272-jackpot-1) (2024-05-23)
|
|
8
|
-
|
|
9
|
-
### [1.1.272-jackpot-1](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.272-jackpot-1) (2024-05-23)
|
|
10
|
-
|
|
11
5
|
### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.272) (2024-05-21)
|
|
12
6
|
|
|
13
7
|
### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -6,12 +6,6 @@ export default {
|
|
|
6
6
|
params: { appSecret, include },
|
|
7
7
|
isPublic: true,
|
|
8
8
|
}),
|
|
9
|
-
getJackpotList: ({ appSecret }) => ({
|
|
10
|
-
url: 'activities/jackpot/list',
|
|
11
|
-
method: 'get',
|
|
12
|
-
params: { appSecret },
|
|
13
|
-
isPublic: true,
|
|
14
|
-
}),
|
|
15
9
|
getTournamentDetail: ({ activityNo, appSecret }) => ({
|
|
16
10
|
url: 'tournament/detail',
|
|
17
11
|
method: 'get',
|
package/src/api/payment.js
CHANGED
|
@@ -93,11 +93,6 @@ export default {
|
|
|
93
93
|
method: 'post',
|
|
94
94
|
params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
|
|
95
95
|
}),
|
|
96
|
-
getCryptoWithdrawExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
|
|
97
|
-
url: `payment/v2/${method}/crypto/expected/result`,
|
|
98
|
-
method: 'post',
|
|
99
|
-
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, promotionsNo },
|
|
100
|
-
}),
|
|
101
96
|
getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
|
|
102
97
|
url: `payment/v2/${method}/expected/result`,
|
|
103
98
|
method: 'post',
|
|
@@ -163,12 +158,12 @@ export default {
|
|
|
163
158
|
method: 'post',
|
|
164
159
|
params: { transferType: 'DEPOSIT', amount, promotionsNo },
|
|
165
160
|
}),
|
|
166
|
-
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress
|
|
161
|
+
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
|
|
167
162
|
url: `payment/v2/${method}/transaction`,
|
|
168
163
|
method: 'post',
|
|
169
|
-
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress
|
|
164
|
+
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
|
|
170
165
|
}),
|
|
171
|
-
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch,
|
|
166
|
+
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
|
|
172
167
|
url: `payment/v2/${method}/transaction`,
|
|
173
168
|
method: 'post',
|
|
174
169
|
params: {
|
|
@@ -177,7 +172,7 @@ export default {
|
|
|
177
172
|
applyerBankCode,
|
|
178
173
|
applyerAccountNumber,
|
|
179
174
|
branch,
|
|
180
|
-
|
|
175
|
+
holderName,
|
|
181
176
|
},
|
|
182
177
|
}),
|
|
183
178
|
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
|
@@ -14,7 +14,6 @@ export default function (request) {
|
|
|
14
14
|
activitiesDetailList: [],
|
|
15
15
|
activityList: [],
|
|
16
16
|
promotionList: [],
|
|
17
|
-
jackpotList: [],
|
|
18
17
|
activityMap: {},
|
|
19
18
|
tournamentList: [],
|
|
20
19
|
refs: {},
|
|
@@ -35,7 +34,7 @@ export default function (request) {
|
|
|
35
34
|
src: 'fetchList',
|
|
36
35
|
onDone: {
|
|
37
36
|
target: 'idle',
|
|
38
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'
|
|
37
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
39
38
|
},
|
|
40
39
|
onError: {
|
|
41
40
|
target: 'idle',
|
|
@@ -124,12 +123,6 @@ export default function (request) {
|
|
|
124
123
|
promotionList,
|
|
125
124
|
}
|
|
126
125
|
}),
|
|
127
|
-
setJackpotList: assign((context, event) => {
|
|
128
|
-
const { jackpotList } = event.data
|
|
129
|
-
return {
|
|
130
|
-
jackpotList,
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
126
|
setActivitiesDetailList: assign((context, event) => {
|
|
134
127
|
return {
|
|
135
128
|
activitiesDetailList: event.data.map((item) => item.data),
|
|
@@ -169,13 +162,12 @@ export default function (request) {
|
|
|
169
162
|
const hasToken = request.getToken()
|
|
170
163
|
const isDoubleWallet = context.siteConfig?.walletMode === '4'
|
|
171
164
|
const apiCallable = hasToken && isDoubleWallet
|
|
172
|
-
const [{ data }, promotionList
|
|
165
|
+
const [{ data }, promotionList] = await Promise.all([
|
|
173
166
|
request.send(activity.getActivityList({ appSecret })),
|
|
174
167
|
apiCallable ? request.send(payment.getPromotionsList()) : [],
|
|
175
|
-
request.send(activity.getJackpotList({ appSecret })),
|
|
176
168
|
])
|
|
177
169
|
|
|
178
|
-
return { activityList: data, promotionList
|
|
170
|
+
return { activityList: data, promotionList }
|
|
179
171
|
},
|
|
180
172
|
fetchActivitiesDetail: async (context, event) => {
|
|
181
173
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
@@ -13,7 +13,6 @@ export default function (request) {
|
|
|
13
13
|
activityList: [],
|
|
14
14
|
tournamentList: [],
|
|
15
15
|
promotionList: [],
|
|
16
|
-
jackpotList: [],
|
|
17
16
|
uidSite: '',
|
|
18
17
|
detailNeededActivityTypes: [29, 34],
|
|
19
18
|
activityDetailList: [],
|
|
@@ -24,7 +23,7 @@ export default function (request) {
|
|
|
24
23
|
src: 'fetchList',
|
|
25
24
|
onDone: {
|
|
26
25
|
target: 'checking',
|
|
27
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'
|
|
26
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
28
27
|
},
|
|
29
28
|
onError: {
|
|
30
29
|
target: 'pending',
|
|
@@ -97,12 +96,6 @@ export default function (request) {
|
|
|
97
96
|
promotionList,
|
|
98
97
|
}
|
|
99
98
|
}),
|
|
100
|
-
setJackpotList: assign((context, event) => {
|
|
101
|
-
const { jackpotList } = event.data
|
|
102
|
-
return {
|
|
103
|
-
jackpotList,
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
99
|
setUnread: assign((context, event) => {
|
|
107
100
|
const { uidSite, activityNo, unread } = event.data
|
|
108
101
|
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
@@ -139,13 +132,12 @@ export default function (request) {
|
|
|
139
132
|
services: {
|
|
140
133
|
fetchList: async (context, event) => {
|
|
141
134
|
const hasToken = request.getToken()
|
|
142
|
-
const [{ data }, promotionList
|
|
135
|
+
const [{ data }, promotionList] = await Promise.all([
|
|
143
136
|
request.send(activity.getActivityList({ appSecret })),
|
|
144
137
|
hasToken ? request.send(payment.getPromotionsList()) : [],
|
|
145
|
-
request.send(activity.getJackpotList({ appSecret })),
|
|
146
138
|
])
|
|
147
139
|
|
|
148
|
-
return { activityList: data, promotionList
|
|
140
|
+
return { activityList: data, promotionList }
|
|
149
141
|
},
|
|
150
142
|
fetchActivityDetailList: async (context, event) => {
|
|
151
143
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
@@ -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',
|
|
@@ -177,20 +155,18 @@ export default function (request, context) {
|
|
|
177
155
|
setInitData: assign((context, event) => {
|
|
178
156
|
const { currentPayment, banks, paymentInfo, withdrawRule, processing } = event.data
|
|
179
157
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
// const userBanks = (paymentInfo.bankList || []).map((bank) => {
|
|
188
|
-
// bank.displayText = `${bank.bankCode} - ${bank.accountNumber}`
|
|
189
|
-
// bank.imageUrl = banks.find((item) => item.bankCode === bank.bankCode)?.imageUrl
|
|
190
|
-
// return bank
|
|
191
|
-
// })
|
|
158
|
+
const withdrawBanks = (paymentInfo?.bankInfo || [])
|
|
159
|
+
.map((item) => {
|
|
160
|
+
const matchedBank = banks.find((bank) => bank.bankCode === item.bankCode)
|
|
161
|
+
return matchedBank ? { ...item, ...matchedBank } : null
|
|
162
|
+
})
|
|
163
|
+
.filter(Boolean)
|
|
192
164
|
|
|
193
|
-
const userBanks = [
|
|
165
|
+
const userBanks = (withdrawBanks || []).map((bank) => {
|
|
166
|
+
bank.displayText = `${bank.bankCode} - ${bank.accountNumber}`
|
|
167
|
+
bank.imageUrl = banks.find((item) => item.bankCode === bank.bankCode)?.imageUrl
|
|
168
|
+
return bank
|
|
169
|
+
})
|
|
194
170
|
|
|
195
171
|
return {
|
|
196
172
|
currentPayment,
|
|
@@ -262,8 +238,7 @@ export default function (request, context) {
|
|
|
262
238
|
|
|
263
239
|
const [banks, paymentInfo, withdrawRule, orders] = await Promise.all([
|
|
264
240
|
request.send(payment.getWithdrawBankList()),
|
|
265
|
-
|
|
266
|
-
request.send(payment.getBindingPaymentInfo()),
|
|
241
|
+
request.send(payment.getPaymentInfo()),
|
|
267
242
|
request.send(payment.getDoubleWalletWithdrawRule({ walletType: 'CASH' })),
|
|
268
243
|
request.send(payment.getPendingOrder({ transferType: 'WITHDRAW' })),
|
|
269
244
|
])
|
|
@@ -286,21 +261,7 @@ export default function (request, context) {
|
|
|
286
261
|
applyerBankCode: selectedUserBank.bankCode,
|
|
287
262
|
applyerAccountNumber: selectedUserBank.accountNumber,
|
|
288
263
|
branch: branchTemp,
|
|
289
|
-
|
|
290
|
-
})
|
|
291
|
-
)
|
|
292
|
-
},
|
|
293
|
-
submitWithdrawCrypto: async (context, event) => {
|
|
294
|
-
const { currentPayment, selectedUserBank, selectedAmount } = context
|
|
295
|
-
const branchTemp = ['GCASH', 'PAYM', 'PIX'].includes(selectedUserBank.bankCode) ? '' : selectedUserBank.branch
|
|
296
|
-
return await request.send(
|
|
297
|
-
payment.submitWithdrawTransactionCrypto({
|
|
298
|
-
method: currentPayment.method,
|
|
299
|
-
amount: selectedAmount,
|
|
300
|
-
cryptoCurrency: selectedUserBank.cryptoCurrency,
|
|
301
|
-
cryptoNetwork: selectedUserBank.cryptoNetwork,
|
|
302
|
-
targetAddress: selectedUserBank.cryptoAddress,
|
|
303
|
-
applyerHolderName: selectedUserBank.holderName,
|
|
264
|
+
holderName: selectedUserBank.holderName,
|
|
304
265
|
})
|
|
305
266
|
)
|
|
306
267
|
},
|