@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
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetthai/cuora",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.67",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"type": "module",
|
|
7
6
|
"scripts": {
|
|
8
|
-
"build": "
|
|
9
|
-
"release": "standard-version && git push --follow-tags origin master && npm publish"
|
|
10
|
-
"format": "prettier --write .",
|
|
11
|
-
"prepare": "husky install"
|
|
7
|
+
"build": "webpack",
|
|
8
|
+
"release": "standard-version && git push --follow-tags origin master && npm publish"
|
|
12
9
|
},
|
|
13
10
|
"repository": {
|
|
14
11
|
"type": "git",
|
|
@@ -17,17 +14,18 @@
|
|
|
17
14
|
"author": "Neil",
|
|
18
15
|
"license": "ISC",
|
|
19
16
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"
|
|
23
|
-
"husky": "^8.0.0",
|
|
17
|
+
"@babel/core": "^7.15.8",
|
|
18
|
+
"@babel/preset-env": "^7.15.8",
|
|
19
|
+
"babel-loader": "^8.2.2",
|
|
24
20
|
"prettier": "^2.3.0",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
21
|
+
"standard-version": "^9.3.1",
|
|
22
|
+
"webpack": "^5.58.2",
|
|
23
|
+
"webpack-cli": "^4.9.0"
|
|
27
24
|
},
|
|
28
25
|
"dependencies": {
|
|
29
26
|
"lodash": "^4.17.21",
|
|
30
|
-
"
|
|
27
|
+
"qs": "^6.10.1",
|
|
28
|
+
"ua-parser-js": "^0.7.28",
|
|
31
29
|
"universal-cookie": "^4.0.4",
|
|
32
30
|
"url-join": "^4.0.1",
|
|
33
31
|
"xstate": "^4.25.0"
|
package/src/api/activity.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
getActivityTypes: ({ appSecret }) => ({ url: 'activities/types', method: 'get', params: { appSecret } }),
|
|
3
|
-
getActivityList: ({ appSecret, include
|
|
3
|
+
getActivityList: ({ appSecret, include }) => ({
|
|
4
4
|
url: 'activities/list',
|
|
5
5
|
method: 'get',
|
|
6
6
|
params: { appSecret, include },
|
|
7
|
-
isPublic: true,
|
|
8
7
|
}),
|
|
9
8
|
getActivityDetail: ({ activityNo, appSecret }) => ({
|
|
10
9
|
url: 'activities',
|
|
@@ -41,13 +40,7 @@ export default {
|
|
|
41
40
|
method: 'post',
|
|
42
41
|
params: { activityNo, receiveNo, appSecret, attended },
|
|
43
42
|
}),
|
|
44
|
-
|
|
45
|
-
url: 'activities/rewardAmount',
|
|
46
|
-
method: 'get',
|
|
47
|
-
params: { rewardType },
|
|
48
|
-
}),
|
|
49
|
-
getRewardList: ({ rewardType, count, appSecret }) => ({ url: 'activities/rewards', method: 'get', params: { rewardType, count, appSecret } }),
|
|
43
|
+
getRewardList: ({ count, appSecret }) => ({ url: 'activities/rewards', method: 'get', params: { count, appSecret } }),
|
|
50
44
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
51
|
-
collect: (
|
|
52
|
-
getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
|
|
45
|
+
collect: ({ appSecret }) => ({ url: 'activities/collect', method: 'post', params: { appSecret } }),
|
|
53
46
|
}
|
package/src/api/auth.js
CHANGED
|
@@ -1,57 +1,15 @@
|
|
|
1
|
-
import pickBy from 'lodash/pickBy'
|
|
2
1
|
export default {
|
|
3
|
-
|
|
4
|
-
url: 'guestLogin',
|
|
5
|
-
method: 'post',
|
|
6
|
-
isPublic: true,
|
|
7
|
-
}),
|
|
8
|
-
login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken }) => ({
|
|
2
|
+
login: ({ username, password, provider, countryCode, phone, email }) => ({
|
|
9
3
|
url: 'login',
|
|
10
4
|
method: 'post',
|
|
11
|
-
params: { username, password, provider, countryCode, phone, email
|
|
5
|
+
params: { username, password, provider, countryCode, phone, email },
|
|
12
6
|
isPublic: true,
|
|
13
|
-
headers: { 'x-access-captcha': reCaptchaToken },
|
|
14
7
|
}),
|
|
15
|
-
|
|
16
|
-
url:
|
|
8
|
+
register: ({ channel = 'official', subchannel = 'pwa', ...rest }) => ({
|
|
9
|
+
url: `register?channel=${channel}&subchannel=${subchannel}`,
|
|
17
10
|
method: 'post',
|
|
18
|
-
params:
|
|
19
|
-
provider,
|
|
20
|
-
data: {
|
|
21
|
-
accessToken,
|
|
22
|
-
channel,
|
|
23
|
-
subchannel,
|
|
24
|
-
dt,
|
|
25
|
-
from,
|
|
26
|
-
id,
|
|
27
|
-
name,
|
|
28
|
-
picture,
|
|
29
|
-
provider,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
11
|
+
params: rest,
|
|
32
12
|
isPublic: true,
|
|
33
13
|
}),
|
|
34
|
-
register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
|
|
35
|
-
const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
|
|
36
|
-
return value !== undefined && value !== null
|
|
37
|
-
})
|
|
38
|
-
const qs = Object.keys(params)
|
|
39
|
-
.map((key) => `${key}=${params[key]}`)
|
|
40
|
-
.join('&')
|
|
41
|
-
return {
|
|
42
|
-
url: `register?${qs}`,
|
|
43
|
-
method: 'post',
|
|
44
|
-
params: { dt, ...rest },
|
|
45
|
-
isPublic: true,
|
|
46
|
-
headers: { 'x-access-captcha': reCaptchaToken },
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
14
|
logout: () => ({ url: 'logout', method: 'post' }),
|
|
50
|
-
// bindGet for 'google' | 'zalo' | 'facebook'
|
|
51
|
-
bindGet: ({ x, provider, redirectURI }) => ({ url: 'bind', method: 'get', params: { x, provider, redirectURI } }),
|
|
52
|
-
bindPost: ({ provider, countryCode, phone, email }) => ({
|
|
53
|
-
url: 'bind',
|
|
54
|
-
method: 'post',
|
|
55
|
-
params: { provider, countryCode, phone, email },
|
|
56
|
-
}),
|
|
57
15
|
}
|
package/src/api/game.js
CHANGED
|
@@ -2,7 +2,7 @@ export default {
|
|
|
2
2
|
getGameSHA: () => ({ method: 'get', url: 'game/list/v2/sha' }),
|
|
3
3
|
getOptionMap: (code) => ({ method: 'get', url: 'game/list/v2/options', params: { code } }),
|
|
4
4
|
getGameStatus: () => ({ method: 'get', url: 'game/list/v2/status' }),
|
|
5
|
-
getGameCategory: ({ id, first }
|
|
5
|
+
getGameCategory: ({ id, first }) => ({ method: 'get', url: 'game/list/v2/category', params: { id, first } }),
|
|
6
6
|
addFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/add', params: { games: [code] } }),
|
|
7
7
|
removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
|
|
8
8
|
getStatements: () => ({ url: 'game/statements', method: 'get' }),
|
|
@@ -10,25 +10,12 @@ export default {
|
|
|
10
10
|
logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
|
|
11
11
|
|
|
12
12
|
getGameTags: ({ q }) => ({ url: 'game/search', method: 'get', params: { q } }),
|
|
13
|
-
getGameSearchHome: () => ({ url: 'game/search/home', method: 'get' }),
|
|
14
13
|
getGameSearchList: ({ id, index, q, click, clickDefault }) => ({
|
|
15
14
|
url: 'game/search/list',
|
|
16
15
|
method: 'get',
|
|
17
16
|
params: { id, index, q, click, clickDefault },
|
|
18
17
|
}),
|
|
19
|
-
setGameSearchTrace: ({
|
|
20
|
-
traceId,
|
|
21
|
-
tagId,
|
|
22
|
-
tagIndex,
|
|
23
|
-
gameCode,
|
|
24
|
-
gameCodeIndex,
|
|
25
|
-
query,
|
|
26
|
-
click,
|
|
27
|
-
clickDefault,
|
|
28
|
-
isYouMayLike,
|
|
29
|
-
isRecentlyGame,
|
|
30
|
-
isRecentlySearch,
|
|
31
|
-
}) => ({
|
|
18
|
+
setGameSearchTrace: ({ traceId, tagId, tagIndex, gameCode, gameCodeIndex, query, click, clickDefault }) => ({
|
|
32
19
|
url: 'game/search/trace',
|
|
33
20
|
method: 'post',
|
|
34
21
|
params: {
|
|
@@ -40,55 +27,6 @@ export default {
|
|
|
40
27
|
query,
|
|
41
28
|
click,
|
|
42
29
|
clickDefault,
|
|
43
|
-
isYouMayLike,
|
|
44
|
-
isRecentlyGame,
|
|
45
|
-
isRecentlySearch,
|
|
46
30
|
},
|
|
47
31
|
}),
|
|
48
|
-
gameHistory: ({ requestTimestamp, lang, provider, type }) => ({
|
|
49
|
-
url: 'game/history',
|
|
50
|
-
method: 'post',
|
|
51
|
-
params: { requestTimestamp, lang, provider, type },
|
|
52
|
-
}),
|
|
53
|
-
gameHistoryDetail: ({ requestTimestamp, provider, gameId, lang, page, row }) => ({
|
|
54
|
-
url: 'game/history/detail',
|
|
55
|
-
method: 'post',
|
|
56
|
-
params: { requestTimestamp, provider, gameId, lang, page, row },
|
|
57
|
-
}),
|
|
58
|
-
gameHistoryOptions: () => ({
|
|
59
|
-
url: 'game/history/options',
|
|
60
|
-
method: 'get',
|
|
61
|
-
}),
|
|
62
|
-
getListRoot: ({ timestamp } = {}) => ({
|
|
63
|
-
url: 'game/list/v3/root',
|
|
64
|
-
method: 'get',
|
|
65
|
-
params: { timestamp },
|
|
66
|
-
}),
|
|
67
|
-
getListCategory: ({ categoryId, timestamp, index }) => ({
|
|
68
|
-
url: 'game/list/v3/category',
|
|
69
|
-
method: 'get',
|
|
70
|
-
params: { categoryId, timestamp, index },
|
|
71
|
-
}),
|
|
72
|
-
getListAddition: ({ categoryId, timestamp, index }) => ({
|
|
73
|
-
url: 'game/list/v3/addition',
|
|
74
|
-
method: 'get',
|
|
75
|
-
params: { categoryId, timestamp, index },
|
|
76
|
-
}),
|
|
77
|
-
getListCategoryByRange: ({ categoryId, timestamp, end }) => ({
|
|
78
|
-
url: 'game/list/v3/categoryByRange',
|
|
79
|
-
method: 'get',
|
|
80
|
-
params: { categoryId, timestamp, end },
|
|
81
|
-
}),
|
|
82
|
-
getListAdditionByRange: ({ categoryId, timestamp, end }) => ({
|
|
83
|
-
url: 'game/list/v3/additionByRange',
|
|
84
|
-
method: 'get',
|
|
85
|
-
params: { categoryId, timestamp, end },
|
|
86
|
-
}),
|
|
87
|
-
getListMyFavorite: ({ timestamp } = {}) => ({
|
|
88
|
-
url: 'game/list/v3/myFavorite',
|
|
89
|
-
method: 'get',
|
|
90
|
-
params: { timestamp },
|
|
91
|
-
}),
|
|
92
|
-
addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
|
|
93
|
-
removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
|
|
94
32
|
}
|
package/src/api/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import activity from './activity
|
|
2
|
-
import auth from './auth
|
|
3
|
-
import common from './common
|
|
4
|
-
import game from './game
|
|
5
|
-
import mailbox from './mailbox
|
|
6
|
-
import payment from './payment
|
|
7
|
-
import user from './user
|
|
8
|
-
import form from './form
|
|
1
|
+
import activity from './activity'
|
|
2
|
+
import auth from './auth'
|
|
3
|
+
import common from './common'
|
|
4
|
+
import game from './game'
|
|
5
|
+
import mailbox from './mailbox'
|
|
6
|
+
import payment from './payment'
|
|
7
|
+
import user from './user'
|
|
8
|
+
import form from './form'
|
|
9
9
|
|
|
10
10
|
export default { activity, auth, common, game, mailbox, payment, user, form }
|
package/src/api/payment.js
CHANGED
|
@@ -2,29 +2,12 @@ export default {
|
|
|
2
2
|
// getPaymentHistory: () => ({ url: 'payment/history', method: 'post' }),
|
|
3
3
|
getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
|
|
4
4
|
getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
|
|
5
|
-
getTransactionHistory: (payload) => ({
|
|
6
|
-
url: 'payment/v2/transactionHistory',
|
|
7
|
-
method: 'post',
|
|
8
|
-
params: { ...payload },
|
|
9
|
-
}),
|
|
10
|
-
getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
|
|
11
5
|
// getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
|
|
12
6
|
getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
|
|
13
7
|
updatePaymentInfo: ({ bankCode, branch, holderName, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider }) => ({
|
|
14
8
|
url: 'payment/v2/updatePaymentInfo',
|
|
15
9
|
method: 'post',
|
|
16
|
-
params: {
|
|
17
|
-
bankCode,
|
|
18
|
-
branch,
|
|
19
|
-
holderName,
|
|
20
|
-
bankAccount,
|
|
21
|
-
firstNameTh,
|
|
22
|
-
lastNameTh,
|
|
23
|
-
firstNameEn,
|
|
24
|
-
lastNameEn,
|
|
25
|
-
bonus,
|
|
26
|
-
paymentProvider,
|
|
27
|
-
},
|
|
10
|
+
params: { bankCode, branch, holderName, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider },
|
|
28
11
|
}),
|
|
29
12
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
30
13
|
makeTransaction: ({ type, payload, paymentMethod }) => ({
|
|
@@ -49,59 +32,22 @@ export default {
|
|
|
49
32
|
method: 'post',
|
|
50
33
|
params: { transferType },
|
|
51
34
|
}),
|
|
52
|
-
getDepositExpectedResult: ({ method, amount, cryptoCurrency
|
|
35
|
+
getDepositExpectedResult: ({ method, amount, cryptoCurrency }) => ({
|
|
53
36
|
url: `payment/v2/${method}/expected/result`,
|
|
54
37
|
method: 'post',
|
|
55
|
-
params: { transferType: 'DEPOSIT', amount, cryptoCurrency
|
|
38
|
+
params: { transferType: 'DEPOSIT', amount, cryptoCurrency },
|
|
56
39
|
}),
|
|
57
40
|
getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
|
|
58
41
|
url: `payment/v2/${method}/expected/result`,
|
|
59
42
|
method: 'post',
|
|
60
43
|
params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
|
|
61
44
|
}),
|
|
62
|
-
|
|
63
|
-
url: `payment/v2/${method}/transaction`,
|
|
64
|
-
method: 'post',
|
|
65
|
-
params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
|
|
66
|
-
}),
|
|
67
|
-
submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
|
|
68
|
-
url: `payment/v2/${method}/transaction`,
|
|
69
|
-
method: 'post',
|
|
70
|
-
params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri, promotionsNo },
|
|
71
|
-
}),
|
|
72
|
-
submitDepositTransactionBank: ({
|
|
73
|
-
method,
|
|
74
|
-
amount,
|
|
75
|
-
applyerBankCode,
|
|
76
|
-
applyerAccountNumber,
|
|
77
|
-
applyerHolderName,
|
|
78
|
-
targetBankCode,
|
|
79
|
-
targetAccountNumber,
|
|
80
|
-
depositTime = '1234567890',
|
|
81
|
-
receipt,
|
|
82
|
-
promotionsNo,
|
|
83
|
-
}) => ({
|
|
84
|
-
url: `payment/v2/${method}/transaction`,
|
|
85
|
-
method: 'post',
|
|
86
|
-
params: {
|
|
87
|
-
transferType: 'DEPOSIT',
|
|
88
|
-
amount,
|
|
89
|
-
applyerBankCode,
|
|
90
|
-
applyerAccountNumber,
|
|
91
|
-
applyerHolderName,
|
|
92
|
-
targetBankCode,
|
|
93
|
-
targetAccountNumber,
|
|
94
|
-
depositTime,
|
|
95
|
-
receipt,
|
|
96
|
-
promotionsNo,
|
|
97
|
-
},
|
|
98
|
-
}),
|
|
99
|
-
submitDepositTransaction: ({ method, amount, promotionsNo }) => ({
|
|
45
|
+
submitDepositTransaction: ({ method, amount, cryptoCurrency, cryptoNetwork }) => ({
|
|
100
46
|
url: `payment/v2/${method}/transaction`,
|
|
101
47
|
method: 'post',
|
|
102
|
-
params: { transferType: 'DEPOSIT', amount,
|
|
48
|
+
params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork },
|
|
103
49
|
}),
|
|
104
|
-
|
|
50
|
+
submitWithdrawTransaction: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
|
|
105
51
|
url: `payment/v2/${method}/transaction`,
|
|
106
52
|
method: 'post',
|
|
107
53
|
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
|
|
@@ -109,31 +55,6 @@ export default {
|
|
|
109
55
|
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
|
|
110
56
|
url: `payment/v2/${method}/transaction`,
|
|
111
57
|
method: 'post',
|
|
112
|
-
params: {
|
|
113
|
-
transferType: 'WITHDRAW',
|
|
114
|
-
amount,
|
|
115
|
-
applyerBankCode,
|
|
116
|
-
applyerAccountNumber,
|
|
117
|
-
branch,
|
|
118
|
-
holderName,
|
|
119
|
-
},
|
|
120
|
-
}),
|
|
121
|
-
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
|
122
|
-
url: `payment/v2/${method}/transaction`,
|
|
123
|
-
method: 'post',
|
|
124
|
-
params: { transferType: 'WITHDRAW', amount },
|
|
125
|
-
}),
|
|
126
|
-
getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
|
|
127
|
-
getWithdrawRulePreview: ({ applyType, applyNo, amount }) => ({
|
|
128
|
-
url: `payment/v2/bankWallet/promotion/preview`,
|
|
129
|
-
method: 'post',
|
|
130
|
-
params: { applyType, applyNo, amount },
|
|
131
|
-
}),
|
|
132
|
-
applyPromotions: ({ promotionsNo, amount }) => ({
|
|
133
|
-
url: `payment/v2/bankWallet/promotion/apply`,
|
|
134
|
-
method: 'post',
|
|
135
|
-
params: { promotionsNo, amount },
|
|
58
|
+
params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
|
|
136
59
|
}),
|
|
137
|
-
giveUp: () => ({ url: 'payment/v2/bankWallet/promotion/giveUp', method: 'post' }),
|
|
138
|
-
restore: ({ amount }) => ({ url: 'payment/v2/bankWallet/restore', method: 'post', params: { amount } }),
|
|
139
60
|
}
|
package/src/api/user.js
CHANGED
|
@@ -2,17 +2,12 @@ export const PASSWORD_RESET_INIT = 'otp-verifying'
|
|
|
2
2
|
export const PASSWORD_RESET_ALLOW = 'allow-change-password'
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
checkDt: () => ({ url: 'checkDt', method: 'get' }),
|
|
6
|
-
updateDt: (data) => ({ url: 'updateDt', method: 'post', params: data }),
|
|
7
5
|
getUserInfo: () => ({ url: 'self', method: 'get' }),
|
|
8
6
|
updateUserInfo: (data) => ({ url: 'self', method: 'post', params: data }),
|
|
9
7
|
changePassword: (data) => ({ url: 'settings/password', method: 'post', params: data }),
|
|
10
8
|
setPreference: ({ defaultCategory }) => ({ url: 'settings/preference', method: 'post', params: { defaultCategory } }),
|
|
11
9
|
resetOtp: ({ requestId, number }) => ({ url: 'reset', method: 'post', params: { requestId, number } }),
|
|
12
10
|
getAffiliate: () => ({ url: 'affiliate', method: 'get' }),
|
|
13
|
-
getAffiliateHome: () => ({ url: 'affiliate/home', method: 'get' }),
|
|
14
|
-
getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
|
|
15
|
-
getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
16
11
|
postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
|
|
17
12
|
passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
|
|
18
13
|
passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
|
|
@@ -39,17 +34,4 @@ export default {
|
|
|
39
34
|
params: { requestId, target, newPassword },
|
|
40
35
|
isPublic: true,
|
|
41
36
|
}),
|
|
42
|
-
verifyV2Initiate: ({ strategy }) => ({
|
|
43
|
-
// strategy: 'phone' | 'email'
|
|
44
|
-
url: '/verify/v2/initiate',
|
|
45
|
-
method: 'post',
|
|
46
|
-
params: { strategy },
|
|
47
|
-
}),
|
|
48
|
-
otpAcknowledge: ({ requestId, target, code }) => ({
|
|
49
|
-
url: '/otpsso/acknowledge',
|
|
50
|
-
method: 'post',
|
|
51
|
-
params: { requestId, target, code },
|
|
52
|
-
isPublic: true,
|
|
53
|
-
}),
|
|
54
|
-
otpReset: ({ requestId, target }) => ({ url: '/otpsso/reset', method: 'post', params: { requestId, target }, isPublic: true }),
|
|
55
37
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import api from './api
|
|
2
|
-
import machine from './machine
|
|
3
|
-
import Request from './request/request
|
|
4
|
-
import Config from './request/config
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { api, machine, Request, Config, util, constant, storage }
|
|
1
|
+
import api from './api'
|
|
2
|
+
import machine from './machine'
|
|
3
|
+
import Request from './request/request'
|
|
4
|
+
import Config from './request/config'
|
|
5
|
+
export { api, machine, Request, Config }
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createMachine, assign } from 'xstate'
|
|
2
|
-
import api from '../../api/activity
|
|
3
|
-
import activity from './index.js'
|
|
1
|
+
import { createMachine, assign, respond } from 'xstate'
|
|
2
|
+
import api from '../../api/activity'
|
|
4
3
|
|
|
5
4
|
export default function (request) {
|
|
6
5
|
const { appSecret } = request.config
|
|
@@ -10,65 +9,28 @@ export default function (request) {
|
|
|
10
9
|
initial: 'fetchingActivityList',
|
|
11
10
|
context: {
|
|
12
11
|
tick: 2000,
|
|
13
|
-
specifyActivities: [29],
|
|
14
|
-
activitiesDetailList: [],
|
|
15
12
|
activityList: [],
|
|
16
13
|
activityMap: {},
|
|
17
14
|
tournamentList: [],
|
|
18
15
|
refs: {},
|
|
19
|
-
uidSite: '',
|
|
20
16
|
},
|
|
21
17
|
states: {
|
|
22
18
|
fetchingActivityList: {
|
|
23
19
|
invoke: {
|
|
24
20
|
src: 'fetchActivityList',
|
|
25
21
|
onDone: {
|
|
26
|
-
target: '
|
|
22
|
+
target: 'pending',
|
|
27
23
|
actions: ['setActivityList', 'setTournamentList'],
|
|
28
24
|
},
|
|
29
25
|
onError: {
|
|
30
|
-
target: '
|
|
26
|
+
target: 'pending',
|
|
31
27
|
},
|
|
32
28
|
},
|
|
33
29
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
initial: 'checking',
|
|
39
|
-
states: {
|
|
40
|
-
checking: {
|
|
41
|
-
always: [{ target: 'fetchActivityDetail', cond: 'hasSpecifyActivities' }, { target: 'end' }],
|
|
42
|
-
},
|
|
43
|
-
fetchActivityDetail: {
|
|
44
|
-
invoke: {
|
|
45
|
-
src: 'fetchActivitiesDetail',
|
|
46
|
-
onDone: {
|
|
47
|
-
target: 'end',
|
|
48
|
-
actions: 'setActivitiesDetailList',
|
|
49
|
-
},
|
|
50
|
-
onError: {
|
|
51
|
-
target: 'end',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
end: {},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
pending: {
|
|
59
|
-
after: {
|
|
60
|
-
TIMEOUT: {
|
|
61
|
-
target: '#activity.fetchingActivityList',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
on: {
|
|
65
|
-
SET_UNREAD: {
|
|
66
|
-
actions: 'setUnread',
|
|
67
|
-
},
|
|
68
|
-
REFRESH: {
|
|
69
|
-
target: '#activity.fetchingActivityList',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
30
|
+
pending: {
|
|
31
|
+
after: {
|
|
32
|
+
TIMEOUT: {
|
|
33
|
+
target: 'fetchingActivityList',
|
|
72
34
|
},
|
|
73
35
|
},
|
|
74
36
|
},
|
|
@@ -83,51 +45,11 @@ export default function (request) {
|
|
|
83
45
|
}
|
|
84
46
|
}),
|
|
85
47
|
setActivityList: assign((context, event) => {
|
|
86
|
-
const noRedActivity = [2, 4, 13, 20, 90, 91, 92]
|
|
87
|
-
const { uidSite } = context
|
|
88
|
-
let list = event.data
|
|
89
|
-
list.forEach((activity) => {
|
|
90
|
-
const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`)
|
|
91
|
-
if (noRedActivity.includes(activity.activityType)) {
|
|
92
|
-
activity.unread = false
|
|
93
|
-
} else if (storageUnread) {
|
|
94
|
-
activity.unread = JSON.parse(storageUnread)
|
|
95
|
-
} else {
|
|
96
|
-
activity.unread = true
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
return {
|
|
100
|
-
activityList: list,
|
|
101
|
-
}
|
|
102
|
-
}),
|
|
103
|
-
setActivitiesDetailList: assign((context, event) => {
|
|
104
|
-
return {
|
|
105
|
-
activitiesDetailList: event.data.map((item) => item.data),
|
|
106
|
-
}
|
|
107
|
-
}),
|
|
108
|
-
setUnread: assign((context, event) => {
|
|
109
|
-
const { uidSite, activityNo, unread } = event.data
|
|
110
|
-
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
111
|
-
localStorage.setItem(`unread_${activityNo}_${uidSite}`, `${unread}`)
|
|
112
|
-
list.map((item) => {
|
|
113
|
-
if (item.activityNo === activityNo) {
|
|
114
|
-
item.unread = JSON.parse(`${unread}`)
|
|
115
|
-
}
|
|
116
|
-
return item
|
|
117
|
-
})
|
|
118
48
|
return {
|
|
119
|
-
activityList:
|
|
120
|
-
uidSite,
|
|
49
|
+
activityList: event.data,
|
|
121
50
|
}
|
|
122
51
|
}),
|
|
123
52
|
},
|
|
124
|
-
guards: {
|
|
125
|
-
hasSpecifyActivities: (context, event) => {
|
|
126
|
-
const { activityList = [], specifyActivities = [] } = context
|
|
127
|
-
const filterActivityList = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
|
|
128
|
-
return filterActivityList.length > 0
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
53
|
delays: {
|
|
132
54
|
TIMEOUT: (context, event) => {
|
|
133
55
|
const { tick } = context
|
|
@@ -136,18 +58,9 @@ export default function (request) {
|
|
|
136
58
|
},
|
|
137
59
|
services: {
|
|
138
60
|
fetchActivityList: async (context, event) => {
|
|
139
|
-
const { data } = await request.send(api.getActivityList({ appSecret }))
|
|
61
|
+
const { data } = await request.send(api.getActivityList({ appSecret, include: 'cl' }))
|
|
140
62
|
return data
|
|
141
63
|
},
|
|
142
|
-
fetchActivitiesDetail: async (context, event) => {
|
|
143
|
-
const { activityList = [], specifyActivities = [] } = context
|
|
144
|
-
const filterActivityList = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
|
|
145
|
-
const promiseArray = filterActivityList.map((activity) => {
|
|
146
|
-
return request.send(api.getActivityDetail({ activityNo: activity.activityNo, appSecret }))
|
|
147
|
-
})
|
|
148
|
-
const activitiesDetail = await Promise.all(promiseArray)
|
|
149
|
-
return activitiesDetail
|
|
150
|
-
},
|
|
151
64
|
},
|
|
152
65
|
}
|
|
153
66
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import api from '../../api/activity
|
|
1
|
+
import { createMachine, assign } from 'xstate'
|
|
2
|
+
import api from '../../api/activity'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -14,30 +14,16 @@ export default function (request) {
|
|
|
14
14
|
exchangeAward: 0,
|
|
15
15
|
exchangePoint: 0,
|
|
16
16
|
},
|
|
17
|
-
initial: '
|
|
17
|
+
initial: 'idle',
|
|
18
18
|
states: {
|
|
19
|
-
fetching: {
|
|
20
|
-
invoke: {
|
|
21
|
-
src: 'fetchActivityList',
|
|
22
|
-
onDone: {
|
|
23
|
-
target: 'checking',
|
|
24
|
-
actions: 'setDiamondShopActivities',
|
|
25
|
-
},
|
|
26
|
-
onError: {
|
|
27
|
-
target: 'idle',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
19
|
idle: {
|
|
32
20
|
on: {
|
|
33
21
|
SET_ACTIVITY_NO: {
|
|
34
|
-
|
|
22
|
+
target: 'loading',
|
|
23
|
+
actions: 'setActivityNo',
|
|
35
24
|
},
|
|
36
25
|
},
|
|
37
26
|
},
|
|
38
|
-
checking: {
|
|
39
|
-
always: [{ target: 'loading', cond: 'hasActivityNo' }],
|
|
40
|
-
},
|
|
41
27
|
loading: {
|
|
42
28
|
invoke: {
|
|
43
29
|
src: 'fetchActivityDetail',
|
|
@@ -107,13 +93,6 @@ export default function (request) {
|
|
|
107
93
|
activityNo: event.data,
|
|
108
94
|
}
|
|
109
95
|
}),
|
|
110
|
-
setDiamondShopActivities: assign((context, event) => {
|
|
111
|
-
const rankActivities = event.data.filter((item) => item.activityType === 91)
|
|
112
|
-
return {
|
|
113
|
-
rankActivities,
|
|
114
|
-
activityNo: rankActivities?.[0]?.activityNo,
|
|
115
|
-
}
|
|
116
|
-
}),
|
|
117
96
|
setActivityDetail: assign((context, event) => {
|
|
118
97
|
return {
|
|
119
98
|
activityDetail: event.data,
|
|
@@ -159,15 +138,8 @@ export default function (request) {
|
|
|
159
138
|
const { exchangeList } = context
|
|
160
139
|
return exchangeList.length > 0
|
|
161
140
|
},
|
|
162
|
-
hasActivityNo: (context, event) => {
|
|
163
|
-
return !!context.activityNo
|
|
164
|
-
},
|
|
165
141
|
},
|
|
166
142
|
services: {
|
|
167
|
-
fetchActivityList: async (context, event) => {
|
|
168
|
-
const { data } = await request.send(api.getActivityList({ appSecret }))
|
|
169
|
-
return data
|
|
170
|
-
},
|
|
171
143
|
fetchActivityDetail: async (context, event) => {
|
|
172
144
|
const { activityNo } = context
|
|
173
145
|
const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
|