overtime-live-trading-utils 2.1.30 → 2.1.32

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.
Files changed (38) hide show
  1. package/.circleci/config.yml +32 -32
  2. package/.prettierrc +9 -9
  3. package/codecov.yml +20 -20
  4. package/index.ts +26 -26
  5. package/jest.config.ts +16 -16
  6. package/main.js +1 -1
  7. package/package.json +30 -30
  8. package/src/constants/common.ts +7 -7
  9. package/src/constants/errors.ts +6 -6
  10. package/src/constants/sports.ts +78 -78
  11. package/src/enums/sports.ts +109 -109
  12. package/src/tests/mock/MockLeagueMap.ts +170 -170
  13. package/src/tests/mock/MockOpticOddsEvents.ts +518 -518
  14. package/src/tests/mock/MockOpticSoccer.ts +9378 -9378
  15. package/src/tests/mock/MockSoccerRedis.ts +2308 -2308
  16. package/src/tests/unit/bookmakers.test.ts +79 -79
  17. package/src/tests/unit/markets.test.ts +156 -156
  18. package/src/tests/unit/odds.test.ts +92 -92
  19. package/src/tests/unit/resolution.test.ts +935 -935
  20. package/src/tests/unit/sports.test.ts +58 -58
  21. package/src/tests/unit/spread.test.ts +131 -131
  22. package/src/types/missing-types.d.ts +2 -2
  23. package/src/types/odds.ts +61 -61
  24. package/src/types/resolution.ts +96 -96
  25. package/src/types/sports.ts +19 -19
  26. package/src/utils/bookmakers.ts +159 -159
  27. package/src/utils/constraints.ts +210 -210
  28. package/src/utils/gameMatching.ts +81 -81
  29. package/src/utils/markets.ts +119 -119
  30. package/src/utils/odds.ts +918 -912
  31. package/src/utils/opticOdds.ts +71 -71
  32. package/src/utils/resolution.ts +291 -291
  33. package/src/utils/sports.ts +51 -51
  34. package/src/utils/spread.ts +97 -97
  35. package/tsconfig.json +16 -16
  36. package/webpack.config.js +24 -30
  37. package/CLAUDE.md +0 -77
  38. package/resolution_live_markets.md +0 -351
