@jetthai/cuora 1.1.93-cash → 1.1.93
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/.husky/pre-commit +1 -1
- package/CHANGELOG.md +0 -4
- package/dist/bundle.mjs +1263 -515
- package/package.json +1 -1
- package/src/api/activity.js +1 -13
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/fafafa_activity.js +11 -35
- package/src/machine/activity/index.js +0 -2
- package/src/machine/activity/ranking_activity.js +2 -31
- package/src/machine/activity/specify_bets_activity.js +3 -44
- package/src/machine/activity/specify_turnover_activity.js +3 -44
- package/src/machine/deposit/index.js +0 -6
- package/src/machine/game.js +285 -0
- package/src/machine/game_favorite.js +123 -0
- package/src/machine/game_favorite_v2.js +2 -6
- package/src/machine/game_v2.js +381 -0
- package/src/machine/game_v2_1.js +9 -35
- package/src/machine/index.js +6 -4
- package/src/machine/user_info.js +2 -8
- package/src/request/request.js +5 -9
- package/src/util/index.js +1 -2
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -214
- package/src/machine/deposit/manual_cash.js +0 -321
- package/src/machine/deposit/qrcode_cash.js +0 -258
- package/src/machine/deposit/usdt_cash.js +0 -138
- package/src/machine/reward_cash.js +0 -220
- package/src/machine/side_cash.js +0 -110
- package/src/machine/withdraw/withdraw_activity.js +0 -383
- package/src/util/math.js +0 -4
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -46,21 +46,9 @@ export default {
|
|
|
46
46
|
method: 'get',
|
|
47
47
|
params: { rewardType },
|
|
48
48
|
}),
|
|
49
|
-
getRewardList: ({ rewardType, count, appSecret }) => ({
|
|
50
|
-
url: 'activities/rewards',
|
|
51
|
-
method: 'get',
|
|
52
|
-
params: { rewardType, count, appSecret },
|
|
53
|
-
}),
|
|
49
|
+
getRewardList: ({ rewardType, count, appSecret }) => ({ url: 'activities/rewards', method: 'get', params: { rewardType, count, appSecret } }),
|
|
54
50
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
55
51
|
collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
|
|
56
52
|
getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
|
|
57
53
|
getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
|
|
58
|
-
exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
|
|
59
|
-
url: 'activities/exchange/diamond',
|
|
60
|
-
method: 'post',
|
|
61
|
-
params: {
|
|
62
|
-
activityNo,
|
|
63
|
-
exchangeAward,
|
|
64
|
-
},
|
|
65
|
-
}),
|
|
66
54
|
}
|
|
@@ -9,7 +9,7 @@ export default function (request) {
|
|
|
9
9
|
context: {
|
|
10
10
|
activityNo: null,
|
|
11
11
|
activityDetail: null,
|
|
12
|
-
duration:
|
|
12
|
+
duration: null,
|
|
13
13
|
},
|
|
14
14
|
initial: 'idle',
|
|
15
15
|
states: {
|
|
@@ -62,7 +62,7 @@ export default function (request) {
|
|
|
62
62
|
}),
|
|
63
63
|
setDuration: assign((context, event) => {
|
|
64
64
|
return {
|
|
65
|
-
duration:
|
|
65
|
+
duration: context?.activityDetail?.deadline - new Date().getTime() / 1000,
|
|
66
66
|
}
|
|
67
67
|
}),
|
|
68
68
|
},
|
|
@@ -2,18 +2,17 @@ import { assign, createMachine } from 'xstate'
|
|
|
2
2
|
import isEqual from 'lodash/isEqual.js'
|
|
3
3
|
import api from '../../api/activity.js'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// const isEqual = require('lodash/isEqual')
|
|
6
|
+
|
|
7
|
+
export default function (request) {
|
|
6
8
|
const { appSecret } = request.config
|
|
7
|
-
const { activityNo, isAutoReceiving = true, isLogin = true } = context || {}
|
|
8
9
|
return createMachine(
|
|
9
10
|
{
|
|
10
11
|
id: 'fafafa_activity',
|
|
11
12
|
context: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
activityNo,
|
|
13
|
+
isAutoReceiving: true,
|
|
14
|
+
activityNo: null,
|
|
15
15
|
activityDetail: null,
|
|
16
|
-
duration: 0,
|
|
17
16
|
|
|
18
17
|
// 領獎後得到的資訊
|
|
19
18
|
awards: [],
|
|
@@ -27,8 +26,7 @@ export default function (request, context) {
|
|
|
27
26
|
initial: 'idle',
|
|
28
27
|
states: {
|
|
29
28
|
idle: {
|
|
30
|
-
|
|
31
|
-
always: [{ target: 'loading', cond: 'isLoadable' }],
|
|
29
|
+
always: [{ target: 'loading', cond: 'hasActivityNo' }],
|
|
32
30
|
},
|
|
33
31
|
loading: {
|
|
34
32
|
invoke: {
|
|
@@ -37,24 +35,21 @@ export default function (request, context) {
|
|
|
37
35
|
target: 'loaded',
|
|
38
36
|
actions: 'setActivityDetail',
|
|
39
37
|
},
|
|
38
|
+
onError: {
|
|
39
|
+
target: 'idle',
|
|
40
|
+
},
|
|
40
41
|
},
|
|
41
42
|
},
|
|
42
43
|
loaded: {
|
|
43
44
|
always: [{ target: 'awardable', cond: 'isAwardable' }, { target: 'awarded' }],
|
|
44
45
|
},
|
|
45
46
|
awardable: {
|
|
46
|
-
entry: 'setDuration',
|
|
47
47
|
on: {
|
|
48
48
|
AWARD_PRIZE: {
|
|
49
49
|
target: 'awarding',
|
|
50
50
|
actions: 'setCallback',
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
after: {
|
|
54
|
-
1000: {
|
|
55
|
-
target: 'awardable',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
53
|
},
|
|
59
54
|
awarded: {
|
|
60
55
|
on: {
|
|
@@ -95,14 +90,6 @@ export default function (request, context) {
|
|
|
95
90
|
actions: 'setActivityNo',
|
|
96
91
|
cond: 'isActivityChanged',
|
|
97
92
|
},
|
|
98
|
-
START: {
|
|
99
|
-
target: '.idle',
|
|
100
|
-
actions: assign((context, event) => ({ isLogin: true })),
|
|
101
|
-
},
|
|
102
|
-
STOP: {
|
|
103
|
-
target: '.idle',
|
|
104
|
-
actions: assign((context, event) => ({ isLogin: false })),
|
|
105
|
-
},
|
|
106
93
|
},
|
|
107
94
|
},
|
|
108
95
|
{
|
|
@@ -135,24 +122,13 @@ export default function (request, context) {
|
|
|
135
122
|
doCallback: (context, event) => {
|
|
136
123
|
context.callback()
|
|
137
124
|
},
|
|
138
|
-
setDuration: assign((context, event) => {
|
|
139
|
-
return {
|
|
140
|
-
duration: Math.max(context?.activityDetail?.periodEndTime - new Date().getTime() / 1000, 0),
|
|
141
|
-
}
|
|
142
|
-
}),
|
|
143
|
-
reset: assign((context, event) => {
|
|
144
|
-
return {
|
|
145
|
-
activityDetail: null,
|
|
146
|
-
duration: 0,
|
|
147
|
-
}
|
|
148
|
-
}),
|
|
149
125
|
},
|
|
150
126
|
guards: {
|
|
151
127
|
isActivityChanged: (context, event) => {
|
|
152
128
|
return !isEqual(context.activityNo, event.data)
|
|
153
129
|
},
|
|
154
|
-
|
|
155
|
-
return context.
|
|
130
|
+
hasActivityNo: (context, event) => {
|
|
131
|
+
return context.activityNo
|
|
156
132
|
},
|
|
157
133
|
isAwardable: (context, event) => {
|
|
158
134
|
return context.activityDetail?.receiveStatus === 2
|
|
@@ -2,7 +2,6 @@ import continue_deposit_activity from './continue_deposit_activity.js'
|
|
|
2
2
|
import deposit_activity from './deposit_activity.js'
|
|
3
3
|
import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
|
|
4
4
|
import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
|
|
5
|
-
import diamond_shop_activity_cash from './diamond_shop_activity_cash.js'
|
|
6
5
|
import fafafa_activity from './fafafa_activity.js'
|
|
7
6
|
import invite_friends_activity from './invite_friends_activity.js'
|
|
8
7
|
import friend_invite_friends_activity from './friend_invite_friends_activity.js'
|
|
@@ -22,7 +21,6 @@ export default {
|
|
|
22
21
|
deposit_activity,
|
|
23
22
|
diamond_shop_activity_fc,
|
|
24
23
|
diamond_shop_activity_vn,
|
|
25
|
-
diamond_shop_activity_cash,
|
|
26
24
|
fafafa_activity,
|
|
27
25
|
invite_friends_activity,
|
|
28
26
|
friend_invite_friends_activity,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request
|
|
4
|
+
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
-
const { activityNo, isLogin = true } = context || {}
|
|
7
6
|
return createMachine(
|
|
8
7
|
{
|
|
9
8
|
id: 'ranking_activity',
|
|
10
9
|
context: {
|
|
11
|
-
|
|
12
|
-
activityNo,
|
|
10
|
+
activityNo: null,
|
|
13
11
|
activityDetail: null,
|
|
14
12
|
duration: null,
|
|
15
13
|
status: 'not-started', // "not-started" | "started" | "finished"
|
|
@@ -17,13 +15,6 @@ export default function (request, context) {
|
|
|
17
15
|
initial: 'idle',
|
|
18
16
|
states: {
|
|
19
17
|
idle: {
|
|
20
|
-
entry: 'reset',
|
|
21
|
-
always: [
|
|
22
|
-
{
|
|
23
|
-
target: 'loading',
|
|
24
|
-
cond: 'isLoadable',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
18
|
on: {
|
|
28
19
|
SET_ACTIVITY_NO: {
|
|
29
20
|
target: 'loading',
|
|
@@ -54,16 +45,6 @@ export default function (request, context) {
|
|
|
54
45
|
},
|
|
55
46
|
expired: {},
|
|
56
47
|
},
|
|
57
|
-
on: {
|
|
58
|
-
START: {
|
|
59
|
-
target: '.idle',
|
|
60
|
-
actions: assign((context, event) => ({ isLogin: true })),
|
|
61
|
-
},
|
|
62
|
-
STOP: {
|
|
63
|
-
target: '.idle',
|
|
64
|
-
actions: assign((context, event) => ({ isLogin: false })),
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
48
|
},
|
|
68
49
|
{
|
|
69
50
|
actions: {
|
|
@@ -97,18 +78,8 @@ export default function (request, context) {
|
|
|
97
78
|
}
|
|
98
79
|
}
|
|
99
80
|
}),
|
|
100
|
-
reset: assign((context, event) => {
|
|
101
|
-
return {
|
|
102
|
-
activityDetail: null,
|
|
103
|
-
duration: 0,
|
|
104
|
-
status: 'not-started',
|
|
105
|
-
}
|
|
106
|
-
}),
|
|
107
81
|
},
|
|
108
82
|
guards: {
|
|
109
|
-
isLoadable: (context, event) => {
|
|
110
|
-
return context.isLogin && context.activityNo
|
|
111
|
-
},
|
|
112
83
|
isExpired: (context, event) => {
|
|
113
84
|
return context.duration <= 0
|
|
114
85
|
},
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request
|
|
4
|
+
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
-
const { activityNo, isLogin = true } = context || {}
|
|
7
6
|
return createMachine(
|
|
8
7
|
{
|
|
9
8
|
id: 'specify_bets_activity',
|
|
10
9
|
context: {
|
|
11
|
-
|
|
12
|
-
activityNo,
|
|
10
|
+
activityNo: null,
|
|
13
11
|
activityDetail: null,
|
|
14
12
|
callback: () => {},
|
|
15
|
-
duration: 0,
|
|
16
13
|
},
|
|
17
14
|
initial: 'idle',
|
|
18
15
|
states: {
|
|
19
16
|
idle: {
|
|
20
|
-
entry: 'reset',
|
|
21
|
-
always: [
|
|
22
|
-
{
|
|
23
|
-
target: 'loading',
|
|
24
|
-
cond: 'isLoadable',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
17
|
on: {
|
|
28
18
|
SET_ACTIVITY_NO: {
|
|
29
19
|
target: 'loading',
|
|
@@ -50,14 +40,7 @@ export default function (request, context) {
|
|
|
50
40
|
{ target: 'receivable', cond: 'isReceivable' },
|
|
51
41
|
],
|
|
52
42
|
},
|
|
53
|
-
ongoing: {
|
|
54
|
-
entry: 'setDuration',
|
|
55
|
-
after: {
|
|
56
|
-
1000: {
|
|
57
|
-
target: 'ongoing',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
43
|
+
ongoing: {},
|
|
61
44
|
received: {},
|
|
62
45
|
receivable: {
|
|
63
46
|
on: {
|
|
@@ -80,16 +63,6 @@ export default function (request, context) {
|
|
|
80
63
|
},
|
|
81
64
|
},
|
|
82
65
|
},
|
|
83
|
-
on: {
|
|
84
|
-
START: {
|
|
85
|
-
target: '.idle',
|
|
86
|
-
actions: assign((context, event) => ({ isLogin: true })),
|
|
87
|
-
},
|
|
88
|
-
STOP: {
|
|
89
|
-
target: '.idle',
|
|
90
|
-
actions: assign((context, event) => ({ isLogin: false })),
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
66
|
},
|
|
94
67
|
{
|
|
95
68
|
actions: {
|
|
@@ -111,22 +84,8 @@ export default function (request, context) {
|
|
|
111
84
|
doCallback: (context, event) => {
|
|
112
85
|
context.callback(event.data.type)
|
|
113
86
|
},
|
|
114
|
-
setDuration: assign((context, event) => {
|
|
115
|
-
return {
|
|
116
|
-
duration: Math.max(context?.activityDetail?.activityEndTime - new Date().getTime() / 1000, 0),
|
|
117
|
-
}
|
|
118
|
-
}),
|
|
119
|
-
reset: assign((context, event) => {
|
|
120
|
-
return {
|
|
121
|
-
activityDetail: null,
|
|
122
|
-
duration: 0,
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
125
87
|
},
|
|
126
88
|
guards: {
|
|
127
|
-
isLoadable: (context, event) => {
|
|
128
|
-
return context.isLogin && context.activityNo
|
|
129
|
-
},
|
|
130
89
|
isReceivable: (context, event) => {
|
|
131
90
|
return context.activityDetail?.receiveStatus === 2
|
|
132
91
|
},
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
|
-
export default function (request
|
|
4
|
+
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
-
const { activityNo, isLogin = true } = context || {}
|
|
7
6
|
return createMachine(
|
|
8
7
|
{
|
|
9
8
|
id: 'specify_turnover_activity',
|
|
10
9
|
context: {
|
|
11
|
-
|
|
12
|
-
activityNo,
|
|
10
|
+
activityNo: null,
|
|
13
11
|
activityDetail: null,
|
|
14
12
|
callback: () => {},
|
|
15
|
-
duration: 0,
|
|
16
13
|
},
|
|
17
14
|
initial: 'idle',
|
|
18
15
|
states: {
|
|
19
16
|
idle: {
|
|
20
|
-
entry: 'reset',
|
|
21
|
-
always: [
|
|
22
|
-
{
|
|
23
|
-
target: 'loading',
|
|
24
|
-
cond: 'isLoadable',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
17
|
on: {
|
|
28
18
|
SET_ACTIVITY_NO: {
|
|
29
19
|
target: 'loading',
|
|
@@ -50,14 +40,7 @@ export default function (request, context) {
|
|
|
50
40
|
{ target: 'receivable', cond: 'isReceivable' },
|
|
51
41
|
],
|
|
52
42
|
},
|
|
53
|
-
ongoing: {
|
|
54
|
-
entry: 'setDuration',
|
|
55
|
-
after: {
|
|
56
|
-
1000: {
|
|
57
|
-
target: 'ongoing',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
43
|
+
ongoing: {},
|
|
61
44
|
received: {},
|
|
62
45
|
receivable: {
|
|
63
46
|
on: {
|
|
@@ -80,16 +63,6 @@ export default function (request, context) {
|
|
|
80
63
|
},
|
|
81
64
|
},
|
|
82
65
|
},
|
|
83
|
-
on: {
|
|
84
|
-
START: {
|
|
85
|
-
target: '.idle',
|
|
86
|
-
actions: assign((context, event) => ({ isLogin: true })),
|
|
87
|
-
},
|
|
88
|
-
STOP: {
|
|
89
|
-
target: '.idle',
|
|
90
|
-
actions: assign((context, event) => ({ isLogin: false })),
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
66
|
},
|
|
94
67
|
{
|
|
95
68
|
actions: {
|
|
@@ -111,22 +84,8 @@ export default function (request, context) {
|
|
|
111
84
|
doCallback: (context, event) => {
|
|
112
85
|
context.callback(event.data.type)
|
|
113
86
|
},
|
|
114
|
-
setDuration: assign((context, event) => {
|
|
115
|
-
return {
|
|
116
|
-
duration: Math.max(context?.activityDetail?.activityEndTime - new Date().getTime() / 1000, 0),
|
|
117
|
-
}
|
|
118
|
-
}),
|
|
119
|
-
reset: assign((context, event) => {
|
|
120
|
-
return {
|
|
121
|
-
activityDetail: null,
|
|
122
|
-
duration: 0,
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
125
87
|
},
|
|
126
88
|
guards: {
|
|
127
|
-
isLoadable: (context, event) => {
|
|
128
|
-
return context.isLogin && context.activityNo
|
|
129
|
-
},
|
|
130
89
|
isReceivable: (context, event) => {
|
|
131
90
|
return context.activityDetail?.receiveStatus === 2
|
|
132
91
|
},
|
|
@@ -9,9 +9,6 @@ import amb from './amb.js'
|
|
|
9
9
|
import float from './float.js'
|
|
10
10
|
import vpay from './vpay.js'
|
|
11
11
|
import usdt from './usdt.js'
|
|
12
|
-
import manual_cash from './manual_cash.js'
|
|
13
|
-
import qrcode_cash from './qrcode_cash.js'
|
|
14
|
-
import usdt_cash from './usdt_cash.js'
|
|
15
12
|
|
|
16
13
|
export default {
|
|
17
14
|
manual_vn,
|
|
@@ -25,7 +22,4 @@ export default {
|
|
|
25
22
|
float,
|
|
26
23
|
vpay,
|
|
27
24
|
usdt,
|
|
28
|
-
manual_cash,
|
|
29
|
-
qrcode_cash,
|
|
30
|
-
usdt_cash,
|
|
31
25
|
}
|