overtime-live-trading-utils 1.1.35 → 1.1.37
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/.circleci/config.yml +30 -30
- package/.prettierrc +9 -9
- package/codecov.yml +20 -20
- package/index.ts +16 -16
- package/jest.config.ts +16 -16
- package/main.js +1 -1
- package/package.json +29 -29
- package/src/constants/common.ts +10 -10
- package/src/constants/errors.ts +5 -5
- package/src/constants/sports.ts +2217 -2109
- package/src/enums/sports.ts +315 -306
- package/src/tests/mock/MockLeagueMap.ts +77 -77
- package/src/tests/mock/MockOpticSoccer.ts +9342 -9342
- package/src/tests/mock/MockSoccerRedis.ts +2309 -2309
- package/src/tests/unit/bookmakers.test.ts +77 -77
- package/src/tests/unit/markets.test.ts +133 -133
- package/src/tests/unit/odds.test.ts +92 -92
- package/src/tests/unit/sports.test.ts +47 -47
- package/src/tests/unit/spread.test.ts +131 -131
- package/src/types/odds.ts +50 -50
- package/src/types/sports.ts +18 -18
- package/src/utils/bookmakers.ts +153 -153
- package/src/utils/constraints.ts +186 -189
- package/src/utils/gameMatching.ts +88 -88
- package/src/utils/markets.ts +110 -110
- package/src/utils/odds.ts +470 -470
- package/src/utils/opticOdds.ts +102 -102
- package/src/utils/sports.ts +83 -83
- package/src/utils/spread.ts +92 -92
- package/tsconfig.json +12 -12
- package/webpack.config.js +24 -24
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { LeagueInfo } from '../../types/sports';
|
|
2
|
-
|
|
3
|
-
const baseLeagueInfo: LeagueInfo = {
|
|
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: LeagueInfo = {
|
|
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: LeagueInfo = {
|
|
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 childMoneylineMock: LeagueInfo = {
|
|
34
|
-
sportId: 9806,
|
|
35
|
-
enabled: 'true',
|
|
36
|
-
marketName: '1st Half Moneyline',
|
|
37
|
-
typeId: 10022,
|
|
38
|
-
type: 'Moneyline',
|
|
39
|
-
maxOdds: 0.25,
|
|
40
|
-
minOdds: 0.75,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const baseDiffSportId: LeagueInfo = {
|
|
44
|
-
...baseLeagueInfo,
|
|
45
|
-
sportId: 4,
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// Mock Variants
|
|
49
|
-
const leagueInfoOnlyParent: LeagueInfo[] = [baseLeagueInfo];
|
|
50
|
-
const leagueInfoOnlyParentWithSpreadAdded: LeagueInfo[] = [{ ...baseLeagueInfo, addedSpread: 3 }];
|
|
51
|
-
const leagueInfoOnlyParentDiffSportId: LeagueInfo[] = [baseDiffSportId];
|
|
52
|
-
|
|
53
|
-
const leagueInfoMockDisabledChilds: LeagueInfo[] = [
|
|
54
|
-
baseLeagueInfo,
|
|
55
|
-
{ ...spreadMock, enabled: 'false' },
|
|
56
|
-
{ ...totalMock, enabled: 'false' },
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
const leagueInfoEnabledSpreadDisabledTotals: LeagueInfo[] = [
|
|
60
|
-
baseLeagueInfo,
|
|
61
|
-
spreadMock,
|
|
62
|
-
{ ...totalMock, enabled: 'false' },
|
|
63
|
-
];
|
|
64
|
-
|
|
65
|
-
const leagueInfoEnabledSpeadAndTotals: LeagueInfo[] = [baseLeagueInfo, spreadMock, totalMock];
|
|
66
|
-
const leagueInfoEnabledAll: LeagueInfo[] = [baseLeagueInfo, spreadMock, totalMock, childMoneylineMock];
|
|
67
|
-
|
|
68
|
-
// Grouped Exports
|
|
69
|
-
export const LeagueMocks = {
|
|
70
|
-
leagueInfoOnlyParent,
|
|
71
|
-
leagueInfoOnlyParentWithSpreadAdded,
|
|
72
|
-
leagueInfoOnlyParentDiffSportId,
|
|
73
|
-
leagueInfoMockDisabledChilds,
|
|
74
|
-
leagueInfoEnabledSpreadDisabledTotals,
|
|
75
|
-
leagueInfoEnabledSpeadAndTotals,
|
|
76
|
-
leagueInfoEnabledAll,
|
|
77
|
-
};
|
|
1
|
+
import { LeagueInfo } from '../../types/sports';
|
|
2
|
+
|
|
3
|
+
const baseLeagueInfo: LeagueInfo = {
|
|
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: LeagueInfo = {
|
|
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: LeagueInfo = {
|
|
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 childMoneylineMock: LeagueInfo = {
|
|
34
|
+
sportId: 9806,
|
|
35
|
+
enabled: 'true',
|
|
36
|
+
marketName: '1st Half Moneyline',
|
|
37
|
+
typeId: 10022,
|
|
38
|
+
type: 'Moneyline',
|
|
39
|
+
maxOdds: 0.25,
|
|
40
|
+
minOdds: 0.75,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const baseDiffSportId: LeagueInfo = {
|
|
44
|
+
...baseLeagueInfo,
|
|
45
|
+
sportId: 4,
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Mock Variants
|
|
49
|
+
const leagueInfoOnlyParent: LeagueInfo[] = [baseLeagueInfo];
|
|
50
|
+
const leagueInfoOnlyParentWithSpreadAdded: LeagueInfo[] = [{ ...baseLeagueInfo, addedSpread: 3 }];
|
|
51
|
+
const leagueInfoOnlyParentDiffSportId: LeagueInfo[] = [baseDiffSportId];
|
|
52
|
+
|
|
53
|
+
const leagueInfoMockDisabledChilds: LeagueInfo[] = [
|
|
54
|
+
baseLeagueInfo,
|
|
55
|
+
{ ...spreadMock, enabled: 'false' },
|
|
56
|
+
{ ...totalMock, enabled: 'false' },
|
|
57
|
+
];
|
|
58
|
+
|
|
59
|
+
const leagueInfoEnabledSpreadDisabledTotals: LeagueInfo[] = [
|
|
60
|
+
baseLeagueInfo,
|
|
61
|
+
spreadMock,
|
|
62
|
+
{ ...totalMock, enabled: 'false' },
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const leagueInfoEnabledSpeadAndTotals: LeagueInfo[] = [baseLeagueInfo, spreadMock, totalMock];
|
|
66
|
+
const leagueInfoEnabledAll: LeagueInfo[] = [baseLeagueInfo, spreadMock, totalMock, childMoneylineMock];
|
|
67
|
+
|
|
68
|
+
// Grouped Exports
|
|
69
|
+
export const LeagueMocks = {
|
|
70
|
+
leagueInfoOnlyParent,
|
|
71
|
+
leagueInfoOnlyParentWithSpreadAdded,
|
|
72
|
+
leagueInfoOnlyParentDiffSportId,
|
|
73
|
+
leagueInfoMockDisabledChilds,
|
|
74
|
+
leagueInfoEnabledSpreadDisabledTotals,
|
|
75
|
+
leagueInfoEnabledSpeadAndTotals,
|
|
76
|
+
leagueInfoEnabledAll,
|
|
77
|
+
};
|