@jetthai/cuora 1.0.307-dev-2 → 1.1.0
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 +3 -854
- 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 +21 -146
- 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 +25 -113
- 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 +17 -117
- 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
package/src/machine/reward.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createMachine, assign, send } from 'xstate'
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
|
-
import payment from '../api/payment.js'
|
|
4
3
|
|
|
5
4
|
export default function (request) {
|
|
6
5
|
const { appSecret } = request.config
|
|
@@ -12,11 +11,7 @@ export default function (request) {
|
|
|
12
11
|
otherRewardList: [],
|
|
13
12
|
pointsRewardList: [],
|
|
14
13
|
rewardList: [],
|
|
15
|
-
|
|
16
|
-
receiveNo: null,
|
|
17
|
-
withdrawRule: {},
|
|
18
|
-
rewardType: null,
|
|
19
|
-
callback: () => {},
|
|
14
|
+
callback: () => { },
|
|
20
15
|
},
|
|
21
16
|
states: {
|
|
22
17
|
timer: {
|
|
@@ -51,13 +46,9 @@ export default function (request) {
|
|
|
51
46
|
states: {
|
|
52
47
|
idle: {
|
|
53
48
|
on: {
|
|
54
|
-
FETCH_WITHDRAW_RULE: {
|
|
55
|
-
target: 'fetching',
|
|
56
|
-
actions: 'setRewardData',
|
|
57
|
-
},
|
|
58
49
|
RECEIVE_REWARD: {
|
|
59
50
|
target: 'receiving',
|
|
60
|
-
actions:
|
|
51
|
+
actions: 'setCallback',
|
|
61
52
|
},
|
|
62
53
|
RECEIVE_ALL_POINTS: {
|
|
63
54
|
target: 'allPointsReceiving',
|
|
@@ -65,44 +56,14 @@ export default function (request) {
|
|
|
65
56
|
},
|
|
66
57
|
},
|
|
67
58
|
},
|
|
68
|
-
fetching: {
|
|
69
|
-
invoke: {
|
|
70
|
-
src: 'fetchWithdrawRulePreview',
|
|
71
|
-
onDone: {
|
|
72
|
-
target: 'pending',
|
|
73
|
-
actions: 'setWithdrawRulePreview',
|
|
74
|
-
},
|
|
75
|
-
onError: {
|
|
76
|
-
target: 'idle',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
pending: {
|
|
81
|
-
on: {
|
|
82
|
-
RECEIVE_REWARD: {
|
|
83
|
-
target: 'receiving',
|
|
84
|
-
actions: 'setCallback',
|
|
85
|
-
},
|
|
86
|
-
BACK: {
|
|
87
|
-
target: 'idle',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
59
|
receiving: {
|
|
92
60
|
invoke: {
|
|
93
61
|
src: 'receiveReward',
|
|
94
|
-
onDone:
|
|
95
|
-
{ target: 'received', cond: 'isPrize', actions: send({ type: 'REFRESH' }) },
|
|
96
|
-
{ target: 'received', actions: [send({ type: 'REFRESH' }), 'doCallback'] },
|
|
97
|
-
],
|
|
98
|
-
onError: {
|
|
62
|
+
onDone: {
|
|
99
63
|
target: 'idle',
|
|
64
|
+
actions: [send({ type: 'REFRESH' }), 'doCallback'],
|
|
100
65
|
},
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
received: {
|
|
104
|
-
after: {
|
|
105
|
-
0: {
|
|
66
|
+
onError: {
|
|
106
67
|
target: 'idle',
|
|
107
68
|
},
|
|
108
69
|
},
|
|
@@ -132,51 +93,23 @@ export default function (request) {
|
|
|
132
93
|
rewardList: event.data[2]?.data || [],
|
|
133
94
|
}
|
|
134
95
|
}),
|
|
135
|
-
setRewardData: assign((context, event) => {
|
|
136
|
-
const { activityNo, receiveNo } = event.data
|
|
137
|
-
return {
|
|
138
|
-
activityNo,
|
|
139
|
-
receiveNo,
|
|
140
|
-
}
|
|
141
|
-
}),
|
|
142
96
|
setCallback: assign((context, event) => {
|
|
143
97
|
return {
|
|
144
|
-
callback: event.data?.callback || (() => {}),
|
|
145
|
-
}
|
|
146
|
-
}),
|
|
147
|
-
setRewardType: assign((context, event) => {
|
|
148
|
-
return {
|
|
149
|
-
rewardType: event.data?.rewardType,
|
|
98
|
+
callback: event.data?.callback || (() => { }),
|
|
150
99
|
}
|
|
151
100
|
}),
|
|
152
101
|
doCallback: (context, event) => {
|
|
153
102
|
context.callback()
|
|
154
103
|
},
|
|
155
|
-
setWithdrawRulePreview: assign((context, event) => {
|
|
156
|
-
return {
|
|
157
|
-
withdrawRule: event.data,
|
|
158
|
-
}
|
|
159
|
-
}),
|
|
160
|
-
},
|
|
161
|
-
guards: {
|
|
162
|
-
isPrize: (context, event) => {
|
|
163
|
-
const { rewardType } = context
|
|
164
|
-
return rewardType === 'PRIZE'
|
|
165
|
-
},
|
|
166
104
|
},
|
|
167
105
|
services: {
|
|
168
106
|
fetchRewardList: async (context, event) => {
|
|
169
107
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
170
108
|
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
171
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE
|
|
109
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE', count: 30, appSecret }))
|
|
172
110
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
173
111
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
174
112
|
},
|
|
175
|
-
fetchWithdrawRulePreview: async (context, event) => {
|
|
176
|
-
const { receiveNo } = context
|
|
177
|
-
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|
|
178
|
-
return data
|
|
179
|
-
},
|
|
180
113
|
receiveReward: async (context, event) => {
|
|
181
114
|
const { activityNo, receiveNo, attended } = event.data
|
|
182
115
|
return await request.send(activity.getReward({ activityNo, receiveNo, appSecret, attended }))
|
package/src/machine/setting.js
CHANGED
|
@@ -6,8 +6,6 @@ export default function () {
|
|
|
6
6
|
id: 'setting',
|
|
7
7
|
initial: 'idle',
|
|
8
8
|
context: {
|
|
9
|
-
musicPlay: true,
|
|
10
|
-
soundPlay: true,
|
|
11
9
|
sound: false,
|
|
12
10
|
music: false,
|
|
13
11
|
locale: 'en-US',
|
|
@@ -24,9 +22,8 @@ export default function () {
|
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
24
|
actions: {
|
|
27
|
-
fetchSetting: assign((
|
|
28
|
-
const {
|
|
29
|
-
const setting = JSON.parse(localStorage.getItem('setting')) || { sound: soundPlay, music: musicPlay }
|
|
25
|
+
fetchSetting: assign(() => {
|
|
26
|
+
const setting = JSON.parse(localStorage.getItem('setting')) || { sound: true, music: true }
|
|
30
27
|
return { ...setting }
|
|
31
28
|
}),
|
|
32
29
|
saveSetting: assign((context, event) => {
|
package/src/machine/side_v2.js
CHANGED
|
@@ -11,7 +11,6 @@ export default function (request) {
|
|
|
11
11
|
menuItemStack: [],
|
|
12
12
|
previousMenuItemStack: [],
|
|
13
13
|
historyStack: [],
|
|
14
|
-
defaultMenuItemStack: [],
|
|
15
14
|
},
|
|
16
15
|
states: {
|
|
17
16
|
loading: {
|
|
@@ -31,13 +30,13 @@ export default function (request) {
|
|
|
31
30
|
20000: [
|
|
32
31
|
{
|
|
33
32
|
target: 'updating',
|
|
34
|
-
cond: 'isInMenu'
|
|
33
|
+
cond: 'isInMenu'
|
|
35
34
|
},
|
|
36
35
|
{
|
|
37
36
|
target: 'pending',
|
|
38
37
|
},
|
|
39
|
-
]
|
|
40
|
-
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
41
40
|
},
|
|
42
41
|
updating: {
|
|
43
42
|
invoke: {
|
|
@@ -57,14 +56,11 @@ export default function (request) {
|
|
|
57
56
|
actions: 'restoreMenuItemStack',
|
|
58
57
|
},
|
|
59
58
|
PUSH: {
|
|
60
|
-
actions: 'pushHistoryStack'
|
|
59
|
+
actions: 'pushHistoryStack'
|
|
61
60
|
},
|
|
62
61
|
POP: {
|
|
63
|
-
actions: 'popHistoryStack'
|
|
64
|
-
}
|
|
65
|
-
RESET: {
|
|
66
|
-
actions: 'resetMenuItemStack',
|
|
67
|
-
},
|
|
62
|
+
actions: 'popHistoryStack'
|
|
63
|
+
}
|
|
68
64
|
},
|
|
69
65
|
},
|
|
70
66
|
},
|
|
@@ -80,33 +76,40 @@ export default function (request) {
|
|
|
80
76
|
const menu = event.data
|
|
81
77
|
if (menu.data.length > 0) {
|
|
82
78
|
const menuItemStack = getDefaultItem(menu.data[0])
|
|
83
|
-
return { menuItemStack
|
|
79
|
+
return { menuItemStack }
|
|
84
80
|
}
|
|
85
81
|
}),
|
|
86
82
|
setMenuItemStack: assign((context, event) => {
|
|
87
83
|
const { menuItemStack } = context
|
|
88
84
|
const inputItem = event.data
|
|
89
85
|
const isTopItem = inputItem.level === 0
|
|
90
|
-
const hasSubMenu = inputItem.sub
|
|
86
|
+
const hasSubMenu = inputItem.sub.length
|
|
91
87
|
|
|
92
88
|
if (isTopItem) {
|
|
93
89
|
if (hasSubMenu) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
const isSameBranch = menuItemStack[0].categoryId === inputItem.categoryId
|
|
91
|
+
if (isSameBranch) {
|
|
92
|
+
return {
|
|
93
|
+
previousMenuItemStack: menuItemStack,
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
return {
|
|
97
|
+
previousMenuItemStack: menuItemStack,
|
|
98
|
+
menuItemStack: [event.data],
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
} else {
|
|
99
102
|
return {
|
|
100
103
|
previousMenuItemStack: [],
|
|
101
104
|
menuItemStack: [event.data],
|
|
102
|
-
historyStack: []
|
|
105
|
+
historyStack: []
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
} else {
|
|
106
109
|
const slicedStack = menuItemStack.slice(0, inputItem.level)
|
|
107
110
|
return {
|
|
108
111
|
menuItemStack: [...slicedStack, event.data],
|
|
109
|
-
historyStack: []
|
|
112
|
+
historyStack: []
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}),
|
|
@@ -121,13 +124,13 @@ export default function (request) {
|
|
|
121
124
|
const menu = event.data
|
|
122
125
|
if (menu.data.length) {
|
|
123
126
|
addLevelProperty(menu.data, 0)
|
|
124
|
-
return { menu
|
|
127
|
+
return { menu }
|
|
125
128
|
}
|
|
126
129
|
}),
|
|
127
130
|
pushHistoryStack: assign((context, event) => {
|
|
128
131
|
const { menuItemStack, historyStack } = context
|
|
129
132
|
return {
|
|
130
|
-
historyStack:
|
|
133
|
+
historyStack: historyStack.concat(menuItemStack.slice(-1)),
|
|
131
134
|
}
|
|
132
135
|
}),
|
|
133
136
|
popHistoryStack: assign((context, event) => {
|
|
@@ -136,17 +139,13 @@ export default function (request) {
|
|
|
136
139
|
historyStack: historyStack.slice(0, -1),
|
|
137
140
|
}
|
|
138
141
|
}),
|
|
139
|
-
resetMenuItemStack: assign((context, event) => {
|
|
140
|
-
const { defaultMenuItemStack } = context
|
|
141
|
-
return { menuItemStack: defaultMenuItemStack }
|
|
142
|
-
}),
|
|
143
142
|
},
|
|
144
143
|
guards: {
|
|
145
|
-
isInMenu: (context, event) => {
|
|
146
|
-
const {
|
|
144
|
+
isInMenu: ((context, event) => {
|
|
145
|
+
const {menuItemStack, menu} = context
|
|
147
146
|
const menuItem = menuItemStack.slice(-1)[0]
|
|
148
147
|
return isItemInMenu(menuItem, menu.data)
|
|
149
|
-
}
|
|
148
|
+
})
|
|
150
149
|
},
|
|
151
150
|
services: {
|
|
152
151
|
getMenu: async (context, event) => {
|
|
@@ -167,7 +166,7 @@ function isItemInMenu(targetItem, menuList) {
|
|
|
167
166
|
} else {
|
|
168
167
|
if (currentItem.categoryId === targetItem.categoryId) {
|
|
169
168
|
return true
|
|
170
|
-
} else if (currentItem.sub
|
|
169
|
+
} else if (currentItem.sub.length) {
|
|
171
170
|
return isItemInMenu(targetItem, currentItem.sub)
|
|
172
171
|
} else {
|
|
173
172
|
return false
|
|
@@ -177,7 +176,7 @@ function isItemInMenu(targetItem, menuList) {
|
|
|
177
176
|
}
|
|
178
177
|
|
|
179
178
|
function getDefaultItem(node) {
|
|
180
|
-
if (node.sub
|
|
179
|
+
if (node.sub.length > 0) {
|
|
181
180
|
const stack = getDefaultItem(node.sub[0])
|
|
182
181
|
return [node, ...stack]
|
|
183
182
|
} else {
|
|
@@ -189,10 +188,6 @@ function addLevelProperty(list, level) {
|
|
|
189
188
|
const nextLevel = level + 1
|
|
190
189
|
for (let i = 0; i < list.length; i++) {
|
|
191
190
|
list[i].level = level
|
|
192
|
-
|
|
193
|
-
// avoid games in list
|
|
194
|
-
if (!list[i].isGame) {
|
|
195
|
-
addLevelProperty(list[i].sub, nextLevel)
|
|
196
|
-
}
|
|
191
|
+
addLevelProperty(list[i].sub, nextLevel)
|
|
197
192
|
}
|
|
198
193
|
}
|
|
@@ -3,6 +3,7 @@ import auth from '../api/auth.js'
|
|
|
3
3
|
import { getDeviceToken } from '../util/deviceToken.js'
|
|
4
4
|
import storage from '../util/storage.js'
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
export default function (request) {
|
|
7
8
|
const { fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
|
|
8
9
|
return createMachine(
|
|
@@ -14,7 +15,7 @@ export default function (request) {
|
|
|
14
15
|
channel: null,
|
|
15
16
|
subchannel: null,
|
|
16
17
|
signUpData: {},
|
|
17
|
-
|
|
18
|
+
affiliate: null,
|
|
18
19
|
reCaptchaToken: null,
|
|
19
20
|
registrationData: {
|
|
20
21
|
account: null,
|
|
@@ -23,22 +24,17 @@ export default function (request) {
|
|
|
23
24
|
strategy: null,
|
|
24
25
|
uid: null,
|
|
25
26
|
},
|
|
26
|
-
deviceTokenEnable: true,
|
|
27
27
|
},
|
|
28
28
|
states: {
|
|
29
29
|
idle: {
|
|
30
30
|
on: {
|
|
31
|
-
SIGN_UP_ID: {
|
|
32
|
-
target: 'authentication',
|
|
33
|
-
actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpId'],
|
|
34
|
-
},
|
|
35
31
|
SIGN_UP_PHONE: {
|
|
36
32
|
target: 'authentication',
|
|
37
|
-
actions: ['setReCaptchaToken', '
|
|
33
|
+
actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpPhone'],
|
|
38
34
|
},
|
|
39
35
|
SIGN_UP_EMAIL: {
|
|
40
36
|
target: 'authentication',
|
|
41
|
-
actions: ['setReCaptchaToken', '
|
|
37
|
+
actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpEmail'],
|
|
42
38
|
},
|
|
43
39
|
},
|
|
44
40
|
},
|
|
@@ -56,11 +52,6 @@ export default function (request) {
|
|
|
56
52
|
},
|
|
57
53
|
authenticated: {},
|
|
58
54
|
},
|
|
59
|
-
on: {
|
|
60
|
-
SET_DEVICE_TOKEN_ENABLE: {
|
|
61
|
-
actions: 'setDeviceTokenEnable',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
55
|
},
|
|
65
56
|
{
|
|
66
57
|
actions: {
|
|
@@ -70,115 +61,39 @@ export default function (request) {
|
|
|
70
61
|
reCaptchaToken,
|
|
71
62
|
}
|
|
72
63
|
}),
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
return { fc }
|
|
76
|
-
}),
|
|
77
|
-
setSignUpId: assign((context, event) => {
|
|
78
|
-
const {
|
|
79
|
-
username,
|
|
80
|
-
nick_name,
|
|
81
|
-
password,
|
|
82
|
-
countryCode,
|
|
83
|
-
phone,
|
|
84
|
-
channel,
|
|
85
|
-
subchannel,
|
|
86
|
-
bankCode,
|
|
87
|
-
bankAccount,
|
|
88
|
-
holderName,
|
|
89
|
-
branch,
|
|
90
|
-
branchCode,
|
|
91
|
-
affiliateCode,
|
|
92
|
-
} = event.data
|
|
64
|
+
setAffiliate: assign((context, event) => {
|
|
65
|
+
const { affiliate } = event.data
|
|
93
66
|
return {
|
|
94
|
-
|
|
95
|
-
provider: 'local',
|
|
96
|
-
username,
|
|
97
|
-
nick_name,
|
|
98
|
-
password,
|
|
99
|
-
countryCode,
|
|
100
|
-
phone,
|
|
101
|
-
bankCode,
|
|
102
|
-
bankAccount,
|
|
103
|
-
holderName,
|
|
104
|
-
branch,
|
|
105
|
-
branchCode,
|
|
106
|
-
affiliateCode,
|
|
107
|
-
},
|
|
108
|
-
channel,
|
|
109
|
-
subchannel,
|
|
67
|
+
affiliate,
|
|
110
68
|
}
|
|
111
69
|
}),
|
|
112
70
|
setSignUpPhone: assign((context, event) => {
|
|
113
|
-
const {
|
|
114
|
-
countryCode,
|
|
115
|
-
phone,
|
|
116
|
-
nick_name,
|
|
117
|
-
password,
|
|
118
|
-
channel,
|
|
119
|
-
subchannel,
|
|
120
|
-
bankCode,
|
|
121
|
-
bankAccount,
|
|
122
|
-
holderName,
|
|
123
|
-
branch,
|
|
124
|
-
branchCode,
|
|
125
|
-
affiliateCode,
|
|
126
|
-
} = event.data
|
|
71
|
+
const { countryCode, phone, password, channel, subchannel } = event.data
|
|
127
72
|
return {
|
|
128
73
|
signUpData: {
|
|
129
74
|
provider: 'phone',
|
|
130
75
|
countryCode,
|
|
131
76
|
phone,
|
|
132
|
-
nick_name,
|
|
133
77
|
password,
|
|
134
|
-
bankCode,
|
|
135
|
-
bankAccount,
|
|
136
|
-
holderName,
|
|
137
|
-
branch,
|
|
138
|
-
branchCode,
|
|
139
|
-
affiliateCode,
|
|
140
78
|
},
|
|
141
79
|
channel,
|
|
142
80
|
subchannel,
|
|
143
81
|
}
|
|
144
82
|
}),
|
|
145
83
|
setSignUpEmail: assign((context, event) => {
|
|
146
|
-
const {
|
|
147
|
-
email,
|
|
148
|
-
nick_name,
|
|
149
|
-
password,
|
|
150
|
-
channel,
|
|
151
|
-
subchannel,
|
|
152
|
-
bankCode,
|
|
153
|
-
bankAccount,
|
|
154
|
-
holderName,
|
|
155
|
-
branch,
|
|
156
|
-
branchCode,
|
|
157
|
-
affiliateCode,
|
|
158
|
-
countryCode,
|
|
159
|
-
phone,
|
|
160
|
-
} = event.data
|
|
84
|
+
const { email, password, channel, subchannel } = event.data
|
|
161
85
|
return {
|
|
162
86
|
signUpData: {
|
|
163
87
|
provider: 'email',
|
|
164
88
|
email,
|
|
165
|
-
nick_name,
|
|
166
89
|
password,
|
|
167
|
-
bankCode,
|
|
168
|
-
bankAccount,
|
|
169
|
-
holderName,
|
|
170
|
-
branch,
|
|
171
|
-
branchCode,
|
|
172
|
-
affiliateCode,
|
|
173
|
-
countryCode,
|
|
174
|
-
phone,
|
|
175
90
|
},
|
|
176
91
|
channel,
|
|
177
92
|
subchannel,
|
|
178
93
|
}
|
|
179
94
|
}),
|
|
180
95
|
setRegistrationData: assign((context, event) => {
|
|
181
|
-
const { account, currency, site, strategy, uid
|
|
96
|
+
const { account, currency, site, strategy, uid } = event.data
|
|
182
97
|
return {
|
|
183
98
|
registrationData: {
|
|
184
99
|
account,
|
|
@@ -186,49 +101,34 @@ export default function (request) {
|
|
|
186
101
|
site,
|
|
187
102
|
strategy,
|
|
188
103
|
uid,
|
|
189
|
-
channel,
|
|
190
|
-
sub_channel,
|
|
191
104
|
},
|
|
192
105
|
}
|
|
193
106
|
}),
|
|
194
|
-
setDeviceTokenEnable: assign((context, event) => {
|
|
195
|
-
return {
|
|
196
|
-
deviceTokenEnable: event.data,
|
|
197
|
-
}
|
|
198
|
-
}),
|
|
199
107
|
},
|
|
200
108
|
services: {
|
|
201
109
|
authenticate: async (context, event) => {
|
|
202
|
-
const { channel, subchannel, signUpData
|
|
203
|
-
const dt = await getDeviceToken({ fpToken, sentry,
|
|
110
|
+
const { channel, subchannel, signUpData } = context
|
|
111
|
+
const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL })
|
|
204
112
|
|
|
205
|
-
|
|
113
|
+
sentry.setTag('dt', dt)
|
|
206
114
|
const messages = {
|
|
207
115
|
url: window.location.href,
|
|
208
|
-
|
|
116
|
+
list: [
|
|
209
117
|
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
210
118
|
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
211
119
|
{ channel: channel, subchannel: subchannel },
|
|
212
120
|
],
|
|
213
|
-
affiliateCode,
|
|
214
121
|
}
|
|
215
122
|
sentry.captureMessage(JSON.stringify(messages))
|
|
216
123
|
|
|
217
|
-
const referralObj = {}
|
|
218
|
-
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
219
|
-
referralObj.ac = affiliateCode
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
223
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
224
|
-
|
|
225
124
|
return await request.send(
|
|
226
125
|
auth.register({
|
|
227
126
|
...signUpData,
|
|
228
|
-
|
|
127
|
+
channel: storage.get('channel') || defaultChannel || channel,
|
|
128
|
+
subchannel: storage.get('subchannel') || defaultSubchannel || subchannel,
|
|
229
129
|
dt,
|
|
230
130
|
reCaptchaToken: context.reCaptchaToken,
|
|
231
|
-
|
|
131
|
+
affiliate: context.affiliate
|
|
232
132
|
})
|
|
233
133
|
)
|
|
234
134
|
},
|