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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overtime-live-trading-utils",
3
- "version": "0.0.136",
3
+ "version": "0.0.138",
4
4
  "description": "",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -5,3 +5,11 @@ export type LeagueInfo = {
5
5
  type: string;
6
6
  enabled: string;
7
7
  };
8
+
9
+ export type ChildMarket = {
10
+ leagueId: number;
11
+ typeId: number;
12
+ type: string;
13
+ line: number;
14
+ odds: Array<number>;
15
+ };
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] = [[], [], []]; // placeholders for
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;