@jetthai/cuora 1.1.148 → 1.1.149
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
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.1.149](https://github.com/jetthai/cuora-module/compare/v1.1.148...v1.1.149) (2023-07-31)
|
|
6
|
+
|
|
5
7
|
### [1.1.148](https://github.com/jetthai/cuora-module/compare/v1.1.143-1...v1.1.148) (2023-07-25)
|
|
6
8
|
|
|
7
9
|
### [1.1.147](https://github.com/jetthai/cuora-module/compare/v1.1.146...v1.1.147) (2023-07-25)
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createMachine, assign } from 'xstate'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'honor_board',
|
|
8
|
+
initial: 'fetching',
|
|
9
|
+
context: {
|
|
10
|
+
tick: 2000,
|
|
11
|
+
bigWinList: [],
|
|
12
|
+
maxBetList: [],
|
|
13
|
+
},
|
|
14
|
+
states: {
|
|
15
|
+
fetching: {
|
|
16
|
+
invoke: {
|
|
17
|
+
src: 'fetchHonorBoardList',
|
|
18
|
+
onDone: {
|
|
19
|
+
target: 'pending',
|
|
20
|
+
actions: 'setHonorBoardList',
|
|
21
|
+
},
|
|
22
|
+
onError: {
|
|
23
|
+
target: 'pending',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
pending: {
|
|
28
|
+
after: {
|
|
29
|
+
TIMEOUT: {
|
|
30
|
+
target: 'fetching',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
actions: {
|
|
38
|
+
setHonorBoardList: assign((context, event) => {
|
|
39
|
+
const { bigWinList = [], maxBetList = [] } = event.data
|
|
40
|
+
return {
|
|
41
|
+
bigWinList,
|
|
42
|
+
maxBetList,
|
|
43
|
+
}
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
delays: {
|
|
47
|
+
TIMEOUT: (context, event) => {
|
|
48
|
+
const { tick } = context
|
|
49
|
+
return tick * 10
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
services: {
|
|
53
|
+
fetchHonorBoardList: async (context, event) => {
|
|
54
|
+
const { data } = await request.send(activity.getHonorBoard())
|
|
55
|
+
return data
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
}
|
package/src/machine/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import auth_otp_v3 from './auth_otp_v3.js'
|
|
|
32
32
|
import vip_table from './vip_table.js'
|
|
33
33
|
import promotions from './promotions.js'
|
|
34
34
|
import roulette_v2 from './roulette_v2.js'
|
|
35
|
+
import honor_board_cash from './honor_board_cash.js'
|
|
35
36
|
|
|
36
37
|
export default {
|
|
37
38
|
...activity,
|
|
@@ -67,5 +68,6 @@ export default {
|
|
|
67
68
|
vip_table,
|
|
68
69
|
promotions,
|
|
69
70
|
roulette_v2,
|
|
71
|
+
honor_board_cash,
|
|
70
72
|
...withdraw,
|
|
71
73
|
}
|