overtime-live-trading-utils 0.0.136 → 0.0.138
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/types/sports.ts +8 -0
- package/src/utils/odds.ts +11 -4
package/package.json
CHANGED
package/src/types/sports.ts
CHANGED
package/src/utils/odds.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { DRAW, LIVE_TYPE_ID_BASE, MIN_ODDS_FOR_DIFF_CHECKING, ZERO } from '../co
|
|
|
3
3
|
import { checkOddsFromBookmakers } from './bookmakers';
|
|
4
4
|
import { adjustSpreadOnOdds, getSpreadData } from './spread';
|
|
5
5
|
import { MoneylineTypes } from '../enums/sports';
|
|
6
|
-
import { LeagueInfo } from '../types/sports';
|
|
6
|
+
import { ChildMarket, LeagueInfo } from '../types/sports';
|
|
7
7
|
import { getLeagueInfo } from './sports';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -175,7 +175,14 @@ export const getParentOdds = (
|
|
|
175
175
|
* @param {Boolean} leagueMap - League Map info
|
|
176
176
|
* @returns {Array} The child markets.
|
|
177
177
|
*/
|
|
178
|
-
export const createChildMarkets
|
|
178
|
+
export const createChildMarkets: (
|
|
179
|
+
apiResponseWithOdds: any,
|
|
180
|
+
spreadDataForSport: any,
|
|
181
|
+
leagueId: number,
|
|
182
|
+
liveOddsProviders: any,
|
|
183
|
+
defaultSpreadForLiveMarkets: any,
|
|
184
|
+
leagueMap: any
|
|
185
|
+
) => ChildMarket[] = (
|
|
179
186
|
apiResponseWithOdds,
|
|
180
187
|
spreadDataForSport,
|
|
181
188
|
leagueId,
|
|
@@ -183,7 +190,7 @@ export const createChildMarkets = (
|
|
|
183
190
|
defaultSpreadForLiveMarkets,
|
|
184
191
|
leagueMap
|
|
185
192
|
) => {
|
|
186
|
-
const [spreadOdds, totalOdds, childMarkets] = [[], [], []];
|
|
193
|
+
const [spreadOdds, totalOdds, childMarkets]: any[] = [[], [], []];
|
|
187
194
|
const leagueInfo = getLeagueInfo(leagueId, leagueMap);
|
|
188
195
|
const commonData = {
|
|
189
196
|
homeTeam: apiResponseWithOdds.home_team,
|
|
@@ -375,7 +382,7 @@ export const groupAndFormatTotalOdds = (oddsArray, commonData) => {
|
|
|
375
382
|
};
|
|
376
383
|
|
|
377
384
|
export const adjustSpreadOnChildOdds = (iterableGroupedOdds, spreadDataForSport, defaultSpreadForLiveMarkets) => {
|
|
378
|
-
const result = [];
|
|
385
|
+
const result: any[] = [];
|
|
379
386
|
iterableGroupedOdds.forEach((data) => {
|
|
380
387
|
let homeTeamOdds = convertOddsToImpl(data.odds[0]) || ZERO;
|
|
381
388
|
let awayTeamOdds = convertOddsToImpl(data.odds[1]) || ZERO;
|