overtime-live-trading-utils 2.1.36 → 2.1.37-rc.0
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 +32 -32
- package/.prettierrc +9 -9
- package/codecov.yml +20 -20
- package/index.ts +26 -26
- package/jest.config.ts +16 -16
- package/main.js +1 -1
- package/package.json +30 -30
- package/src/constants/common.ts +8 -7
- package/src/constants/errors.ts +7 -6
- package/src/constants/sports.ts +78 -78
- package/src/enums/sports.ts +109 -109
- package/src/tests/mock/MockLeagueMap.ts +200 -170
- package/src/tests/mock/MockOpticOddsEvents.ts +662 -662
- package/src/tests/mock/MockOpticSoccer.ts +9864 -9378
- package/src/tests/mock/MockSoccerRedis.ts +2308 -2308
- package/src/tests/unit/bookmakers.test.ts +148 -79
- package/src/tests/unit/markets.test.ts +176 -156
- package/src/tests/unit/odds.test.ts +103 -92
- package/src/tests/unit/resolution.test.ts +1488 -1488
- package/src/tests/unit/sports.test.ts +58 -58
- package/src/tests/unit/spread.test.ts +144 -131
- package/src/tests/utils/helper.ts +10 -0
- package/src/types/bookmakers.ts +7 -0
- package/src/types/missing-types.d.ts +2 -2
- package/src/types/odds.ts +80 -61
- package/src/types/resolution.ts +96 -96
- package/src/types/sports.ts +22 -19
- package/src/utils/bookmakers.ts +315 -159
- package/src/utils/constraints.ts +210 -210
- package/src/utils/gameMatching.ts +81 -81
- package/src/utils/markets.ts +119 -119
- package/src/utils/odds.ts +947 -918
- package/src/utils/opticOdds.ts +71 -71
- package/src/utils/resolution.ts +319 -319
- package/src/utils/sportPeriodMapping.ts +36 -36
- package/src/utils/sports.ts +51 -51
- package/src/utils/spread.ts +97 -97
- package/tsconfig.json +16 -16
- package/webpack.config.js +24 -24
- package/CLAUDE.md +0 -84
- package/resolution_live_markets.md +0 -356
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getBetTypesForLeague,
|
|
3
|
-
getLeagueSpreadTypes,
|
|
4
|
-
getLeagueTotalTypes,
|
|
5
|
-
getLiveSupportedLeagues,
|
|
6
|
-
} from '../../utils/sports';
|
|
7
|
-
import { LeagueMocks } from '../mock/MockLeagueMap';
|
|
8
|
-
|
|
9
|
-
describe('Sports', () => {
|
|
10
|
-
it('Should return all enabled leagues for LIVE', () => {
|
|
11
|
-
const supportedLeageus = getLiveSupportedLeagues(LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
12
|
-
|
|
13
|
-
expect(supportedLeageus).toContain(9806);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it('Should return all enabled bet types for league', () => {
|
|
17
|
-
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoEnabledAll);
|
|
18
|
-
|
|
19
|
-
expect(betTypes).toContain('Moneyline');
|
|
20
|
-
expect(betTypes).toContain('Goal Spread');
|
|
21
|
-
expect(betTypes).toContain('Total Goals');
|
|
22
|
-
expect(betTypes).toContain('Double Chance');
|
|
23
|
-
expect(betTypes).toContain('Correct Score');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('Should return all enabled bet types for league, and not contain disabled ones (Totals)', () => {
|
|
27
|
-
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoEnabledSpreadDisabledTotals);
|
|
28
|
-
|
|
29
|
-
expect(betTypes).toContain('Moneyline');
|
|
30
|
-
expect(betTypes).toContain('Goal Spread');
|
|
31
|
-
expect(betTypes).not.toContain('Total Goals');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('Should return all enabled bet types for league, and not contain disabled ones (Double Chance and Correct Score)', () => {
|
|
35
|
-
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoDisabledCorrectScoreAndDoubleChance);
|
|
36
|
-
|
|
37
|
-
expect(betTypes).toContain('Moneyline');
|
|
38
|
-
expect(betTypes).toContain('Goal Spread');
|
|
39
|
-
expect(betTypes).not.toContain('Double Chance');
|
|
40
|
-
expect(betTypes).not.toContain('Correct Score');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('Should return all enabled spread bet types for league', () => {
|
|
44
|
-
const betTypes = getLeagueSpreadTypes(9806, LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
45
|
-
|
|
46
|
-
expect(betTypes).not.toContain('moneyline');
|
|
47
|
-
expect(betTypes).toContain('goal spread');
|
|
48
|
-
expect(betTypes).not.toContain('total goals');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('Should return all enabled total bet types for league', () => {
|
|
52
|
-
const betTypes = getLeagueTotalTypes(9806, LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
53
|
-
|
|
54
|
-
expect(betTypes).not.toContain('moneyline');
|
|
55
|
-
expect(betTypes).not.toContain('goal spread');
|
|
56
|
-
expect(betTypes).toContain('total goals');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
1
|
+
import {
|
|
2
|
+
getBetTypesForLeague,
|
|
3
|
+
getLeagueSpreadTypes,
|
|
4
|
+
getLeagueTotalTypes,
|
|
5
|
+
getLiveSupportedLeagues,
|
|
6
|
+
} from '../../utils/sports';
|
|
7
|
+
import { LeagueMocks } from '../mock/MockLeagueMap';
|
|
8
|
+
|
|
9
|
+
describe('Sports', () => {
|
|
10
|
+
it('Should return all enabled leagues for LIVE', () => {
|
|
11
|
+
const supportedLeageus = getLiveSupportedLeagues(LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
12
|
+
|
|
13
|
+
expect(supportedLeageus).toContain(9806);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('Should return all enabled bet types for league', () => {
|
|
17
|
+
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoEnabledAll);
|
|
18
|
+
|
|
19
|
+
expect(betTypes).toContain('Moneyline');
|
|
20
|
+
expect(betTypes).toContain('Goal Spread');
|
|
21
|
+
expect(betTypes).toContain('Total Goals');
|
|
22
|
+
expect(betTypes).toContain('Double Chance');
|
|
23
|
+
expect(betTypes).toContain('Correct Score');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Should return all enabled bet types for league, and not contain disabled ones (Totals)', () => {
|
|
27
|
+
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoEnabledSpreadDisabledTotals);
|
|
28
|
+
|
|
29
|
+
expect(betTypes).toContain('Moneyline');
|
|
30
|
+
expect(betTypes).toContain('Goal Spread');
|
|
31
|
+
expect(betTypes).not.toContain('Total Goals');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Should return all enabled bet types for league, and not contain disabled ones (Double Chance and Correct Score)', () => {
|
|
35
|
+
const betTypes = getBetTypesForLeague(9806, LeagueMocks.leagueInfoDisabledCorrectScoreAndDoubleChance);
|
|
36
|
+
|
|
37
|
+
expect(betTypes).toContain('Moneyline');
|
|
38
|
+
expect(betTypes).toContain('Goal Spread');
|
|
39
|
+
expect(betTypes).not.toContain('Double Chance');
|
|
40
|
+
expect(betTypes).not.toContain('Correct Score');
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('Should return all enabled spread bet types for league', () => {
|
|
44
|
+
const betTypes = getLeagueSpreadTypes(9806, LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
45
|
+
|
|
46
|
+
expect(betTypes).not.toContain('moneyline');
|
|
47
|
+
expect(betTypes).toContain('goal spread');
|
|
48
|
+
expect(betTypes).not.toContain('total goals');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('Should return all enabled total bet types for league', () => {
|
|
52
|
+
const betTypes = getLeagueTotalTypes(9806, LeagueMocks.leagueInfoEnabledSpeadAndTotals);
|
|
53
|
+
|
|
54
|
+
expect(betTypes).not.toContain('moneyline');
|
|
55
|
+
expect(betTypes).not.toContain('goal spread');
|
|
56
|
+
expect(betTypes).toContain('total goals');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -1,131 +1,144 @@
|
|
|
1
|
-
import { ZERO_ODDS_AFTER_SPREAD_ADJUSTMENT } from '../../constants/errors';
|
|
2
|
-
import { processMarket } from '../../utils/markets';
|
|
3
|
-
import { mapOpticOddsApiFixtureOdds } from '../../utils/opticOdds';
|
|
4
|
-
import { LeagueMocks } from '../mock/MockLeagueMap';
|
|
5
|
-
import { MockAfterSpreadZeroOdds1, MockOnlyMoneylineFavorite, MockOpticSoccer } from '../mock/MockOpticSoccer';
|
|
6
|
-
import { mockSoccer } from '../mock/MockSoccerRedis';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
1
|
+
import { ZERO_ODDS_AFTER_SPREAD_ADJUSTMENT } from '../../constants/errors';
|
|
2
|
+
import { processMarket } from '../../utils/markets';
|
|
3
|
+
import { mapOpticOddsApiFixtureOdds } from '../../utils/opticOdds';
|
|
4
|
+
import { LeagueMocks } from '../mock/MockLeagueMap';
|
|
5
|
+
import { MockAfterSpreadZeroOdds1, MockOnlyMoneylineFavorite, MockOpticSoccer } from '../mock/MockOpticSoccer';
|
|
6
|
+
import { mockSoccer } from '../mock/MockSoccerRedis';
|
|
7
|
+
import { getLastPolledMapForBookmakers, MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST } from '../utils/helper';
|
|
8
|
+
|
|
9
|
+
const lastPolledMap = getLastPolledMapForBookmakers();
|
|
10
|
+
|
|
11
|
+
describe('Spread configuration', () => {
|
|
12
|
+
it('Should return zero odds for quotes that sum up total probability above 1', () => {
|
|
13
|
+
const freshMockSoccer = JSON.parse(JSON.stringify(mockSoccer));
|
|
14
|
+
const freshMockOpticSoccer = JSON.parse(JSON.stringify(MockAfterSpreadZeroOdds1));
|
|
15
|
+
const market = processMarket(
|
|
16
|
+
freshMockSoccer,
|
|
17
|
+
mapOpticOddsApiFixtureOdds([freshMockOpticSoccer])[0],
|
|
18
|
+
['draftkings'],
|
|
19
|
+
[],
|
|
20
|
+
false,
|
|
21
|
+
undefined,
|
|
22
|
+
undefined,
|
|
23
|
+
LeagueMocks.leagueInfoEnabledSpeadAndTotals,
|
|
24
|
+
lastPolledMap,
|
|
25
|
+
MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const hasOdds = market.odds.some(
|
|
29
|
+
(odd: any) => odd.american !== 0 || odd.decimal !== 0 || odd.normalizedImplied !== 0
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
expect(hasOdds).toBe(false);
|
|
33
|
+
expect(market).toHaveProperty('errorMessage');
|
|
34
|
+
expect(market.errorMessage).toBe(ZERO_ODDS_AFTER_SPREAD_ADJUSTMENT); // should be no matching bookmakers mesage
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('Should have diff between odds equal to 3%', () => {
|
|
38
|
+
const freshMockSoccer = JSON.parse(JSON.stringify(mockSoccer));
|
|
39
|
+
const freshMockOpticSoccer = JSON.parse(JSON.stringify(MockOpticSoccer));
|
|
40
|
+
const market = JSON.parse(
|
|
41
|
+
JSON.stringify(
|
|
42
|
+
processMarket(
|
|
43
|
+
freshMockSoccer,
|
|
44
|
+
mapOpticOddsApiFixtureOdds([freshMockOpticSoccer])[0],
|
|
45
|
+
['draftkings'],
|
|
46
|
+
[],
|
|
47
|
+
true,
|
|
48
|
+
undefined,
|
|
49
|
+
undefined,
|
|
50
|
+
LeagueMocks.leagueInfoOnlyParent,
|
|
51
|
+
lastPolledMap,
|
|
52
|
+
MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const marketWithAddedSpread = JSON.parse(
|
|
58
|
+
JSON.stringify(
|
|
59
|
+
processMarket(
|
|
60
|
+
freshMockSoccer,
|
|
61
|
+
mapOpticOddsApiFixtureOdds([freshMockOpticSoccer])[0],
|
|
62
|
+
['draftkings'],
|
|
63
|
+
[],
|
|
64
|
+
true,
|
|
65
|
+
undefined,
|
|
66
|
+
undefined,
|
|
67
|
+
LeagueMocks.leagueInfoOnlyParentWithSpreadAdded,
|
|
68
|
+
lastPolledMap,
|
|
69
|
+
MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const diff1 =
|
|
75
|
+
((market.odds[0].decimal - marketWithAddedSpread.odds[0].decimal) / marketWithAddedSpread.odds[0].decimal) *
|
|
76
|
+
100;
|
|
77
|
+
|
|
78
|
+
const diff2 =
|
|
79
|
+
((market.odds[1].decimal - marketWithAddedSpread.odds[1].decimal) / marketWithAddedSpread.odds[1].decimal) *
|
|
80
|
+
100;
|
|
81
|
+
|
|
82
|
+
const diff3 =
|
|
83
|
+
((market.odds[2].decimal - marketWithAddedSpread.odds[2].decimal) / marketWithAddedSpread.odds[2].decimal) *
|
|
84
|
+
100;
|
|
85
|
+
|
|
86
|
+
expect(Math.round(diff1)).toBe(3);
|
|
87
|
+
expect(Math.round(diff2)).toBe(3);
|
|
88
|
+
expect(Math.round(diff3)).toBe(3);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('Should have diff between odds equal to 3%, and one odd should stay the same', () => {
|
|
92
|
+
const freshMockSoccer = JSON.parse(JSON.stringify(mockSoccer));
|
|
93
|
+
const freshMockOpticSoccer = JSON.parse(JSON.stringify(MockOnlyMoneylineFavorite));
|
|
94
|
+
const market = JSON.parse(
|
|
95
|
+
JSON.stringify(
|
|
96
|
+
processMarket(
|
|
97
|
+
freshMockSoccer,
|
|
98
|
+
mapOpticOddsApiFixtureOdds([freshMockOpticSoccer])[0],
|
|
99
|
+
['draftkings'],
|
|
100
|
+
[],
|
|
101
|
+
true,
|
|
102
|
+
undefined,
|
|
103
|
+
undefined,
|
|
104
|
+
LeagueMocks.leagueInfoOnlyParent,
|
|
105
|
+
lastPolledMap,
|
|
106
|
+
MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const marketWithAddedSpread = JSON.parse(
|
|
112
|
+
JSON.stringify(
|
|
113
|
+
processMarket(
|
|
114
|
+
freshMockSoccer,
|
|
115
|
+
mapOpticOddsApiFixtureOdds([freshMockOpticSoccer])[0],
|
|
116
|
+
['draftkings'],
|
|
117
|
+
[],
|
|
118
|
+
true,
|
|
119
|
+
undefined,
|
|
120
|
+
undefined,
|
|
121
|
+
LeagueMocks.leagueInfoOnlyParentWithSpreadAdded,
|
|
122
|
+
lastPolledMap,
|
|
123
|
+
MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST
|
|
124
|
+
)
|
|
125
|
+
)
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
const diff1 =
|
|
129
|
+
((market.odds[0].decimal - marketWithAddedSpread.odds[0].decimal) / marketWithAddedSpread.odds[0].decimal) *
|
|
130
|
+
100;
|
|
131
|
+
|
|
132
|
+
const diff2 =
|
|
133
|
+
((market.odds[1].decimal - marketWithAddedSpread.odds[1].decimal) / marketWithAddedSpread.odds[1].decimal) *
|
|
134
|
+
100;
|
|
135
|
+
|
|
136
|
+
const diff3 =
|
|
137
|
+
((market.odds[2].decimal - marketWithAddedSpread.odds[2].decimal) / marketWithAddedSpread.odds[2].decimal) *
|
|
138
|
+
100;
|
|
139
|
+
|
|
140
|
+
expect(Math.round(diff1)).toBe(0);
|
|
141
|
+
expect(Math.round(diff2)).toBe(3);
|
|
142
|
+
expect(Math.round(diff3)).toBe(3);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LastPolledArray } from '../../types/sports';
|
|
2
|
+
|
|
3
|
+
export const getLastPolledMapForBookmakers = () => {
|
|
4
|
+
const lastPolledMap: LastPolledArray = [];
|
|
5
|
+
lastPolledMap.push({ sportsbook: 'draftkings', timestamp: Date.now() });
|
|
6
|
+
lastPolledMap.push({ sportsbook: 'bovada', timestamp: Date.now() });
|
|
7
|
+
return lastPolledMap;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const MAX_ALLOWED_PROVIDER_DATA_STALE_DELAY_TEST = 30000; // 30 seconds
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare module 'oddslib';
|
|
2
|
-
declare module 'bytes32';
|
|
1
|
+
declare module 'oddslib';
|
|
2
|
+
declare module 'bytes32';
|
package/src/types/odds.ts
CHANGED
|
@@ -1,61 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import { LeagueConfigInfo } from './sports';
|
|
2
|
+
|
|
3
|
+
export type Fixture = {
|
|
4
|
+
gameId: string;
|
|
5
|
+
startDate: number;
|
|
6
|
+
homeTeam: string;
|
|
7
|
+
awayTeam: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type Odds = [
|
|
11
|
+
{
|
|
12
|
+
id: string;
|
|
13
|
+
sportsBookName: string;
|
|
14
|
+
name: string;
|
|
15
|
+
price: number;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
points: number;
|
|
18
|
+
isMain: boolean;
|
|
19
|
+
isLive: boolean;
|
|
20
|
+
marketName: string;
|
|
21
|
+
playerId: string;
|
|
22
|
+
selection: string;
|
|
23
|
+
selectionLine: string;
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export type OddsObject = {
|
|
28
|
+
gameId: string;
|
|
29
|
+
startDate: number;
|
|
30
|
+
homeTeam: string;
|
|
31
|
+
awayTeam: string;
|
|
32
|
+
isLive: boolean;
|
|
33
|
+
status: string;
|
|
34
|
+
sport: string;
|
|
35
|
+
league: string;
|
|
36
|
+
odds: Odds;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type OddsWithLeagueInfo = [
|
|
40
|
+
{
|
|
41
|
+
id: string;
|
|
42
|
+
sportsBookName: string;
|
|
43
|
+
name: string;
|
|
44
|
+
price: number;
|
|
45
|
+
timestamp: number;
|
|
46
|
+
points: number;
|
|
47
|
+
isMain: boolean;
|
|
48
|
+
isLive: boolean;
|
|
49
|
+
marketName: string;
|
|
50
|
+
playerId: string;
|
|
51
|
+
selection: string;
|
|
52
|
+
selectionLine: string;
|
|
53
|
+
} & LeagueConfigInfo
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
export type ScoresObject = {
|
|
57
|
+
gameId: string;
|
|
58
|
+
sport: string;
|
|
59
|
+
league: string;
|
|
60
|
+
status: string;
|
|
61
|
+
isLive: boolean;
|
|
62
|
+
clock: string;
|
|
63
|
+
period: string;
|
|
64
|
+
homeTeam: string;
|
|
65
|
+
awayTeam: string;
|
|
66
|
+
homeTotal: string;
|
|
67
|
+
awayTotal: string;
|
|
68
|
+
homePeriod1: string;
|
|
69
|
+
awayPeriod1: string;
|
|
70
|
+
homePeriod2: string;
|
|
71
|
+
awayPeriod2: string;
|
|
72
|
+
homePeriod3: string;
|
|
73
|
+
awayPeriod3: string;
|
|
74
|
+
homePeriod4: string;
|
|
75
|
+
awayPeriod4: string;
|
|
76
|
+
homePeriod5: string;
|
|
77
|
+
awayPeriod5: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type HomeAwayTeams = { homeTeam: string; awayTeam: string };
|