overtime-live-trading-utils 0.0.26 → 0.0.27
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/package.json +1 -1
- package/src/constants/sports.ts +7 -0
- package/src/utils/sports.ts +41 -5
package/package.json
CHANGED
package/src/constants/sports.ts
CHANGED
|
@@ -318,3 +318,10 @@ export const LeagueMap: Record<number, any> = {
|
|
|
318
318
|
isDrawAvailable: false,
|
|
319
319
|
},
|
|
320
320
|
};
|
|
321
|
+
|
|
322
|
+
export const VOLLEYBALL_SET_THRESHOLD = 2;
|
|
323
|
+
export const VOLLEYBALL_POINTS_LIMIT = 20;
|
|
324
|
+
export const VOLLEYBALL_FIFTH_SET_POINTS_LIMIT = 10;
|
|
325
|
+
export const TENNIS_ATP_GRAND_SLAM_SET_THRESHOLD = 2;
|
|
326
|
+
export const TENNIS_MASTERS_SET_THRESHOLD = 1;
|
|
327
|
+
export const TENNIS_GEMS_LIMIT = 5;
|
package/src/utils/sports.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
LeagueMap,
|
|
3
|
+
TENNIS_ATP_GRAND_SLAM_SET_THRESHOLD,
|
|
4
|
+
TENNIS_GEMS_LIMIT,
|
|
5
|
+
TENNIS_MASTERS_SET_THRESHOLD,
|
|
6
|
+
VOLLEYBALL_FIFTH_SET_POINTS_LIMIT,
|
|
7
|
+
VOLLEYBALL_POINTS_LIMIT,
|
|
8
|
+
VOLLEYBALL_SET_THRESHOLD,
|
|
9
|
+
} from '../constants/sports';
|
|
2
10
|
import { League, Sport } from '../enums/sports';
|
|
3
11
|
|
|
4
12
|
export const getLeagueSport = (league: number) => {
|
|
@@ -128,21 +136,49 @@ export const allowGameSportWithResultConstraint = (
|
|
|
128
136
|
|
|
129
137
|
if (marketSport == Sport.VOLLEYBALL) {
|
|
130
138
|
if (setInProgress == 5) {
|
|
131
|
-
return checkResultConstraint(
|
|
139
|
+
return checkResultConstraint(
|
|
140
|
+
homeTeam,
|
|
141
|
+
awayTeam,
|
|
142
|
+
currentResultInSet,
|
|
143
|
+
currentSetsScore,
|
|
144
|
+
VOLLEYBALL_SET_THRESHOLD,
|
|
145
|
+
VOLLEYBALL_FIFTH_SET_POINTS_LIMIT
|
|
146
|
+
);
|
|
132
147
|
} else {
|
|
133
|
-
return checkResultConstraint(
|
|
148
|
+
return checkResultConstraint(
|
|
149
|
+
homeTeam,
|
|
150
|
+
awayTeam,
|
|
151
|
+
currentResultInSet,
|
|
152
|
+
currentSetsScore,
|
|
153
|
+
VOLLEYBALL_SET_THRESHOLD,
|
|
154
|
+
VOLLEYBALL_POINTS_LIMIT
|
|
155
|
+
);
|
|
134
156
|
}
|
|
135
157
|
}
|
|
136
158
|
|
|
137
159
|
if (marketLeague.toString().startsWith(League.TENNIS_GS) && atpGrandSlamMatch) {
|
|
138
|
-
return checkResultConstraint(
|
|
160
|
+
return checkResultConstraint(
|
|
161
|
+
homeTeam,
|
|
162
|
+
awayTeam,
|
|
163
|
+
currentResultInSet,
|
|
164
|
+
currentSetsScore,
|
|
165
|
+
TENNIS_ATP_GRAND_SLAM_SET_THRESHOLD,
|
|
166
|
+
TENNIS_GEMS_LIMIT
|
|
167
|
+
);
|
|
139
168
|
}
|
|
140
169
|
|
|
141
170
|
if (
|
|
142
171
|
(marketLeague.toString().startsWith(League.TENNIS_GS) && !atpGrandSlamMatch) ||
|
|
143
172
|
marketLeague.toString().startsWith(League.TENNIS_MASTERS)
|
|
144
173
|
) {
|
|
145
|
-
return checkResultConstraint(
|
|
174
|
+
return checkResultConstraint(
|
|
175
|
+
homeTeam,
|
|
176
|
+
awayTeam,
|
|
177
|
+
currentResultInSet,
|
|
178
|
+
currentSetsScore,
|
|
179
|
+
TENNIS_MASTERS_SET_THRESHOLD,
|
|
180
|
+
TENNIS_GEMS_LIMIT
|
|
181
|
+
);
|
|
146
182
|
}
|
|
147
183
|
};
|
|
148
184
|
|