@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,5 +1,5 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import payment from '../api/payment
|
|
2
|
+
import payment from '../api/payment'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
return createMachine(
|
|
@@ -7,7 +7,6 @@ export default function (request) {
|
|
|
7
7
|
id: 'bank_binding',
|
|
8
8
|
initial: 'fetching',
|
|
9
9
|
context: {
|
|
10
|
-
hasAnyAccount: false,
|
|
11
10
|
bankList: [],
|
|
12
11
|
bank: null,
|
|
13
12
|
branch: null,
|
|
@@ -17,10 +16,10 @@ export default function (request) {
|
|
|
17
16
|
states: {
|
|
18
17
|
fetching: {
|
|
19
18
|
invoke: {
|
|
20
|
-
src: '
|
|
19
|
+
src: 'fetchBanks',
|
|
21
20
|
onDone: {
|
|
22
21
|
target: 'idle',
|
|
23
|
-
actions: 'setBanks',
|
|
22
|
+
actions: ['setBanks', 'setDefaultBank'],
|
|
24
23
|
},
|
|
25
24
|
onError: {
|
|
26
25
|
target: 'idle',
|
|
@@ -80,13 +79,14 @@ export default function (request) {
|
|
|
80
79
|
{
|
|
81
80
|
actions: {
|
|
82
81
|
setBanks: assign((context, event) => {
|
|
83
|
-
const { bankList = [], paymentInfo = {} } = event.data
|
|
84
|
-
const { bankInfo = [] } = paymentInfo
|
|
85
82
|
return {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
bankList: event.data,
|
|
84
|
+
bank: event.data[0],
|
|
85
|
+
}
|
|
86
|
+
}),
|
|
87
|
+
setDefaultBank: assign((context, event) => {
|
|
88
|
+
return {
|
|
89
|
+
bank: event.data[0],
|
|
90
90
|
}
|
|
91
91
|
}),
|
|
92
92
|
},
|
|
@@ -97,18 +97,17 @@ export default function (request) {
|
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
99
|
services: {
|
|
100
|
-
|
|
100
|
+
fetchBanks: async (context, event) => {
|
|
101
101
|
const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
|
|
102
|
-
const method = paymentDetail.find((payment) => payment.
|
|
103
|
-
|
|
104
|
-
return { bankList, paymentInfo }
|
|
102
|
+
const method = paymentDetail.find((payment) => payment.methodType === 'manual').method
|
|
103
|
+
return await request.send(payment.getBankList(method))
|
|
105
104
|
},
|
|
106
105
|
updatePaymentInfo: async (context, event) => {
|
|
107
106
|
const { bank, branch, accountNumber, holderName } = context
|
|
108
107
|
return await request.send(
|
|
109
108
|
payment.updatePaymentInfo({
|
|
110
109
|
bankCode: bank.bankCode,
|
|
111
|
-
branch
|
|
110
|
+
branch,
|
|
112
111
|
bankAccount: accountNumber,
|
|
113
112
|
holderName,
|
|
114
113
|
})
|
package/src/machine/common.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import UAParser from 'ua-parser-js'
|
|
2
2
|
import { assign, createMachine } from 'xstate'
|
|
3
|
-
import
|
|
4
|
-
import api from '../api/common.js'
|
|
5
|
-
import storage from '../util/storage.js'
|
|
6
|
-
|
|
7
|
-
// const pickBy = require('lodash/pickBy')
|
|
8
|
-
// const UAParser = require('ua-parser-js')
|
|
3
|
+
import api from '../api/common'
|
|
9
4
|
|
|
10
5
|
export default function (request) {
|
|
11
|
-
const { appSecret
|
|
6
|
+
const { appSecret } = request.config
|
|
12
7
|
return createMachine(
|
|
13
8
|
{
|
|
14
9
|
id: 'common',
|
|
@@ -35,13 +30,8 @@ export default function (request) {
|
|
|
35
30
|
broadcastList: null,
|
|
36
31
|
mailBoxInfo: null,
|
|
37
32
|
promotions: [],
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
sentEmergencyBroadcastList: [],
|
|
41
|
-
sentNormalBroadcastList: [],
|
|
42
|
-
channel: null,
|
|
43
|
-
subchannel: null,
|
|
44
|
-
referralCode: null,
|
|
33
|
+
currentBroadcast: null,
|
|
34
|
+
sentBroadcastList: [],
|
|
45
35
|
},
|
|
46
36
|
states: {
|
|
47
37
|
config: {
|
|
@@ -55,7 +45,7 @@ export default function (request) {
|
|
|
55
45
|
},
|
|
56
46
|
},
|
|
57
47
|
fetching: {
|
|
58
|
-
entry:
|
|
48
|
+
entry: 'setUA',
|
|
59
49
|
invoke: {
|
|
60
50
|
src: 'fetchSiteConfig',
|
|
61
51
|
onDone: {
|
|
@@ -119,12 +109,6 @@ export default function (request) {
|
|
|
119
109
|
},
|
|
120
110
|
},
|
|
121
111
|
},
|
|
122
|
-
on: {
|
|
123
|
-
RESET_BROADCAST: {
|
|
124
|
-
target: '.idle',
|
|
125
|
-
actions: 'resetBroadcast',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
112
|
},
|
|
129
113
|
},
|
|
130
114
|
},
|
|
@@ -136,9 +120,12 @@ export default function (request) {
|
|
|
136
120
|
},
|
|
137
121
|
actions: {
|
|
138
122
|
setSiteConfig: assign((context, event) => {
|
|
139
|
-
|
|
123
|
+
let methods = event.data?.loginMethods || {}
|
|
124
|
+
Object.keys(methods).forEach((key) => {
|
|
125
|
+
if (!methods[key]) delete methods[key]
|
|
126
|
+
})
|
|
140
127
|
return {
|
|
141
|
-
siteConfig: { ...event.data, loginMethods:
|
|
128
|
+
siteConfig: { ...event.data, loginMethods: methods },
|
|
142
129
|
}
|
|
143
130
|
}),
|
|
144
131
|
setUA: assign((context, event) => {
|
|
@@ -149,71 +136,21 @@ export default function (request) {
|
|
|
149
136
|
isMobile: userAgent?.device?.type,
|
|
150
137
|
}
|
|
151
138
|
}),
|
|
152
|
-
setAgent: assign((context, event) => {
|
|
153
|
-
if (window.CC_JSB === true) {
|
|
154
|
-
// is cocos native app
|
|
155
|
-
return
|
|
156
|
-
} else {
|
|
157
|
-
let urlParams = new URLSearchParams(window.location.search)
|
|
158
|
-
const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
|
|
159
|
-
const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
|
|
160
|
-
const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
|
|
161
|
-
|
|
162
|
-
storage.set('channel', channel, {
|
|
163
|
-
path: '/',
|
|
164
|
-
maxAge: 60 * 60 * 24 * 7,
|
|
165
|
-
})
|
|
166
|
-
storage.set('subchannel', subchannel, {
|
|
167
|
-
path: '/',
|
|
168
|
-
maxAge: 60 * 60 * 24 * 7,
|
|
169
|
-
})
|
|
170
|
-
storage.set('referralCode', referralCode, {
|
|
171
|
-
path: '/',
|
|
172
|
-
maxAge: 60 * 60 * 24 * 7,
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
return {
|
|
176
|
-
channel,
|
|
177
|
-
subchannel,
|
|
178
|
-
referralCode,
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}),
|
|
182
139
|
setFeeds: assign((context, event) => {
|
|
183
140
|
const { announcementList, broadcastList, mailBoxInfo } = event.data
|
|
184
141
|
const promotions = announcementList?.announcements?.filter?.((item) => item.category === 3) || []
|
|
185
142
|
return { announcementList, broadcastList, mailBoxInfo, promotions }
|
|
186
143
|
}),
|
|
187
144
|
setBroadcast: assign((context, event) => {
|
|
188
|
-
const { broadcastList,
|
|
189
|
-
let
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
sentEmergencyList = [...sentEmergencyBroadcastList, emergencyBroadcast]
|
|
145
|
+
const { broadcastList, sentBroadcastList, currentBroadcast } = context
|
|
146
|
+
let sentList = sentBroadcastList
|
|
147
|
+
if (currentBroadcast) {
|
|
148
|
+
sentList = [...sentBroadcastList, currentBroadcast]
|
|
193
149
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
const nextEmergencyBroadcast = broadcastList?.broadcasts?.find((broadcast) => {
|
|
198
|
-
return broadcast.type === '1' && !sentEmergencyList.some((item) => item.broadcast_id === broadcast.broadcast_id)
|
|
199
|
-
})
|
|
200
|
-
const nextNormalBroadcast = broadcastList?.broadcasts?.find((broadcast) => {
|
|
201
|
-
return broadcast.type === '0' && !sentNormalList.some((item) => item.broadcast_id === broadcast.broadcast_id)
|
|
150
|
+
const nextBroadcast = broadcastList?.broadcasts?.find((broadcast) => {
|
|
151
|
+
return broadcast.type === '1' && !sentList.some((item) => item.broadcast_id === broadcast.broadcast_id)
|
|
202
152
|
})
|
|
203
|
-
return {
|
|
204
|
-
emergencyBroadcast: nextEmergencyBroadcast,
|
|
205
|
-
sentEmergencyBroadcastList: sentEmergencyList,
|
|
206
|
-
normalBroadcast: nextNormalBroadcast,
|
|
207
|
-
sentNormalBroadcastList: sentNormalList,
|
|
208
|
-
}
|
|
209
|
-
}),
|
|
210
|
-
resetBroadcast: assign((context, event) => {
|
|
211
|
-
return {
|
|
212
|
-
emergencyBroadcast: null,
|
|
213
|
-
sentEmergencyBroadcastList: [],
|
|
214
|
-
normalBroadcast: null,
|
|
215
|
-
sentNormalBroadcastList: [],
|
|
216
|
-
}
|
|
153
|
+
return { currentBroadcast: nextBroadcast, sentBroadcastList: sentList }
|
|
217
154
|
}),
|
|
218
155
|
},
|
|
219
156
|
services: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import toNumber from 'lodash/toNumber
|
|
3
|
-
import payment from '
|
|
4
|
-
|
|
5
|
-
// const toNumber = require('lodash/toNumber')
|
|
2
|
+
import toNumber from 'lodash/toNumber'
|
|
3
|
+
import payment from '../api/payment'
|
|
6
4
|
|
|
7
5
|
export default function (request) {
|
|
8
6
|
return createMachine(
|
|
@@ -58,7 +56,6 @@ export default function (request) {
|
|
|
58
56
|
},
|
|
59
57
|
},
|
|
60
58
|
checking: {
|
|
61
|
-
entry: 'clearCalculatedResult',
|
|
62
59
|
always: [{ target: 'debouncing', cond: 'isCalculable' }, { target: 'loaded' }],
|
|
63
60
|
},
|
|
64
61
|
debouncing: {
|
|
@@ -130,23 +127,17 @@ export default function (request) {
|
|
|
130
127
|
actions: {
|
|
131
128
|
setCryptos: assign((context, event) => {
|
|
132
129
|
return {
|
|
133
|
-
cryptos: event.data.map((crypto) => ({
|
|
134
|
-
...crypto,
|
|
135
|
-
label: crypto.channel,
|
|
136
|
-
value: crypto.method,
|
|
137
|
-
icon: crypto.channel,
|
|
138
|
-
})),
|
|
130
|
+
cryptos: event.data.map((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.channel })),
|
|
139
131
|
}
|
|
140
132
|
}),
|
|
141
133
|
setCrypto: assign((context, event) => {
|
|
142
134
|
const { cryptos, currentNetwork } = context
|
|
143
|
-
const method = cryptos.find((crypto) => crypto.
|
|
135
|
+
const method = cryptos.find((crypto) => crypto.channel === event.data.value)
|
|
144
136
|
const networks =
|
|
145
|
-
method?.
|
|
137
|
+
method?.optional.map((value, i) => {
|
|
146
138
|
return {
|
|
147
|
-
label: method?.
|
|
139
|
+
label: method?.originalItem?.[i],
|
|
148
140
|
value,
|
|
149
|
-
icon: value,
|
|
150
141
|
}
|
|
151
142
|
}) || []
|
|
152
143
|
|
|
@@ -189,11 +180,6 @@ export default function (request) {
|
|
|
189
180
|
submittedResult: event.data,
|
|
190
181
|
}
|
|
191
182
|
}),
|
|
192
|
-
clearCalculatedResult: assign((context, event) => {
|
|
193
|
-
return {
|
|
194
|
-
calculatedResult: null,
|
|
195
|
-
}
|
|
196
|
-
}),
|
|
197
183
|
toggleBonus: assign((context, event) => {
|
|
198
184
|
const { bonus } = context
|
|
199
185
|
return {
|
|
@@ -229,22 +215,24 @@ export default function (request) {
|
|
|
229
215
|
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
230
216
|
},
|
|
231
217
|
fetchCalculation: async (context, event) => {
|
|
232
|
-
const { currentCrypto, currentAmount } = context
|
|
218
|
+
const { cryptos, currentCrypto, currentAmount } = context
|
|
219
|
+
const method = cryptos.find((crypto) => crypto.channel === currentCrypto.value)?.method
|
|
233
220
|
return await request.send(
|
|
234
221
|
payment.getDepositExpectedResult({
|
|
235
|
-
method
|
|
222
|
+
method,
|
|
236
223
|
amount: currentAmount,
|
|
237
|
-
cryptoCurrency: currentCrypto.
|
|
224
|
+
cryptoCurrency: currentCrypto.value,
|
|
238
225
|
})
|
|
239
226
|
)
|
|
240
227
|
},
|
|
241
228
|
submitDeposit: async (context, event) => {
|
|
242
|
-
const { currentCrypto, currentNetwork, calculatedResult } = context
|
|
229
|
+
const { cryptos, currentCrypto, currentNetwork, calculatedResult } = context
|
|
230
|
+
const method = cryptos.find((crypto) => crypto.channel === currentCrypto.value)?.method
|
|
243
231
|
return await request.send(
|
|
244
|
-
payment.
|
|
245
|
-
method
|
|
232
|
+
payment.submitDepositTransaction({
|
|
233
|
+
method,
|
|
246
234
|
amount: calculatedResult.actualAmount,
|
|
247
|
-
cryptoCurrency: currentCrypto.
|
|
235
|
+
cryptoCurrency: currentCrypto.value,
|
|
248
236
|
cryptoNetwork: currentNetwork.value,
|
|
249
237
|
})
|
|
250
238
|
)
|
package/src/machine/error.js
CHANGED
|
@@ -57,7 +57,7 @@ export default function () {
|
|
|
57
57
|
},
|
|
58
58
|
guards: {
|
|
59
59
|
isLogout: (context, event) => {
|
|
60
|
-
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108'
|
|
60
|
+
return ['ERR_A201', 'ERR_A204', 'ERR_A103', 'ERR_A104', 'ERR_A108', 'ERR_F108'].includes(context.error.code)
|
|
61
61
|
},
|
|
62
62
|
isNoBalance: (context, event) => {
|
|
63
63
|
return context.error.code === 'ERR_G106'
|
package/src/machine/game.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../api/game
|
|
2
|
+
import api from '../api/game'
|
|
3
3
|
import UAParser from 'ua-parser-js'
|
|
4
4
|
|
|
5
|
-
// const UAParser = require('ua-parser-js')
|
|
6
|
-
|
|
7
5
|
export default function (request) {
|
|
8
6
|
return createMachine(
|
|
9
7
|
{
|
|
@@ -11,7 +9,6 @@ export default function (request) {
|
|
|
11
9
|
type: 'parallel',
|
|
12
10
|
context: {
|
|
13
11
|
roomId: null,
|
|
14
|
-
room: null,
|
|
15
12
|
list: [],
|
|
16
13
|
gameList: [],
|
|
17
14
|
// play params
|
|
@@ -20,7 +17,6 @@ export default function (request) {
|
|
|
20
17
|
game_id: null,
|
|
21
18
|
game_type: null,
|
|
22
19
|
mapping_id: null,
|
|
23
|
-
portrait: null,
|
|
24
20
|
},
|
|
25
21
|
lang: 'en_US',
|
|
26
22
|
isMobile: new UAParser().getResult().device.type,
|
|
@@ -42,16 +38,19 @@ export default function (request) {
|
|
|
42
38
|
idle: {
|
|
43
39
|
enter: 'clearGameInfo',
|
|
44
40
|
on: {
|
|
45
|
-
|
|
41
|
+
ENTER_ROOM: {
|
|
46
42
|
target: 'loading',
|
|
47
|
-
actions: '
|
|
43
|
+
actions: 'setRoomId',
|
|
48
44
|
cond: (context, event) => {
|
|
49
|
-
return context.
|
|
45
|
+
return context.roomId !== event.roomId
|
|
50
46
|
},
|
|
51
47
|
},
|
|
52
48
|
ENTER_GAME: {
|
|
53
49
|
target: 'connecting',
|
|
54
50
|
actions: ['setGameInfo', 'setLang'],
|
|
51
|
+
cond: (context, event) => {
|
|
52
|
+
return context.list.length > 0
|
|
53
|
+
},
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
56
|
},
|
|
@@ -174,15 +173,9 @@ export default function (request) {
|
|
|
174
173
|
setRoomId: assign((context, event) => {
|
|
175
174
|
return { roomId: event.roomId }
|
|
176
175
|
}),
|
|
177
|
-
setRoom: assign((context, event) => {
|
|
178
|
-
return {
|
|
179
|
-
room: event.data,
|
|
180
|
-
roomId: event.data.id,
|
|
181
|
-
}
|
|
182
|
-
}),
|
|
183
176
|
setList: assign((context, event) => {
|
|
184
177
|
const { statusMap, optionMap } = context
|
|
185
|
-
const { list
|
|
178
|
+
const { list } = event.data
|
|
186
179
|
const gameList = list
|
|
187
180
|
.map((item) => {
|
|
188
181
|
if (item.id) {
|
|
@@ -214,8 +207,8 @@ export default function (request) {
|
|
|
214
207
|
return { game: { provider: null, game_id: null, game_type: null, mapping_id: null } }
|
|
215
208
|
}),
|
|
216
209
|
setGameInfo: assign((context, event) => {
|
|
217
|
-
const { provider, game_id, game_type, mapping_id
|
|
218
|
-
return { game: { provider, game_id, game_type, mapping_id
|
|
210
|
+
const { provider, game_id, game_type, mapping_id } = event.data.game
|
|
211
|
+
return { game: { provider, game_id, game_type, mapping_id } }
|
|
219
212
|
}),
|
|
220
213
|
setLang: assign((context, event) => {
|
|
221
214
|
const lang = event.data.locale.replace('-', '_')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMachine, assign, send } from 'xstate'
|
|
2
|
-
import game from '../api/game
|
|
2
|
+
import game from '../api/game'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
return createMachine(
|
|
@@ -231,12 +231,16 @@ export default function (request) {
|
|
|
231
231
|
},
|
|
232
232
|
fetchGames: async (context, event) => {
|
|
233
233
|
const { tagId, tagIndex, keyword, click, clickDefault } = context
|
|
234
|
-
const { traceId, result } = await request.send(
|
|
234
|
+
const { traceId, result } = await request.send(
|
|
235
|
+
game.getGameSearchList({ id: tagId, index: tagIndex, q: keyword, click, clickDefault })
|
|
236
|
+
)
|
|
235
237
|
return { traceId, result }
|
|
236
238
|
},
|
|
237
239
|
sendTrace: async (context, event) => {
|
|
238
240
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context
|
|
239
|
-
return await request.send(
|
|
241
|
+
return await request.send(
|
|
242
|
+
game.setGameSearchTrace({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault })
|
|
243
|
+
)
|
|
240
244
|
},
|
|
241
245
|
},
|
|
242
246
|
}
|
package/src/machine/inbox.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import mailbox from '../api/mailbox
|
|
3
|
-
import activity from '../api/activity
|
|
2
|
+
import mailbox from '../api/mailbox'
|
|
3
|
+
import activity from '../api/activity'
|
|
4
4
|
|
|
5
|
+
// todo - 自動開啟系統信
|
|
6
|
+
// todo - 更新未讀數量
|
|
5
7
|
const messageState = {
|
|
6
8
|
// always: [{ actions: 'showUnread', cond: 'isShowUnread' }],
|
|
7
9
|
initial: 'idle',
|
|
@@ -222,12 +224,11 @@ export default function (request) {
|
|
|
222
224
|
},
|
|
223
225
|
fetchMessages: async (context, event) => {
|
|
224
226
|
const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
225
|
-
if (isRewardListEnable &&
|
|
227
|
+
if (isRewardListEnable && currentTab === 'REWARD') {
|
|
226
228
|
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
227
229
|
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
228
230
|
} else {
|
|
229
|
-
const
|
|
230
|
-
const nextPage = page + 1
|
|
231
|
+
const nextPage = inbox[currentTab]?.page && inbox[currentTab]?.page + 1
|
|
231
232
|
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: nextPage }))
|
|
232
233
|
const currentData = inbox[currentTab]?.data || []
|
|
233
234
|
inbox[currentTab] = { data: currentData.concat(data), ...rest }
|
package/src/machine/index.js
CHANGED
|
@@ -1,80 +1,49 @@
|
|
|
1
|
-
import activity from './activity
|
|
2
|
-
import auth from './auth
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import game_favorite from './game_favorite
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import user_reset_password from './user_reset_password.js'
|
|
25
|
-
import bank_binding from './bank_binding.js'
|
|
26
|
-
import bank_binding_amb from './bank_binding_amb.js'
|
|
27
|
-
import withdraw_fc from './withdraw_fc.js'
|
|
28
|
-
import withdraw_vn from './withdraw_vn.js'
|
|
29
|
-
import withdraw_crypto from './withdraw_crypto.js'
|
|
30
|
-
import withdraw_amb from './withdraw_amb.js'
|
|
31
|
-
import deposit from './deposit/index.js'
|
|
32
|
-
import bonus from './bonus.js'
|
|
33
|
-
import leaderboard from './leaderboard.js'
|
|
34
|
-
import auth_otp_v2 from './auth_otp_v2.js'
|
|
35
|
-
import auth_otp_v3 from './auth_otp_v3.js'
|
|
36
|
-
import vip_table from './vip_table.js'
|
|
37
|
-
import promotions from './promotions.js'
|
|
38
|
-
import roulette_v2 from './roulette_v2.js'
|
|
1
|
+
import activity from './activity'
|
|
2
|
+
import auth from './auth'
|
|
3
|
+
import auth_otp from './auth_otp'
|
|
4
|
+
import welcome from './welcome'
|
|
5
|
+
import common from './common'
|
|
6
|
+
import deposit from './deposit'
|
|
7
|
+
import error from './error'
|
|
8
|
+
import game from './game'
|
|
9
|
+
import game_favorite from './game_favorite'
|
|
10
|
+
import game_search from './game_search'
|
|
11
|
+
import game_hot_new from './game_hot_new'
|
|
12
|
+
import inbox from './inbox'
|
|
13
|
+
import merge from './merge'
|
|
14
|
+
import payment_data from './payment_data'
|
|
15
|
+
import reward from './reward'
|
|
16
|
+
import setting from './setting'
|
|
17
|
+
import side from './side'
|
|
18
|
+
import withdraw from './withdraw'
|
|
19
|
+
import user_info from './user_info'
|
|
20
|
+
import user_sign_up from './user_sign_up'
|
|
21
|
+
import user_reset_password from './user_reset_password'
|
|
22
|
+
import bank_binding from './bank_binding'
|
|
23
|
+
import withdraw_vn from './withdraw_vn'
|
|
39
24
|
|
|
40
25
|
export default {
|
|
41
26
|
...activity,
|
|
42
27
|
auth,
|
|
28
|
+
auth_otp,
|
|
43
29
|
welcome,
|
|
44
30
|
common,
|
|
45
31
|
deposit,
|
|
46
32
|
error,
|
|
47
33
|
game,
|
|
48
|
-
game_v2,
|
|
49
34
|
game_favorite,
|
|
50
|
-
game_favorite_v2,
|
|
51
35
|
game_search,
|
|
52
|
-
game_search_v2,
|
|
53
36
|
game_hot_new,
|
|
54
37
|
inbox,
|
|
55
38
|
merge,
|
|
56
39
|
payment_data,
|
|
57
40
|
reward,
|
|
58
|
-
reward_fc,
|
|
59
41
|
setting,
|
|
60
42
|
side,
|
|
61
|
-
|
|
62
|
-
game_v2_1,
|
|
43
|
+
withdraw,
|
|
63
44
|
user_info,
|
|
64
45
|
user_sign_up,
|
|
65
46
|
user_reset_password,
|
|
66
47
|
bank_binding,
|
|
67
|
-
bank_binding_amb,
|
|
68
|
-
withdraw_fc,
|
|
69
48
|
withdraw_vn,
|
|
70
|
-
withdraw_crypto,
|
|
71
|
-
withdraw_amb,
|
|
72
|
-
...deposit,
|
|
73
|
-
bonus,
|
|
74
|
-
leaderboard,
|
|
75
|
-
auth_otp_v2,
|
|
76
|
-
auth_otp_v3,
|
|
77
|
-
vip_table,
|
|
78
|
-
promotions,
|
|
79
|
-
roulette_v2,
|
|
80
49
|
}
|
package/src/machine/merge.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import payment from '../api/payment
|
|
1
|
+
import { createMachine, assign } from 'xstate'
|
|
2
|
+
import payment from '../api/payment'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
return createMachine(
|
|
@@ -53,8 +53,8 @@ export default function (request) {
|
|
|
53
53
|
const statusMap = {
|
|
54
54
|
2: 'pending',
|
|
55
55
|
3: 'success',
|
|
56
|
-
4: '
|
|
57
|
-
|
|
56
|
+
4: 'fail',
|
|
57
|
+
6: 'reject',
|
|
58
58
|
}
|
|
59
59
|
const transactionList = event.data.map((item) => {
|
|
60
60
|
item.statusName = statusMap[item.status]
|
|
@@ -74,8 +74,7 @@ export default function (request) {
|
|
|
74
74
|
},
|
|
75
75
|
services: {
|
|
76
76
|
fetchTransactionList: async (context, event) => {
|
|
77
|
-
|
|
78
|
-
return await request.send(payment.getPaymentHistory(returnDays))
|
|
77
|
+
return await request.send(payment.getPaymentHistory(7))
|
|
79
78
|
},
|
|
80
79
|
fetchSpotMarket: async (context, event) => {
|
|
81
80
|
return await request.send(payment.getSpotMarket())
|