@jetthai/cuora 1.1.270 → 1.1.272-jackpot-2
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 +10 -0
- package/package.json +1 -1
- package/src/api/activity.js +6 -0
- package/src/api/payment.js +9 -4
- package/src/api/user.js +2 -0
- package/src/machine/activity/activity.js +11 -3
- package/src/machine/activity/activity_cash.js +11 -3
- package/src/machine/game_v2_1.js +23 -0
- package/src/machine/index.js +2 -0
- package/src/machine/user_photo.js +67 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +52 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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
|
+
### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.272) (2024-05-21)
|
|
12
|
+
|
|
13
|
+
### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
|
|
14
|
+
|
|
5
15
|
### [1.1.270](https://github.com/jetthai/cuora-module/compare/v1.1.269...v1.1.270) (2024-05-16)
|
|
6
16
|
|
|
7
17
|
### [1.1.269](https://github.com/jetthai/cuora-module/compare/v1.1.268...v1.1.269) (2024-05-15)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -6,6 +6,12 @@ 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
|
+
}),
|
|
9
15
|
getTournamentDetail: ({ activityNo, appSecret }) => ({
|
|
10
16
|
url: 'tournament/detail',
|
|
11
17
|
method: 'get',
|
package/src/api/payment.js
CHANGED
|
@@ -93,6 +93,11 @@ 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
|
+
}),
|
|
96
101
|
getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
|
|
97
102
|
url: `payment/v2/${method}/expected/result`,
|
|
98
103
|
method: 'post',
|
|
@@ -158,12 +163,12 @@ export default {
|
|
|
158
163
|
method: 'post',
|
|
159
164
|
params: { transferType: 'DEPOSIT', amount, promotionsNo },
|
|
160
165
|
}),
|
|
161
|
-
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
|
|
166
|
+
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName }) => ({
|
|
162
167
|
url: `payment/v2/${method}/transaction`,
|
|
163
168
|
method: 'post',
|
|
164
|
-
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
|
|
169
|
+
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName },
|
|
165
170
|
}),
|
|
166
|
-
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch,
|
|
171
|
+
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, applyerHolderName }) => ({
|
|
167
172
|
url: `payment/v2/${method}/transaction`,
|
|
168
173
|
method: 'post',
|
|
169
174
|
params: {
|
|
@@ -172,7 +177,7 @@ export default {
|
|
|
172
177
|
applyerBankCode,
|
|
173
178
|
applyerAccountNumber,
|
|
174
179
|
branch,
|
|
175
|
-
|
|
180
|
+
applyerHolderName,
|
|
176
181
|
},
|
|
177
182
|
}),
|
|
178
183
|
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
package/src/api/user.js
CHANGED
|
@@ -57,4 +57,6 @@ export default {
|
|
|
57
57
|
isPublic: true,
|
|
58
58
|
}),
|
|
59
59
|
otpReset: ({ requestId, target }) => ({ url: '/otpsso/reset', method: 'post', params: { requestId, target }, isPublic: true }),
|
|
60
|
+
getUserPhotoList: () => ({ url: 'getAllAvatar', method: 'get' }),
|
|
61
|
+
updateUserPhoto: (data) => ({ url: 'updateUserAvatar', method: 'post', params: data }),
|
|
60
62
|
}
|
|
@@ -14,6 +14,7 @@ export default function (request) {
|
|
|
14
14
|
activitiesDetailList: [],
|
|
15
15
|
activityList: [],
|
|
16
16
|
promotionList: [],
|
|
17
|
+
jackpotList: [],
|
|
17
18
|
activityMap: {},
|
|
18
19
|
tournamentList: [],
|
|
19
20
|
refs: {},
|
|
@@ -34,7 +35,7 @@ export default function (request) {
|
|
|
34
35
|
src: 'fetchList',
|
|
35
36
|
onDone: {
|
|
36
37
|
target: 'idle',
|
|
37
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
38
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
|
|
38
39
|
},
|
|
39
40
|
onError: {
|
|
40
41
|
target: 'idle',
|
|
@@ -123,6 +124,12 @@ export default function (request) {
|
|
|
123
124
|
promotionList,
|
|
124
125
|
}
|
|
125
126
|
}),
|
|
127
|
+
setJackpotList: assign((context, event) => {
|
|
128
|
+
const { jackpotList } = event.data
|
|
129
|
+
return {
|
|
130
|
+
jackpotList,
|
|
131
|
+
}
|
|
132
|
+
}),
|
|
126
133
|
setActivitiesDetailList: assign((context, event) => {
|
|
127
134
|
return {
|
|
128
135
|
activitiesDetailList: event.data.map((item) => item.data),
|
|
@@ -162,12 +169,13 @@ export default function (request) {
|
|
|
162
169
|
const hasToken = request.getToken()
|
|
163
170
|
const isDoubleWallet = context.siteConfig?.walletMode === '4'
|
|
164
171
|
const apiCallable = hasToken && isDoubleWallet
|
|
165
|
-
const [{ data }, promotionList] = await Promise.all([
|
|
172
|
+
const [{ data }, promotionList, jackpotList] = await Promise.all([
|
|
166
173
|
request.send(activity.getActivityList({ appSecret })),
|
|
167
174
|
apiCallable ? request.send(payment.getPromotionsList()) : [],
|
|
175
|
+
request.send(activity.getJackpotList({ appSecret })),
|
|
168
176
|
])
|
|
169
177
|
|
|
170
|
-
return { activityList: data, promotionList }
|
|
178
|
+
return { activityList: data, promotionList, jackpotList: jackpotList.data }
|
|
171
179
|
},
|
|
172
180
|
fetchActivitiesDetail: async (context, event) => {
|
|
173
181
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
@@ -13,6 +13,7 @@ export default function (request) {
|
|
|
13
13
|
activityList: [],
|
|
14
14
|
tournamentList: [],
|
|
15
15
|
promotionList: [],
|
|
16
|
+
jackpotList: [],
|
|
16
17
|
uidSite: '',
|
|
17
18
|
detailNeededActivityTypes: [29, 34],
|
|
18
19
|
activityDetailList: [],
|
|
@@ -23,7 +24,7 @@ export default function (request) {
|
|
|
23
24
|
src: 'fetchList',
|
|
24
25
|
onDone: {
|
|
25
26
|
target: 'checking',
|
|
26
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
27
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
|
|
27
28
|
},
|
|
28
29
|
onError: {
|
|
29
30
|
target: 'pending',
|
|
@@ -96,6 +97,12 @@ export default function (request) {
|
|
|
96
97
|
promotionList,
|
|
97
98
|
}
|
|
98
99
|
}),
|
|
100
|
+
setJackpotList: assign((context, event) => {
|
|
101
|
+
const { jackpotList } = event.data
|
|
102
|
+
return {
|
|
103
|
+
jackpotList,
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
99
106
|
setUnread: assign((context, event) => {
|
|
100
107
|
const { uidSite, activityNo, unread } = event.data
|
|
101
108
|
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
@@ -132,12 +139,13 @@ export default function (request) {
|
|
|
132
139
|
services: {
|
|
133
140
|
fetchList: async (context, event) => {
|
|
134
141
|
const hasToken = request.getToken()
|
|
135
|
-
const [{ data }, promotionList] = await Promise.all([
|
|
142
|
+
const [{ data }, promotionList, jackpotList] = await Promise.all([
|
|
136
143
|
request.send(activity.getActivityList({ appSecret })),
|
|
137
144
|
hasToken ? request.send(payment.getPromotionsList()) : [],
|
|
145
|
+
request.send(activity.getJackpotList({ appSecret })),
|
|
138
146
|
])
|
|
139
147
|
|
|
140
|
-
return { activityList: data, promotionList }
|
|
148
|
+
return { activityList: data, promotionList, jackpotList: jackpotList.data }
|
|
141
149
|
},
|
|
142
150
|
fetchActivityDetailList: async (context, event) => {
|
|
143
151
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -136,6 +136,29 @@ export default function (request) {
|
|
|
136
136
|
EXIT_GAME: {
|
|
137
137
|
target: 'disconnect',
|
|
138
138
|
},
|
|
139
|
+
REFRESH: {
|
|
140
|
+
target: 'refreshing',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
refreshing: {
|
|
145
|
+
invoke: {
|
|
146
|
+
src: 'disconnectGame',
|
|
147
|
+
onDone: {
|
|
148
|
+
target: 'refreshPending',
|
|
149
|
+
actions: 'setGameURL',
|
|
150
|
+
},
|
|
151
|
+
onError: {
|
|
152
|
+
target: 'idle',
|
|
153
|
+
actions: 'setGameURL',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
refreshPending: {
|
|
158
|
+
after: {
|
|
159
|
+
500: {
|
|
160
|
+
target: 'connecting',
|
|
161
|
+
},
|
|
139
162
|
},
|
|
140
163
|
},
|
|
141
164
|
disconnect: {
|
package/src/machine/index.js
CHANGED
|
@@ -33,6 +33,7 @@ import vip_table from './vip_table.js'
|
|
|
33
33
|
import promotions from './promotions.js'
|
|
34
34
|
import roulette_v2 from './roulette_v2.js'
|
|
35
35
|
import honor_board_cash from './honor_board_cash.js'
|
|
36
|
+
import user_photo from './user_photo.js'
|
|
36
37
|
|
|
37
38
|
export default {
|
|
38
39
|
...activity,
|
|
@@ -69,5 +70,6 @@ export default {
|
|
|
69
70
|
promotions,
|
|
70
71
|
roulette_v2,
|
|
71
72
|
honor_board_cash,
|
|
73
|
+
user_photo,
|
|
72
74
|
...withdraw,
|
|
73
75
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import user from '../api/user.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'user_photo',
|
|
8
|
+
initial: 'fetching',
|
|
9
|
+
context: {
|
|
10
|
+
userPhotoList: {},
|
|
11
|
+
},
|
|
12
|
+
states: {
|
|
13
|
+
fetching: {
|
|
14
|
+
invoke: {
|
|
15
|
+
src: 'fetchUserPhotoList',
|
|
16
|
+
onDone: {
|
|
17
|
+
target: 'idle',
|
|
18
|
+
actions: 'setUserPhotoList',
|
|
19
|
+
},
|
|
20
|
+
onError: {
|
|
21
|
+
target: 'idle',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
idle: {
|
|
26
|
+
on: {
|
|
27
|
+
UPDATE_USER_PHOTO: {
|
|
28
|
+
target: 'updating',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
updating: {
|
|
33
|
+
invoke: {
|
|
34
|
+
src: 'updateUserPhoto',
|
|
35
|
+
onDone: {
|
|
36
|
+
target: 'idle',
|
|
37
|
+
},
|
|
38
|
+
onError: {
|
|
39
|
+
target: 'idle',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
actions: {
|
|
47
|
+
setUserPhotoList: assign((context, event) => {
|
|
48
|
+
return {
|
|
49
|
+
userPhotoList: event.data.data,
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
},
|
|
53
|
+
services: {
|
|
54
|
+
// 取得使用者頭像列表
|
|
55
|
+
fetchUserPhotoList: async (context, event) => {
|
|
56
|
+
console.log('?fetchUserPhotoList')
|
|
57
|
+
return await request.send(user.getUserPhotoList())
|
|
58
|
+
},
|
|
59
|
+
// 更新使用者頭像
|
|
60
|
+
updateUserPhoto: async (context, event) => {
|
|
61
|
+
console.log('?updateUserPhoto', event.data)
|
|
62
|
+
return await request.send(user.updateUserPhoto(event.data))
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -50,6 +50,9 @@ export default function (request, context) {
|
|
|
50
50
|
SUBMIT: {
|
|
51
51
|
target: 'submitting',
|
|
52
52
|
},
|
|
53
|
+
SUBMIT_CRYPTO: {
|
|
54
|
+
target: 'submitting_crypto',
|
|
55
|
+
},
|
|
53
56
|
},
|
|
54
57
|
},
|
|
55
58
|
submitting: {
|
|
@@ -71,6 +74,25 @@ export default function (request, context) {
|
|
|
71
74
|
},
|
|
72
75
|
},
|
|
73
76
|
},
|
|
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
|
+
},
|
|
74
96
|
submitted: {},
|
|
75
97
|
otp: {
|
|
76
98
|
type: 'parallel',
|
|
@@ -155,18 +177,20 @@ export default function (request, context) {
|
|
|
155
177
|
setInitData: assign((context, event) => {
|
|
156
178
|
const { currentPayment, banks, paymentInfo, withdrawRule, processing } = event.data
|
|
157
179
|
|
|
158
|
-
const withdrawBanks = (paymentInfo?.bankInfo || [])
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
180
|
+
// const withdrawBanks = (paymentInfo?.bankInfo || [])
|
|
181
|
+
// .map((item) => {
|
|
182
|
+
// const matchedBank = banks.find((bank) => bank.bankCode === item.bankCode)
|
|
183
|
+
// return matchedBank ? { ...item, ...matchedBank } : null
|
|
184
|
+
// })
|
|
185
|
+
// .filter(Boolean)
|
|
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
|
+
// })
|
|
164
192
|
|
|
165
|
-
const userBanks =
|
|
166
|
-
bank.displayText = `${bank.bankCode} - ${bank.accountNumber}`
|
|
167
|
-
bank.imageUrl = banks.find((item) => item.bankCode === bank.bankCode)?.imageUrl
|
|
168
|
-
return bank
|
|
169
|
-
})
|
|
193
|
+
const userBanks = [...paymentInfo.bankList, ...paymentInfo.cryptoList, ...paymentInfo.ewalletList]
|
|
170
194
|
|
|
171
195
|
return {
|
|
172
196
|
currentPayment,
|
|
@@ -238,7 +262,8 @@ export default function (request, context) {
|
|
|
238
262
|
|
|
239
263
|
const [banks, paymentInfo, withdrawRule, orders] = await Promise.all([
|
|
240
264
|
request.send(payment.getWithdrawBankList()),
|
|
241
|
-
request.send(payment.getPaymentInfo()),
|
|
265
|
+
// request.send(payment.getPaymentInfo()),
|
|
266
|
+
request.send(payment.getBindingPaymentInfo()),
|
|
242
267
|
request.send(payment.getDoubleWalletWithdrawRule({ walletType: 'CASH' })),
|
|
243
268
|
request.send(payment.getPendingOrder({ transferType: 'WITHDRAW' })),
|
|
244
269
|
])
|
|
@@ -261,7 +286,21 @@ export default function (request, context) {
|
|
|
261
286
|
applyerBankCode: selectedUserBank.bankCode,
|
|
262
287
|
applyerAccountNumber: selectedUserBank.accountNumber,
|
|
263
288
|
branch: branchTemp,
|
|
264
|
-
|
|
289
|
+
applyerHolderName: selectedUserBank.holderName,
|
|
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,
|
|
265
304
|
})
|
|
266
305
|
)
|
|
267
306
|
},
|