@@ -1,170 +1,170 @@
1
- import { LeagueConfigInfo } from '../../types/sports';
2
-
3
- const baseLeagueInfo: LeagueConfigInfo = {
4
- sportId: 9806,
5
- enabled: 'true',
6
- marketName: 'Moneyline',
7
- typeId: 0,
8
- type: 'moneyline',
9
- maxOdds: 0.25,
10
- minOdds: 0.75,
11
- };
12
-
13
- const spreadMock: LeagueConfigInfo = {
14
- sportId: 9806,
15
- enabled: 'true',
16
- marketName: 'Goal Spread',
17
- typeId: 10001,
18
- type: 'Spread',
19
- maxOdds: 0.25,
20
- minOdds: 0.75,
21
- };
22
-
23
- const totalMock: LeagueConfigInfo = {
24
- sportId: 9806,
25
- enabled: 'true',
26
- marketName: 'Total Goals',
27
- typeId: 10002,
28
- type: 'Total',
29
- maxOdds: 0.25,
30
- minOdds: 0.75,
31
- };
32
-
33
- const doubleChanceMock: LeagueConfigInfo = {
34
- sportId: 9806,
35
- enabled: 'true',
36
- marketName: 'Double Chance',
37
- typeId: 10003,
38
- type: 'Double Chance',
39
- maxOdds: 0.01,
40
- minOdds: 0.99,
41
- };
42
-
43
- const correctScoreMock: LeagueConfigInfo = {
44
- sportId: 9806,
45
- enabled: 'true',
46
- marketName: 'Correct Score',
47
- typeId: 10100,
48
- type: 'Correct Score',
49
- maxOdds: 0.25,
50
- minOdds: 0.75,
51
- };
52
-
53
- const childMoneylineMock: LeagueConfigInfo = {
54
- sportId: 9806,
55
- enabled: 'true',
56
- marketName: '1st Half Moneyline',
57
- typeId: 10022,
58
- type: 'Moneyline',
59
- maxOdds: 0.25,
60
- minOdds: 0.75,
61
- };
62
-
63
- const bothTeamsToScoreMock: LeagueConfigInfo = {
64
- sportId: 9806,
65
- enabled: 'true',
66
- marketName: 'Both Teams To Score',
67
- typeId: 10009,
68
- type: 'Both Teams To Score',
69
- maxOdds: 0.01,
70
- minOdds: 0.99,
71
- };
72
-
73
- const bothTeamsToScoreMock1stHalf: LeagueConfigInfo = {
74
- sportId: 9806,
75
- enabled: 'true',
76
- marketName: '1st Half Both Teams To Score',
77
- typeId: 10101,
78
- type: 'Both Teams To Score',
79
- maxOdds: 0.01,
80
- minOdds: 0.99,
81
- };
82
-
83
- const bothTeamsToScoreMock2ndHalf: LeagueConfigInfo = {
84
- sportId: 9806,
85
- enabled: 'true',
86
- marketName: '2nd Half Both Teams To Score',
87
- typeId: 10102,
88
- type: 'Both Teams To Score',
89
- maxOdds: 0.01,
90
- minOdds: 0.99,
91
- };
92
-
93
- const drawNoBetMock: LeagueConfigInfo = {
94
- sportId: 9806,
95
- enabled: 'true',
96
- marketName: 'Draw No Bet',
97
- typeId: 10010,
98
- type: 'Moneyline',
99
- maxOdds: 0.01,
100
- minOdds: 0.99,
101
- };
102
-
103
- const willThereBeOvertime: LeagueConfigInfo = {
104
- sportId: 9806,
105
- enabled: 'true',
106
- marketName: 'Will There Be Overtime',
107
- typeId: 10131,
108
- type: 'Both Teams To Score',
109
- maxOdds: 0.01,
110
- minOdds: 0.99,
111
- };
112
-
113
- const baseDiffSportId: LeagueConfigInfo = {
114
- ...baseLeagueInfo,
115
- sportId: 4,
116
- };
117
-
118
- // Mock Variants
119
- const leagueInfoOnlyParent: LeagueConfigInfo[] = [baseLeagueInfo];
120
- const leagueInfoOnlyParentWithSpreadAdded: LeagueConfigInfo[] = [{ ...baseLeagueInfo, addedSpread: 3 }];
121
- const leagueInfoOnlyParentDiffSportId: LeagueConfigInfo[] = [baseDiffSportId];
122
-
123
- const leagueInfoMockDisabledChilds: LeagueConfigInfo[] = [
124
- baseLeagueInfo,
125
- { ...spreadMock, enabled: 'false' },
126
- { ...totalMock, enabled: 'false' },
127
- { ...doubleChanceMock, enabled: 'false' },
128
- { ...correctScoreMock, enabled: 'false' },
129
- ];
130
-
131
- const leagueInfoEnabledSpreadDisabledTotals: LeagueConfigInfo[] = [
132
- baseLeagueInfo,
133
- spreadMock,
134
- { ...totalMock, enabled: 'false' },
135
- ];
136
-
137
- const leagueInfoDisabledCorrectScoreAndDoubleChance: LeagueConfigInfo[] = [
138
- baseLeagueInfo,
139
- spreadMock,
140
- totalMock,
141
- { ...doubleChanceMock, enabled: 'false' },
142
- { ...correctScoreMock, enabled: 'false' },
143
- ];
144
-
145
- const leagueInfoEnabledSpeadAndTotals: LeagueConfigInfo[] = [baseLeagueInfo, spreadMock, totalMock];
146
- const leagueInfoEnabledAll: LeagueConfigInfo[] = [
147
- baseLeagueInfo,
148
- spreadMock,
149
- totalMock,
150
- childMoneylineMock,
151
- doubleChanceMock,
152
- correctScoreMock,
153
- bothTeamsToScoreMock,
154
- bothTeamsToScoreMock1stHalf,
155
- bothTeamsToScoreMock2ndHalf,
156
- drawNoBetMock,
157
- willThereBeOvertime,
158
- ];
159
-
160
- // Grouped Exports
161
- export const LeagueMocks = {
162
- leagueInfoOnlyParent,
163
- leagueInfoOnlyParentWithSpreadAdded,
164
- leagueInfoOnlyParentDiffSportId,
165
- leagueInfoMockDisabledChilds,
166
- leagueInfoEnabledSpreadDisabledTotals,
167
- leagueInfoEnabledSpeadAndTotals,
168
- leagueInfoEnabledAll,
169
- leagueInfoDisabledCorrectScoreAndDoubleChance,
170
- };
1
+ import { LeagueConfigInfo } from '../../types/sports';
2
+
3
+ const baseLeagueInfo: LeagueConfigInfo = {
4
+ sportId: 9806,
5
+ enabled: 'true',
6
+ marketName: 'Moneyline',
7
+ typeId: 0,
8
+ type: 'moneyline',
9
+ maxOdds: 0.25,
10
+ minOdds: 0.75,
11
+ };
12
+
13
+ const spreadMock: LeagueConfigInfo = {
14
+ sportId: 9806,
15
+ enabled: 'true',
16
+ marketName: 'Goal Spread',
17
+ typeId: 10001,
18
+ type: 'Spread',
19
+ maxOdds: 0.25,
20
+ minOdds: 0.75,
21
+ };
22
+
23
+ const totalMock: LeagueConfigInfo = {
24
+ sportId: 9806,
25
+ enabled: 'true',
26
+ marketName: 'Total Goals',
27
+ typeId: 10002,
28
+ type: 'Total',
29
+ maxOdds: 0.25,
30
+ minOdds: 0.75,
31
+ };
32
+
33
+ const doubleChanceMock: LeagueConfigInfo = {
34
+ sportId: 9806,
35
+ enabled: 'true',
36
+ marketName: 'Double Chance',
37
+ typeId: 10003,
38
+ type: 'Double Chance',
39
+ maxOdds: 0.01,
40
+ minOdds: 0.99,
41
+ };
42
+
43
+ const correctScoreMock: LeagueConfigInfo = {
44
+ sportId: 9806,
45
+ enabled: 'true',
46
+ marketName: 'Correct Score',
47
+ typeId: 10100,
48
+ type: 'Correct Score',
49
+ maxOdds: 0.25,
50
+ minOdds: 0.75,
51
+ };
52
+
53
+ const childMoneylineMock: LeagueConfigInfo = {
54
+ sportId: 9806,
55
+ enabled: 'true',
56
+ marketName: '1st Half Moneyline',
57
+ typeId: 10022,
58
+ type: 'Moneyline',
59
+ maxOdds: 0.25,
60
+ minOdds: 0.75,
61
+ };
62
+
63
+ const bothTeamsToScoreMock: LeagueConfigInfo = {
64
+ sportId: 9806,
65
+ enabled: 'true',
66
+ marketName: 'Both Teams To Score',
67
+ typeId: 10009,
68
+ type: 'Both Teams To Score',
69
+ maxOdds: 0.01,
70
+ minOdds: 0.99,
71
+ };
72
+
73
+ const bothTeamsToScoreMock1stHalf: LeagueConfigInfo = {
74
+ sportId: 9806,
75
+ enabled: 'true',
76
+ marketName: '1st Half Both Teams To Score',
77
+ typeId: 10101,
78
+ type: 'Both Teams To Score',
79
+ maxOdds: 0.01,
80
+ minOdds: 0.99,
81
+ };
82
+
83
+ const bothTeamsToScoreMock2ndHalf: LeagueConfigInfo = {
84
+ sportId: 9806,
85
+ enabled: 'true',
86
+ marketName: '2nd Half Both Teams To Score',
87
+ typeId: 10102,
88
+ type: 'Both Teams To Score',
89
+ maxOdds: 0.01,
90
+ minOdds: 0.99,
91
+ };
92
+
93
+ const drawNoBetMock: LeagueConfigInfo = {
94
+ sportId: 9806,
95
+ enabled: 'true',
96
+ marketName: 'Draw No Bet',
97
+ typeId: 10010,
98
+ type: 'Moneyline',
99
+ maxOdds: 0.01,
100
+ minOdds: 0.99,
101
+ };
102
+
103
+ const willThereBeOvertime: LeagueConfigInfo = {
104
+ sportId: 9806,
105
+ enabled: 'true',
106
+ marketName: 'Will There Be Overtime',
107
+ typeId: 10131,
108
+ type: 'Both Teams To Score',
109
+ maxOdds: 0.01,
110
+ minOdds: 0.99,
111
+ };
112
+
113
+ const baseDiffSportId: LeagueConfigInfo = {
114
+ ...baseLeagueInfo,
115
+ sportId: 4,
116
+ };
117
+
118
+ // Mock Variants
119
+ const leagueInfoOnlyParent: LeagueConfigInfo[] = [baseLeagueInfo];
120
+ const leagueInfoOnlyParentWithSpreadAdded: LeagueConfigInfo[] = [{ ...baseLeagueInfo, addedSpread: 3 }];
121
+ const leagueInfoOnlyParentDiffSportId: LeagueConfigInfo[] = [baseDiffSportId];
122
+
123
+ const leagueInfoMockDisabledChilds: LeagueConfigInfo[] = [
124
+ baseLeagueInfo,
125
+ { ...spreadMock, enabled: 'false' },
126
+ { ...totalMock, enabled: 'false' },
127
+ { ...doubleChanceMock, enabled: 'false' },
128
+ { ...correctScoreMock, enabled: 'false' },
129
+ ];
130
+
131
+ const leagueInfoEnabledSpreadDisabledTotals: LeagueConfigInfo[] = [
132
+ baseLeagueInfo,
133
+ spreadMock,
134
+ { ...totalMock, enabled: 'false' },
135
+ ];
136
+
137
+ const leagueInfoDisabledCorrectScoreAndDoubleChance: LeagueConfigInfo[] = [
138
+ baseLeagueInfo,
139
+ spreadMock,
140
+ totalMock,
141
+ { ...doubleChanceMock, enabled: 'false' },
142
+ { ...correctScoreMock, enabled: 'false' },
143
+ ];
144
+
145
+ const leagueInfoEnabledSpeadAndTotals: LeagueConfigInfo[] = [baseLeagueInfo, spreadMock, totalMock];
146
+ const leagueInfoEnabledAll: LeagueConfigInfo[] = [
147
+ baseLeagueInfo,
148
+ spreadMock,
149
+ totalMock,
150
+ childMoneylineMock,
151
+ doubleChanceMock,
152
+ correctScoreMock,
153
+ bothTeamsToScoreMock,
154
+ bothTeamsToScoreMock1stHalf,
155
+ bothTeamsToScoreMock2ndHalf,
156
+ drawNoBetMock,
157
+ willThereBeOvertime,
158
+ ];
159
+
160
+ // Grouped Exports
161
+ export const LeagueMocks = {
162
+ leagueInfoOnlyParent,
163
+ leagueInfoOnlyParentWithSpreadAdded,
164
+ leagueInfoOnlyParentDiffSportId,
165
+ leagueInfoMockDisabledChilds,
166
+ leagueInfoEnabledSpreadDisabledTotals,
167
+ leagueInfoEnabledSpeadAndTotals,
168
+ leagueInfoEnabledAll,
169
+ leagueInfoDisabledCorrectScoreAndDoubleChance,
170
+ };