@levrbet/shared 0.3.1 → 0.3.4
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/dist/core/config/urls.d.ts +8 -0
- package/dist/core/config/urls.js +23 -15
- package/dist/core/config/urls.js.map +1 -1
- package/dist/core/contracts/abis/LevrManager.d.ts +1008 -988
- package/dist/core/contracts/abis/LevrManager.js +1538 -499
- package/dist/core/contracts/abis/LevrManager.js.map +1 -1
- package/dist/core/contracts/abis/index.d.ts +1008 -988
- package/dist/core/contracts/addresses.d.ts +21 -21
- package/dist/core/contracts/addresses.js +19 -19
- package/dist/core/types/oracle/game/game.types.d.ts +3 -2
- package/dist/core/types/oracle/game/game.types.js +0 -1
- package/dist/core/types/oracle/game/game.types.js.map +1 -1
- package/dist/core/types/oracle/market/markets.types.d.ts +4 -2
- package/dist/core/types/oracle/market/markets.types.js.map +1 -1
- package/dist/core/types/oracle/market/positions.types.d.ts +7 -1
- package/dist/core/utils/game.utils.d.ts +0 -2
- package/dist/core/utils/game.utils.js +1 -69
- package/dist/core/utils/game.utils.js.map +1 -1
- package/dist/react/hooks/contracts/useContracts.d.ts +19 -19
- package/dist/server/config/kms.js +1 -1
- package/dist/server/config/redis.d.ts +5 -0
- package/dist/server/config/redis.js +13 -3
- package/dist/server/config/redis.js.map +1 -1
- package/dist/server/config/urls.d.ts +8 -0
- package/dist/server/contracts/clients/ozRelayerService.d.ts +1 -0
- package/dist/server/contracts/clients/ozRelayerService.js +110 -17
- package/dist/server/contracts/clients/ozRelayerService.js.map +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.d.ts +9 -9
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.js.map +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.test.js +1 -1
- package/dist/server/liquidation-engine/redis.cache.manager/prices.set.manager.test.js.map +1 -1
- package/dist/server/oracle/config/game-periods/providers/lsports.periods.js +3 -3
- package/dist/server/oracle/config/game-periods/providers/lsports.periods.js.map +1 -1
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.d.ts +31 -4
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js +32 -5
- package/dist/server/oracle/config/game-periods/providers/optic-odds.periods.js.map +1 -1
- package/dist/server/oracle/config/game-periods/sports.config.d.ts +1 -1
- package/dist/server/oracle/config/game-periods/sports.config.js +125 -10
- package/dist/server/oracle/config/game-periods/sports.config.js.map +1 -1
- package/dist/server/oracle/config/game-periods/types.d.ts +15 -3
- package/dist/server/oracle/config/game-periods/types.js +6 -0
- package/dist/server/oracle/config/game-periods/types.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/channels.d.ts +2 -2
- package/dist/server/oracle/redis-cache-manager/channels.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/game.progress.d.ts +4 -0
- package/dist/server/oracle/redis-cache-manager/game.progress.js +27 -0
- package/dist/server/oracle/redis-cache-manager/game.progress.js.map +1 -0
- package/dist/server/oracle/redis-cache-manager/index.d.ts +1 -0
- package/dist/server/oracle/redis-cache-manager/index.js +1 -0
- package/dist/server/oracle/redis-cache-manager/index.js.map +1 -1
- package/dist/server/oracle/redis-cache-manager/leagues.cache.service.d.ts +3 -3
- package/dist/server/oracle/redis-cache-manager/leagues.cache.service.js +5 -1
- package/dist/server/oracle/redis-cache-manager/leagues.cache.service.js.map +1 -1
- package/dist/server/oracle/rmq-manager/base.queue.manager.d.ts +1 -1
- package/dist/server/oracle/rmq-manager/base.queue.manager.js +3 -1
- package/dist/server/oracle/rmq-manager/base.queue.manager.js.map +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.d.ts +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.js +1 -1
- package/dist/server/oracle/types/providers/game-clock/index.js.map +1 -1
- package/dist/server/services/presigned.urls.js +1 -1
- package/dist/server/services/presigned.urls.js.map +1 -1
- package/dist/server/utils/game_progress/caclulate.game.progress.d.ts +134 -0
- package/dist/server/utils/game_progress/caclulate.game.progress.js +267 -0
- package/dist/server/utils/game_progress/caclulate.game.progress.js.map +1 -0
- package/dist/server/utils/game_progress/game.utils.d.ts +7 -0
- package/dist/server/utils/game_progress/game.utils.js +83 -0
- package/dist/server/utils/game_progress/game.utils.js.map +1 -0
- package/dist/server/utils/game_progress/index.d.ts +3 -0
- package/dist/server/utils/game_progress/index.js +20 -0
- package/dist/server/utils/game_progress/index.js.map +1 -0
- package/dist/server/{oracle/types/providers/game-clock → utils/game_progress}/parser.d.ts +1 -7
- package/dist/server/{oracle/types/providers/game-clock → utils/game_progress}/parser.js +8 -13
- package/dist/server/utils/game_progress/parser.js.map +1 -0
- package/dist/server/utils/index.d.ts +1 -0
- package/dist/server/utils/index.js +1 -0
- package/dist/server/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/prisma/schema.prisma +54 -15
- package/dist/server/oracle/types/providers/game-clock/parser.js.map +0 -1
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SportsGamePeriodClockConfig = void 0;
|
|
4
4
|
const client_1 = require("@prisma/client");
|
|
5
|
+
const core_1 = require("../../../../core");
|
|
5
6
|
const providers_1 = require("./providers");
|
|
7
|
+
const types_1 = require("./types");
|
|
6
8
|
/**
|
|
7
9
|
* Main configuration for game periods and clock behavior by sport and provider
|
|
8
10
|
*/
|
|
9
11
|
exports.SportsGamePeriodClockConfig = {
|
|
10
12
|
[client_1.SportGroup.Basketball]: {
|
|
11
|
-
|
|
13
|
+
totalPeriodDurationInSeconds: 720, // 12 minutes per quarter
|
|
14
|
+
totalPeriods: 4,
|
|
15
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
12
16
|
sportPeriods: {
|
|
13
17
|
regular: [
|
|
14
18
|
providers_1.LSPORTS_BASKETBALL_PERIODS.FIRST_QUARTER,
|
|
@@ -22,13 +26,55 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
22
26
|
providers_1.LSPORTS_BASKETBALL_PERIODS.FULL_TIME_AFTER_OVERTIME,
|
|
23
27
|
],
|
|
24
28
|
extraTime: [providers_1.LSPORTS_BASKETBALL_PERIODS.OVERTIME],
|
|
29
|
+
countUpClock: false,
|
|
30
|
+
},
|
|
31
|
+
leaguePeriods: {
|
|
32
|
+
[types_1.LEAGUE_SELECTORS.NCAA_BASKETBALL]: {
|
|
33
|
+
periodConfig: {
|
|
34
|
+
regular: [providers_1.LSPORTS_NCAA_PERIODS.FIRST_HALF, providers_1.LSPORTS_NCAA_PERIODS.SECOND_HALF],
|
|
35
|
+
fullCycle: [
|
|
36
|
+
providers_1.LSPORTS_BASKETBALL_PERIODS.OVERTIME,
|
|
37
|
+
providers_1.LSPORTS_BASKETBALL_PERIODS.FULL_TIME,
|
|
38
|
+
providers_1.LSPORTS_BASKETBALL_PERIODS.FULL_TIME_AFTER_OVERTIME,
|
|
39
|
+
],
|
|
40
|
+
extraTime: [providers_1.LSPORTS_BASKETBALL_PERIODS.OVERTIME],
|
|
41
|
+
countUpClock: false,
|
|
42
|
+
},
|
|
43
|
+
totalPeriodDurationInSeconds: 1200,
|
|
44
|
+
totalPeriods: 2,
|
|
45
|
+
},
|
|
46
|
+
}, //TODO: Add NCAA Basketball specific periods
|
|
47
|
+
},
|
|
48
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
49
|
+
sportPeriods: {
|
|
50
|
+
regular: [
|
|
51
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.FIRST_QUARTER,
|
|
52
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.SECOND_QUARTER,
|
|
53
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.THIRD_QUARTER,
|
|
54
|
+
providers_1.OPTIC_ODDS_BASKETBALL_PERIODS.FOURTH_QUARTER,
|
|
55
|
+
],
|
|
56
|
+
fullCycle: [],
|
|
57
|
+
extraTime: [],
|
|
58
|
+
countUpClock: true,
|
|
59
|
+
},
|
|
60
|
+
leaguePeriods: {
|
|
61
|
+
[types_1.LEAGUE_SELECTORS.NCAA_BASKETBALL]: {
|
|
62
|
+
periodConfig: {
|
|
63
|
+
regular: [providers_1.OPTIC_ODDS_NCAA_PERIODS.FIRST_HALF, providers_1.OPTIC_ODDS_NCAA_PERIODS.SECOND_HALF],
|
|
64
|
+
fullCycle: [],
|
|
65
|
+
extraTime: [],
|
|
66
|
+
countUpClock: true,
|
|
67
|
+
},
|
|
68
|
+
totalPeriodDurationInSeconds: 1200,
|
|
69
|
+
totalPeriods: 2,
|
|
70
|
+
},
|
|
25
71
|
},
|
|
26
|
-
leaguePeriods: null,
|
|
27
72
|
},
|
|
28
|
-
opticOdds: {},
|
|
29
73
|
},
|
|
30
74
|
[client_1.SportGroup.Soccer]: {
|
|
31
|
-
|
|
75
|
+
totalPeriodDurationInSeconds: 2700, // 45 minutes per half
|
|
76
|
+
totalPeriods: 2,
|
|
77
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
32
78
|
sportPeriods: {
|
|
33
79
|
regular: [providers_1.LSPORTS_SOCCER_PERIODS.FIRST_HALF, providers_1.LSPORTS_SOCCER_PERIODS.SECOND_HALF],
|
|
34
80
|
fullCycle: [
|
|
@@ -42,13 +88,25 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
42
88
|
providers_1.LSPORTS_SOCCER_PERIODS.OVERTIME_FIRST_HALF,
|
|
43
89
|
providers_1.LSPORTS_SOCCER_PERIODS.OVERTIME_SECOND_HALF,
|
|
44
90
|
],
|
|
91
|
+
countUpClock: true,
|
|
92
|
+
},
|
|
93
|
+
leaguePeriods: null,
|
|
94
|
+
},
|
|
95
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
96
|
+
sportPeriods: {
|
|
97
|
+
regular: [providers_1.OPTIC_ODDS_SOCCER_PERIODS.FIRST_HALF, providers_1.OPTIC_ODDS_SOCCER_PERIODS.SECOND_HALF],
|
|
98
|
+
fullCycle: [],
|
|
99
|
+
extraTime: [],
|
|
100
|
+
countUpClock: true,
|
|
45
101
|
},
|
|
46
102
|
leaguePeriods: null,
|
|
47
103
|
},
|
|
48
|
-
opticOdds: {},
|
|
49
104
|
},
|
|
50
105
|
[client_1.SportGroup.Baseball]: {
|
|
51
|
-
|
|
106
|
+
//TODO: add breakdown of top and bottom halves of innings for more granular clock control
|
|
107
|
+
totalPeriodDurationInSeconds: 1200, // TODO: remove time, not used in baseball
|
|
108
|
+
totalPeriods: 9,
|
|
109
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
52
110
|
sportPeriods: {
|
|
53
111
|
regular: [
|
|
54
112
|
providers_1.LSPORTS_BASEBALL_PERIODS.FIRST_INNING,
|
|
@@ -63,13 +121,34 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
63
121
|
],
|
|
64
122
|
fullCycle: [providers_1.LSPORTS_BASEBALL_PERIODS.FULL_TIME, providers_1.LSPORTS_BASEBALL_PERIODS.FULL_TIME_AFTER_EXTRA_TIME],
|
|
65
123
|
extraTime: [providers_1.LSPORTS_BASEBALL_PERIODS.EXTRA_INNINGS],
|
|
124
|
+
countUpClock: true,
|
|
125
|
+
},
|
|
126
|
+
leaguePeriods: null,
|
|
127
|
+
},
|
|
128
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
129
|
+
sportPeriods: {
|
|
130
|
+
regular: [
|
|
131
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FIRST_INNING,
|
|
132
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SECOND_INNING,
|
|
133
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.THIRD_INNING,
|
|
134
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FOURTH_INNING,
|
|
135
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.FIFTH_INNING,
|
|
136
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SIXTH_INNING,
|
|
137
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.SEVENTH_INNING,
|
|
138
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.EIGHTH_INNING,
|
|
139
|
+
providers_1.OPTIC_ODDS_BASEBALL_PERIODS.NINTH_INNING,
|
|
140
|
+
],
|
|
141
|
+
fullCycle: [],
|
|
142
|
+
extraTime: [],
|
|
143
|
+
countUpClock: true,
|
|
66
144
|
},
|
|
67
145
|
leaguePeriods: null,
|
|
68
146
|
},
|
|
69
|
-
opticOdds: {},
|
|
70
147
|
},
|
|
71
148
|
[client_1.SportGroup.Football]: {
|
|
72
|
-
|
|
149
|
+
totalPeriodDurationInSeconds: 900, // 15 minutes per quarter
|
|
150
|
+
totalPeriods: 4,
|
|
151
|
+
[core_1.OddsServices.LSPORTS]: {
|
|
73
152
|
sportPeriods: {
|
|
74
153
|
regular: [
|
|
75
154
|
providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.FIRST_QUARTER,
|
|
@@ -82,10 +161,46 @@ exports.SportsGamePeriodClockConfig = {
|
|
|
82
161
|
providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.FULL_TIME_AFTER_OVERTIME,
|
|
83
162
|
],
|
|
84
163
|
extraTime: [providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.OVERTIME],
|
|
164
|
+
countUpClock: false,
|
|
165
|
+
},
|
|
166
|
+
leaguePeriods: {
|
|
167
|
+
[types_1.LEAGUE_SELECTORS.NCAA_FOOTBALL]: {
|
|
168
|
+
periodConfig: {
|
|
169
|
+
regular: [providers_1.LSPORTS_NCAA_PERIODS.FIRST_HALF, providers_1.LSPORTS_NCAA_PERIODS.SECOND_HALF],
|
|
170
|
+
fullCycle: [],
|
|
171
|
+
extraTime: [providers_1.LSPORTS_AMERICAN_FOOTBALL_PERIODS.OVERTIME],
|
|
172
|
+
countUpClock: true,
|
|
173
|
+
},
|
|
174
|
+
totalPeriodDurationInSeconds: 1800,
|
|
175
|
+
totalPeriods: 2,
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
[core_1.OddsServices.OPTIC_ODDS]: {
|
|
180
|
+
sportPeriods: {
|
|
181
|
+
regular: [
|
|
182
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.FIRST_QUARTER,
|
|
183
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.SECOND_QUARTER,
|
|
184
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.THIRD_QUARTER,
|
|
185
|
+
providers_1.OPTIC_ODDS_AMERICAN_FOOTBALL_PERIODS.FOURTH_QUARTER,
|
|
186
|
+
],
|
|
187
|
+
fullCycle: [],
|
|
188
|
+
extraTime: [],
|
|
189
|
+
countUpClock: true,
|
|
190
|
+
},
|
|
191
|
+
leaguePeriods: {
|
|
192
|
+
[types_1.LEAGUE_SELECTORS.NCAA_FOOTBALL]: {
|
|
193
|
+
periodConfig: {
|
|
194
|
+
regular: [providers_1.OPTIC_ODDS_NCAA_PERIODS.FIRST_HALF, providers_1.OPTIC_ODDS_NCAA_PERIODS.SECOND_HALF],
|
|
195
|
+
fullCycle: [],
|
|
196
|
+
extraTime: [],
|
|
197
|
+
countUpClock: true,
|
|
198
|
+
},
|
|
199
|
+
totalPeriodDurationInSeconds: 1800,
|
|
200
|
+
totalPeriods: 2,
|
|
201
|
+
},
|
|
85
202
|
},
|
|
86
|
-
leaguePeriods: null,
|
|
87
203
|
},
|
|
88
|
-
opticOdds: {},
|
|
89
204
|
},
|
|
90
205
|
};
|
|
91
206
|
//# sourceMappingURL=sports.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sports.config.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/sports.config.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;
|
|
1
|
+
{"version":3,"file":"sports.config.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/sports.config.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,2CAA+C;AA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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SportGroup } from "@prisma/client";
|
|
2
|
+
import { OddsServices } from "../../../../core";
|
|
2
3
|
/**
|
|
3
4
|
* Period configuration for a specific sport or league
|
|
4
5
|
*/
|
|
@@ -9,6 +10,7 @@ export interface PeriodConfig {
|
|
|
9
10
|
fullCycle: number[];
|
|
10
11
|
/** Extra time / overtime periods */
|
|
11
12
|
extraTime: number[];
|
|
13
|
+
countUpClock: boolean;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Provider-specific period configuration
|
|
@@ -18,15 +20,21 @@ export interface ProviderPeriodConfig {
|
|
|
18
20
|
sportPeriods: PeriodConfig;
|
|
19
21
|
/** Optional league-specific overrides keyed by league ID */
|
|
20
22
|
leaguePeriods: null | {
|
|
21
|
-
[leagueId:
|
|
23
|
+
[leagueId: string]: {
|
|
24
|
+
totalPeriods: number;
|
|
25
|
+
totalPeriodDurationInSeconds: number;
|
|
26
|
+
periodConfig: PeriodConfig;
|
|
27
|
+
};
|
|
22
28
|
};
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
31
|
* Complete period configuration for all providers
|
|
26
32
|
*/
|
|
27
33
|
export interface SportPeriodClockConfig {
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
totalPeriods: number;
|
|
35
|
+
totalPeriodDurationInSeconds: number;
|
|
36
|
+
[OddsServices.LSPORTS]: ProviderPeriodConfig;
|
|
37
|
+
[OddsServices.OPTIC_ODDS]: ProviderPeriodConfig;
|
|
30
38
|
}
|
|
31
39
|
/**
|
|
32
40
|
* Main configuration type mapping sport groups to their period configs
|
|
@@ -34,3 +42,7 @@ export interface SportPeriodClockConfig {
|
|
|
34
42
|
export type SportsGamePeriodClockConfigType = {
|
|
35
43
|
[key in SportGroup]?: SportPeriodClockConfig;
|
|
36
44
|
};
|
|
45
|
+
export declare const LEAGUE_SELECTORS: {
|
|
46
|
+
NCAA_BASKETBALL: string;
|
|
47
|
+
NCAA_FOOTBALL: string;
|
|
48
|
+
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LEAGUE_SELECTORS = void 0;
|
|
4
|
+
const core_1 = require("../../../../core");
|
|
5
|
+
exports.LEAGUE_SELECTORS = {
|
|
6
|
+
NCAA_BASKETBALL: "NCAAB",
|
|
7
|
+
NCAA_FOOTBALL: "NCAAF",
|
|
8
|
+
};
|
|
3
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/server/oracle/config/game-periods/types.ts"],"names":[],"mappings":";;;AACA,2CAA+C;AAiDlC,QAAA,gBAAgB,GAAG;IAC5B,eAAe,EAAE,OAAO;IACxB,aAAa,EAAE,OAAO;CACzB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const publishToChannel: (redis:
|
|
1
|
+
import type { RedisClient } from "../../config";
|
|
2
|
+
export declare const publishToChannel: (redis: RedisClient, channel: string, data: unknown) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AAE5C,MAAM,gBAAgB,GAAG,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/channels.ts"],"names":[],"mappings":";;;AACA,yDAAmD;AAE5C,MAAM,gBAAgB,GAAG,KAAK,EAAE,KAAkB,EAAE,OAAe,EAAE,IAAa,EAAiB,EAAE;IACxG,MAAM,OAAO,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAA;IACtF,IAAI,OAAO,IAAI,iCAAc,CAAC,OAAO;QAAE,MAAM,KAAK,CAAC,sCAAsC,OAAO,EAAE,CAAC,CAAA;AACvG,CAAC,CAAA;AAHY,QAAA,gBAAgB,oBAG5B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RedisClient } from "../../config";
|
|
2
|
+
export declare const saveGameProgressToCache: (gameObjectId: string, progressBPS: number, redisClient: RedisClient) => Promise<void>;
|
|
3
|
+
export declare const getAllGameProgressFromCache: (gameObjectId: string, redisClient: RedisClient) => Promise<number[]>;
|
|
4
|
+
export declare const getLatestGameProgressFromCache: (gameObjectId: string, redisClient: RedisClient) => Promise<number | null>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLatestGameProgressFromCache = exports.getAllGameProgressFromCache = exports.saveGameProgressToCache = void 0;
|
|
4
|
+
const cacheKey = `game-progress:test:`;
|
|
5
|
+
const getCacheKey = (gameObjectId) => {
|
|
6
|
+
return `${cacheKey}${gameObjectId}`;
|
|
7
|
+
};
|
|
8
|
+
const saveGameProgressToCache = async (gameObjectId, progressBPS, redisClient) => {
|
|
9
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
10
|
+
await redisClient.lpush(cacheKey, progressBPS.toString());
|
|
11
|
+
};
|
|
12
|
+
exports.saveGameProgressToCache = saveGameProgressToCache;
|
|
13
|
+
const getAllGameProgressFromCache = async (gameObjectId, redisClient) => {
|
|
14
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
15
|
+
const results = await redisClient.lrange(cacheKey, 0, -1);
|
|
16
|
+
return results.map((val) => parseInt(val, 10));
|
|
17
|
+
};
|
|
18
|
+
exports.getAllGameProgressFromCache = getAllGameProgressFromCache;
|
|
19
|
+
const getLatestGameProgressFromCache = async (gameObjectId, redisClient) => {
|
|
20
|
+
const cacheKey = getCacheKey(gameObjectId);
|
|
21
|
+
const result = await redisClient.lindex(cacheKey, 0);
|
|
22
|
+
if (result === null)
|
|
23
|
+
return null;
|
|
24
|
+
return parseInt(result, 10);
|
|
25
|
+
};
|
|
26
|
+
exports.getLatestGameProgressFromCache = getLatestGameProgressFromCache;
|
|
27
|
+
//# sourceMappingURL=game.progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.progress.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/game.progress.ts"],"names":[],"mappings":";;;AAIA,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AAEtC,MAAM,WAAW,GAAG,CAAC,YAAoB,EAAU,EAAE;IACjD,OAAO,GAAG,QAAQ,GAAG,YAAY,EAAE,CAAA;AACvC,CAAC,CAAA;AAEM,MAAM,uBAAuB,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAmB,EAAE,WAAwB,EAAE,EAAE;IACjH,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC7D,CAAC,CAAA;AAHY,QAAA,uBAAuB,2BAGnC;AAEM,MAAM,2BAA2B,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAwB,EAAqB,EAAE;IACnH,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAA;AAClD,CAAC,CAAA;AAJY,QAAA,2BAA2B,+BAIvC;AAEM,MAAM,8BAA8B,GAAG,KAAK,EAAE,YAAoB,EAAE,WAAwB,EAA0B,EAAE;IAC3H,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,CAAA;IAC1C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IACpD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAChC,OAAO,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;AAC/B,CAAC,CAAA;AALY,QAAA,8BAA8B,kCAK1C"}
|
|
@@ -18,5 +18,6 @@ __exportStar(require("./cache.keys.utils"), exports);
|
|
|
18
18
|
__exportStar(require("./channels"), exports);
|
|
19
19
|
__exportStar(require("./game.query.engine"), exports);
|
|
20
20
|
__exportStar(require("./leagues.cache.service"), exports);
|
|
21
|
+
__exportStar(require("./game.progress"), exports);
|
|
21
22
|
__exportStar(require("./market.query.engine"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,6CAA0B;AAC1B,sDAAmC;AACnC,0DAAuC;AACvC,wDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAkC;AAClC,6CAA0B;AAC1B,sDAAmC;AACnC,0DAAuC;AACvC,kDAA+B;AAC/B,wDAAqC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const storePresignedUrlsInRedis: (redisClient:
|
|
1
|
+
import type { RedisClient } from "../../config";
|
|
2
|
+
export declare const storePresignedUrlsInRedis: (redisClient: RedisClient, leaguesWithUrls: {
|
|
3
3
|
leagueObjectId: string;
|
|
4
4
|
presignedUrl: string;
|
|
5
5
|
}[]) => Promise<void>;
|
|
6
|
-
export declare const getPresignedUrlsFromRedis: (redisClient:
|
|
6
|
+
export declare const getPresignedUrlsFromRedis: (redisClient: RedisClient, leagueObjectIds: string[]) => Promise<Record<string, string | null | undefined>>;
|
|
@@ -12,8 +12,12 @@ const storePresignedUrlsInRedis = async (redisClient, leaguesWithUrls) => {
|
|
|
12
12
|
};
|
|
13
13
|
exports.storePresignedUrlsInRedis = storePresignedUrlsInRedis;
|
|
14
14
|
const getPresignedUrlsFromRedis = async (redisClient, leagueObjectIds) => {
|
|
15
|
-
const redisKey = "leaguePresignedUrls";
|
|
16
15
|
const urls = {};
|
|
16
|
+
// Return empty object if no league IDs provided (hmget requires at least one field)
|
|
17
|
+
if (leagueObjectIds.length === 0) {
|
|
18
|
+
return urls;
|
|
19
|
+
}
|
|
20
|
+
const redisKey = "leaguePresignedUrls";
|
|
17
21
|
const results = await redisClient.hmget(redisKey, ...leagueObjectIds);
|
|
18
22
|
leagueObjectIds.forEach((id, index) => {
|
|
19
23
|
urls[id] = results[index];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leagues.cache.service.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/leagues.cache.service.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,KAAK,EAC1C,
|
|
1
|
+
{"version":3,"file":"leagues.cache.service.js","sourceRoot":"","sources":["../../../../src/server/oracle/redis-cache-manager/leagues.cache.service.ts"],"names":[],"mappings":";;;AAEO,MAAM,yBAAyB,GAAG,KAAK,EAC1C,WAAwB,EACxB,eAAmE,EACtD,EAAE;IACf,MAAM,QAAQ,GAAG,qBAAqB,CAAA;IACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAA;IAEvC,KAAK,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,eAAe,EAAE,CAAC;QAC7D,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,CAAA;QACrD,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA,CAAC,qBAAqB;IAC1D,CAAC;IACD,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;AACzB,CAAC,CAAA;AAZY,QAAA,yBAAyB,6BAYrC;AAEM,MAAM,yBAAyB,GAAG,KAAK,EAC1C,WAAwB,EACxB,eAAyB,EACyB,EAAE;IACpD,MAAM,IAAI,GAA8C,EAAE,CAAA;IAE1D,oFAAoF;IACpF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAA;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,qBAAqB,CAAA;IACtC,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,eAAe,CAAC,CAAA;IAErE,eAAe,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QAClC,IAAI,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IACF,OAAO,IAAI,CAAA;AACf,CAAC,CAAA;AAlBY,QAAA,yBAAyB,6BAkBrC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseQueueManager = void 0;
|
|
4
4
|
const config_1 = require("../../config");
|
|
5
|
+
const core_1 = require("../../../core");
|
|
5
6
|
class BaseQueueManager {
|
|
6
7
|
constructor(config) {
|
|
7
8
|
this.config = config;
|
|
@@ -37,6 +38,7 @@ class BaseQueueManager {
|
|
|
37
38
|
queueArguments = {
|
|
38
39
|
"x-group": exchangeIdentifier, // Enable queue grouping by setting the group ID
|
|
39
40
|
"x-single-active-consumer": true, // Ensure only one consumer is active at a time within the group
|
|
41
|
+
...(config_1.LEVR_ENV === core_1.LevrEnv.DEV && { "x-queue-type": "quorum" }),
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
const queueName = this.generateQueueName(identifier);
|
|
@@ -44,7 +46,7 @@ class BaseQueueManager {
|
|
|
44
46
|
await channel.assertQueue(queueName, {
|
|
45
47
|
durable: true,
|
|
46
48
|
deadLetterExchange: this.config.deadLetterExchange,
|
|
47
|
-
maxPriority: 10,
|
|
49
|
+
// maxPriority: 10, /// Quorum does not support priority queues
|
|
48
50
|
arguments: queueArguments,
|
|
49
51
|
});
|
|
50
52
|
await channel.bindQueue(queueName, exchangeName, this.config.routingKeyPrefix + identifier);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.queue.manager.js","sourceRoot":"","sources":["../../../../src/server/oracle/rmq-manager/base.queue.manager.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"base.queue.manager.js","sourceRoot":"","sources":["../../../../src/server/oracle/rmq-manager/base.queue.manager.ts"],"names":[],"mappings":";;;AACA,yCAA+C;AAC/C,wCAAuC;AAUvC,MAAa,gBAAgB;IAGzB,YAAY,MAAmB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACxB,CAAC;IAES,KAAK,CAAC,WAAW,CAAI,UAAwB,EAAE,SAA2C;QAChG,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,CAAA;QAChD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAA;QACrB,OAAO,MAAM,CAAA;IACjB,CAAC;IAES,WAAW,CAAC,YAAoB,EAAE,KAAc,EAAE,OAAe;QACvE,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YACzB,eAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,IAAI,YAAY,IAAI,KAAK,EAAE,CAAC,CAAA;QACrE,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC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AC,cAAc,EAAE,KAAK,EAAE,mCAAmC,CAAC,CAAA;YAC5E,OAAO,KAAK,CAAA;QAChB,CAAC;IACL,CAAC;CACJ;AAzJD,4CAyJC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export * from "
|
|
2
|
+
export * from "../../../../utils/game_progress/parser";
|
|
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./types"), exports);
|
|
18
|
-
__exportStar(require("
|
|
18
|
+
__exportStar(require("../../../../utils/game_progress/parser"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/types/providers/game-clock/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/server/oracle/types/providers/game-clock/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,yEAAsD"}
|
|
@@ -30,7 +30,7 @@ class PresignedUrlService {
|
|
|
30
30
|
throw new Error("S3 client not initialized. Call presignedUrlService.init().");
|
|
31
31
|
}
|
|
32
32
|
const command = new client_s3_1.GetObjectCommand({
|
|
33
|
-
Bucket:
|
|
33
|
+
Bucket: `levr-v1-assets-${config_1.LEVR_ENV}`,
|
|
34
34
|
Key: keyId,
|
|
35
35
|
});
|
|
36
36
|
const imageUrl = await (0, s3_request_presigner_1.getSignedUrl)(this.s3, command, { expiresIn: 172800 }); // 48 hour expiry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presigned.urls.js","sourceRoot":"","sources":["../../../src/server/services/presigned.urls.ts"],"names":[],"mappings":";;;AAAA,kDAA+D;AAC/D,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overview Game progress calculation utilities for various sports.
|
|
3
|
+
* This module provides functions to calculate game progress in basis points (BPS)
|
|
4
|
+
* for different sports including Soccer, Basketball, Football, and Baseball.
|
|
5
|
+
* It supports multiple odds providers (LSports, OpticOdds) with provider-specific
|
|
6
|
+
* period mapping logic.
|
|
7
|
+
* @module game_progress/calculate.game.progress
|
|
8
|
+
*/
|
|
9
|
+
import { SportGroup } from "@prisma/client";
|
|
10
|
+
import { OddsServices } from "../../../core";
|
|
11
|
+
/**
|
|
12
|
+
* Calculates the game progress in basis points (BPS) for a given sport.
|
|
13
|
+
* This is the core calculation function used by all sport-specific progress functions.
|
|
14
|
+
*
|
|
15
|
+
* @param currentPeriod - The current period/quarter/half number from the provider
|
|
16
|
+
* @param gameClock - The game clock string (e.g., "12:30", "45:00")
|
|
17
|
+
* @param sportGroup - The sport group enum value (Soccer, Basketball, Football, Baseball)
|
|
18
|
+
* @param provider - The odds service provider (LSports, OpticOdds)
|
|
19
|
+
* @param isTopOfInning - For baseball only: whether it's the top of the inning
|
|
20
|
+
* @param leagueSelector - Optional league identifier for league-specific configurations (e.g., NCAA)
|
|
21
|
+
* @returns The game progress in basis points (0-10000) or null if invalid input
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Calculate NBA game progress at 5:30 remaining in Q2
|
|
25
|
+
* calculateGameProgress(2, "05:30", SportGroup.Basketball, OddsServices.LSPORTS)
|
|
26
|
+
* // Returns approximately 3125 BPS (31.25% through the game)
|
|
27
|
+
*/
|
|
28
|
+
export declare const calculateGameProgress: (currentPeriod: number, gameClock: string, sportGroup: SportGroup, provider: OddsServices, isTopOfInning?: boolean, leagueSelector?: string) => number | null;
|
|
29
|
+
/**
|
|
30
|
+
* Calculates game progress for Soccer matches in basis points (BPS).
|
|
31
|
+
* Soccer uses 2 x 45 minute halves with a count-up clock.
|
|
32
|
+
*
|
|
33
|
+
* @param currentPeriod - The current half (LSports: 10=1st half, 20=2nd half; OpticOdds: 1 or 2)
|
|
34
|
+
* @param gameClock - The elapsed time in "MM:SS" format (e.g., "32:15")
|
|
35
|
+
* @param provider - The odds service provider
|
|
36
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // First half at 30 minutes
|
|
40
|
+
* calculateSoccerProgress(10, "30:00", SportGroup.Soccer, OddsServices.LSPORTS)
|
|
41
|
+
* // Returns ~3333 BPS (33.33% through the game)
|
|
42
|
+
*/
|
|
43
|
+
export declare const calculateSoccerProgress: (currentPeriod: number, gameClock: string, provider: OddsServices) => number | null;
|
|
44
|
+
/**
|
|
45
|
+
* Calculates game progress for Basketball (NBA) matches in basis points (BPS).
|
|
46
|
+
* NBA uses 4 x 12 minute quarters with a countdown clock.
|
|
47
|
+
*
|
|
48
|
+
* @param currentPeriod - The current quarter (1-4)
|
|
49
|
+
* @param gameClock - The time remaining in "MM:SS" format (e.g., "08:45")
|
|
50
|
+
* @param provider - The odds service provider
|
|
51
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* // Third quarter with 6 minutes remaining
|
|
55
|
+
* calculateBasketballProgress(3, "06:00", SportGroup.Basketball, OddsServices.LSPORTS)
|
|
56
|
+
* // Returns ~6250 BPS (62.5% through the game)
|
|
57
|
+
*/
|
|
58
|
+
export declare const calculateBasketballProgress: (currentPeriod: number, gameClock: string, provider: OddsServices) => number | null;
|
|
59
|
+
/**
|
|
60
|
+
* Calculates game progress for American Football (NFL) matches in basis points (BPS).
|
|
61
|
+
* NFL uses 4 x 15 minute quarters with a countdown clock.
|
|
62
|
+
*
|
|
63
|
+
* @param currentPeriod - The current quarter (1-4)
|
|
64
|
+
* @param gameClock - The time remaining in "MM:SS" format (e.g., "12:30")
|
|
65
|
+
* @param provider - The odds service provider
|
|
66
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* // Second quarter with 8 minutes remaining
|
|
70
|
+
* calculateFootballProgress(2, "08:00", SportGroup.Football, OddsServices.LSPORTS)
|
|
71
|
+
* // Returns ~3667 BPS (36.67% through the game)
|
|
72
|
+
*/
|
|
73
|
+
export declare const calculateFootballProgress: (currentPeriod: number, gameClock: string, provider: OddsServices) => number | null;
|
|
74
|
+
/**
|
|
75
|
+
* Calculates game progress for Baseball (MLB) matches in basis points (BPS).
|
|
76
|
+
* Baseball uses 9 innings, each with a top and bottom half.
|
|
77
|
+
* Progress is calculated based on completed half-innings.
|
|
78
|
+
*
|
|
79
|
+
* @param currentPeriod - The current inning (1-9)
|
|
80
|
+
* @param isTopOfInning - True if it's the top of the inning (away team batting)
|
|
81
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* // Top of the 5th inning
|
|
85
|
+
* calculateBaseballProgress(5, true)
|
|
86
|
+
* // Returns ~4444 BPS (44.44% through the game)
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Bottom of the 7th inning
|
|
90
|
+
* calculateBaseballProgress(7, false)
|
|
91
|
+
* // Returns ~7778 BPS (77.78% through the game)
|
|
92
|
+
*/
|
|
93
|
+
export declare const calculateBaseballProgress: (currentPeriod: number, isTopOfInning: boolean) => number | null;
|
|
94
|
+
/**
|
|
95
|
+
* Calculates game progress for NCAA Basketball (NCAAB) matches in basis points (BPS).
|
|
96
|
+
* NCAAB uses 2 x 20 minute halves with a countdown clock (different from NBA's 4 quarters).
|
|
97
|
+
*
|
|
98
|
+
* @param currentPeriod - The current half (LSports: 10=1st half, 20=2nd half; OpticOdds: 1 or 2)
|
|
99
|
+
* @param gameClock - The time remaining
|
|
100
|
+
* @param provider - The odds service provider
|
|
101
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* - LSports uses period codes 10 and 20 for 1st and 2nd halves respectively
|
|
105
|
+
* - OpticOdds uses standard 1 and 2 for halves
|
|
106
|
+
* - Total game duration: 40 minutes (2 x 20 min halves)
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* // First half with 10 minutes remaining (LSports)
|
|
110
|
+
* calculateNCAABProgress(10, "10:00", OddsServices.LSPORTS)
|
|
111
|
+
* // Returns ~2500 BPS (25% through the game)
|
|
112
|
+
*/
|
|
113
|
+
export declare const calculateNCAABProgress: (currentPeriod: number, gameClock: string, provider: OddsServices) => number | null;
|
|
114
|
+
/**
|
|
115
|
+
* Calculates game progress for NCAA Football (NCAAF) matches in basis points (BPS).
|
|
116
|
+
* NCAAF uses 2 x 30 minute halves (equivalent to 4 x 15 min quarters) with a countdown clock.
|
|
117
|
+
*
|
|
118
|
+
* @param currentPeriod - The current half (LSports: 10=1st half, 20=2nd half; OpticOdds: 1 or 2)
|
|
119
|
+
* @param gameClock - The time remaining in "MM:SS" format (e.g., "25:00")
|
|
120
|
+
* @param provider - The odds service provider
|
|
121
|
+
* @returns Game progress in BPS (0-10000) or null if invalid
|
|
122
|
+
*
|
|
123
|
+
* @remarks
|
|
124
|
+
* - LSports uses period codes 10 and 20 for 1st and 2nd halves respectively
|
|
125
|
+
* - OpticOdds uses standard 1 and 2 for halves
|
|
126
|
+
* - Total game duration: 60 minutes (2 x 30 min halves)
|
|
127
|
+
* - Quarters are grouped into halves for period tracking
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* // First half with 20 minutes remaining (LSports)
|
|
131
|
+
* calculateNCAAFProgress(10, "20:00", OddsServices.LSPORTS)
|
|
132
|
+
* // Returns ~1667 BPS (16.67% through the game)
|
|
133
|
+
*/
|
|
134
|
+
export declare const calculateNCAAFProgress: (currentPeriod: number, gameClock: string, provider: OddsServices) => number | null;
|