overtime-live-trading-utils 4.0.0-rc.1 → 4.0.0-rc.3

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": "4.0.0-rc.1",
3
+ "version": "4.0.0-rc.3",
4
4
  "description": "",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -17,6 +17,12 @@ export type ChildMarket = {
17
17
  type: string;
18
18
  line: number;
19
19
  odds: Array<number>;
20
+ playerProps: {
21
+ playerId: number;
22
+ playerName: string;
23
+ };
24
+ isPlayerPropsMarket: boolean;
25
+ positionNames?: string[];
20
26
  };
21
27
 
22
28
  export type LastPolledArray = { sportsbook: string; timestamp: number }[];
package/src/utils/odds.ts CHANGED
@@ -474,12 +474,12 @@ export const groupAndFormatTotalOdds = (oddsArray: any[], commonData: HomeAwayTe
474
474
 
475
475
  // if we have away team in total odds we know the market is team total and we need to increase typeId by one.
476
476
  // if this is false typeId is already mapped correctly
477
- const isAwayTeam = selection === commonData.awayTeam;
477
+ const shouldIncreaseTypeId = selection === commonData.awayTeam && !(value as any).playerProps;
478
478
  if ((value as any).over !== null && (value as any).under !== null) {
479
479
  acc.push({
480
480
  line: line as any,
481
481
  odds: [(value as any).over, (value as any).under],
482
- typeId: !isAwayTeam ? (value as any).typeId : Number((value as any).typeId) + 1,
482
+ typeId: !shouldIncreaseTypeId ? (value as any).typeId : Number((value as any).typeId) + 1,
483
483
  sportId: (value as any).sportId,
484
484
  type: (value as any).type,
485
485
  playerProps: (value as any).playerProps,