@levrbet/shared 0.2.20 → 0.2.22

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.
@@ -1,4 +1,5 @@
1
1
  import { GamePhase, MarketStatus, MarketTypes, Prisma } from "../../../../core/prisma";
2
+ import { LevrMarketId } from "../../../contracts";
2
3
  import { Bytes16, Bytes32 } from "../../../validators";
3
4
  import { LevrChain } from "../../blockchain";
4
5
  import { type OddsData, type PriceData } from "./odds.types";
@@ -58,14 +59,16 @@ export declare enum FullTimeWinnerTokenIds {
58
59
  Draw = 3
59
60
  }
60
61
  export interface MarketRiskAllocationData {
62
+ levrMarketId: LevrMarketId;
61
63
  asset: string;
62
64
  boundedLossA: number;
63
65
  boundedLossB: number;
64
- boundedLossC: number;
66
+ boundedLossC?: number;
65
67
  nFactor: number;
66
68
  odds: number[];
67
69
  targetScore?: number;
68
70
  sideGroup?: number;
71
+ primaryProvider: string;
69
72
  }
70
73
  /**
71
74
  * Constants representing bit flags for each side
@@ -1 +1 @@
1
- {"version":3,"file":"markets.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/market/markets.types.ts"],"names":[],"mappings":";;;AAEA,iDAAkD;AA4DlD,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAC9B,mEAAQ,CAAA;IACR,yEAAW,CAAA;IACX,mEAAQ,CAAA;AACZ,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC;AAaD;;;;;;;;;GASG;AACU,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,YAAY,GAAG,CAAC,IAAI,iBAAI,CAAC,OAAO,CAAA,CAAC,iBAAiB;AAClD,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,kBAAkB;AAC7C,QAAA,UAAU,GAAG,CAAC,IAAI,iBAAI,CAAC,KAAK,CAAA,CAAC,kBAAkB;AAE5D;;;;;GAKG;AACU,QAAA,aAAa,GAAG,iBAAS,GAAG,oBAAY,GAAG,iBAAS,CAAA,CAAC,kBAAkB;AACvE,QAAA,WAAW,GAAG,iBAAS,GAAG,kBAAU,CAAA,CAAC,kBAAkB"}
1
+ {"version":3,"file":"markets.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/market/markets.types.ts"],"names":[],"mappings":";;;AAGA,iDAAkD;AA4DlD,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAC9B,mEAAQ,CAAA;IACR,yEAAW,CAAA;IACX,mEAAQ,CAAA;AACZ,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC;AAeD;;;;;;;;;GASG;AACU,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,YAAY,GAAG,CAAC,IAAI,iBAAI,CAAC,OAAO,CAAA,CAAC,iBAAiB;AAClD,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,iBAAiB;AAC5C,QAAA,SAAS,GAAG,CAAC,IAAI,iBAAI,CAAC,IAAI,CAAA,CAAC,kBAAkB;AAC7C,QAAA,UAAU,GAAG,CAAC,IAAI,iBAAI,CAAC,KAAK,CAAA,CAAC,kBAAkB;AAE5D;;;;;GAKG;AACU,QAAA,aAAa,GAAG,iBAAS,GAAG,oBAAY,GAAG,iBAAS,CAAA,CAAC,kBAAkB;AACvE,QAAA,WAAW,GAAG,iBAAS,GAAG,kBAAU,CAAA,CAAC,kBAAkB"}
@@ -1,33 +1,31 @@
1
1
  import { z } from "zod";
2
2
  import { LevrMarketId } from "../../../contracts";
3
+ import { OddsServices } from "../market";
3
4
  export declare const MarketRiskAllocationSchema: z.ZodObject<{
5
+ levrMarketId: z.ZodEnum<typeof LevrMarketId>;
4
6
  asset: z.ZodString;
5
7
  boundedLossA: z.ZodNumber;
6
8
  boundedLossB: z.ZodNumber;
7
- boundedLossC: z.ZodNumber;
9
+ boundedLossC: z.ZodOptional<z.ZodNumber>;
8
10
  nFactor: z.ZodNumber;
9
11
  odds: z.ZodArray<z.ZodNumber>;
10
12
  targetScore: z.ZodOptional<z.ZodNumber>;
11
- sideGroup: z.ZodOptional<z.ZodNumber>;
13
+ primaryProvider: z.ZodEnum<typeof OddsServices>;
12
14
  }, z.core.$strip>;
13
15
  export declare const CreateMarketSchema: z.ZodObject<{
14
16
  chainId: z.ZodNumber;
15
17
  gameId: z.ZodNumber;
16
- levrMarketIds: z.ZodArray<z.ZodEnum<typeof LevrMarketId>>;
17
- normalizationFactor: z.ZodNumber;
18
- marketDetails: z.ZodObject<{}, z.core.$strip>;
19
18
  marketRiskAllocations: z.ZodArray<z.ZodObject<{
19
+ levrMarketId: z.ZodEnum<typeof LevrMarketId>;
20
20
  asset: z.ZodString;
21
21
  boundedLossA: z.ZodNumber;
22
22
  boundedLossB: z.ZodNumber;
23
- boundedLossC: z.ZodNumber;
23
+ boundedLossC: z.ZodOptional<z.ZodNumber>;
24
24
  nFactor: z.ZodNumber;
25
25
  odds: z.ZodArray<z.ZodNumber>;
26
26
  targetScore: z.ZodOptional<z.ZodNumber>;
27
- sideGroup: z.ZodOptional<z.ZodNumber>;
27
+ primaryProvider: z.ZodEnum<typeof OddsServices>;
28
28
  }, z.core.$strip>>;
29
- providers: z.ZodObject<{}, z.core.$strip>;
30
- activeProvider: z.ZodObject<{}, z.core.$strip>;
31
29
  levrGameObjectId: z.ZodString;
32
30
  }, z.core.$strip>;
33
31
  export type CreateMarketRequest = z.infer<typeof CreateMarketSchema>;
@@ -4,25 +4,22 @@ exports.ProviderDetailsArraySchema = exports.ProviderDetailsSchema = exports.Cre
4
4
  const zod_1 = require("zod");
5
5
  const contracts_1 = require("../../../contracts");
6
6
  const validators_1 = require("../../../validators");
7
+ const market_1 = require("../market");
7
8
  exports.MarketRiskAllocationSchema = zod_1.z.object({
9
+ levrMarketId: zod_1.z.enum(contracts_1.LevrMarketId),
8
10
  asset: zod_1.z.string(), // Address is a string alias
9
11
  boundedLossA: zod_1.z.number(),
10
12
  boundedLossB: zod_1.z.number(),
11
- boundedLossC: zod_1.z.number(),
13
+ boundedLossC: zod_1.z.number().optional(),
12
14
  nFactor: zod_1.z.number(),
13
15
  odds: zod_1.z.array(zod_1.z.number()), // Array of numbers for odds
14
16
  targetScore: zod_1.z.number().optional(), // Optional target score
15
- sideGroup: zod_1.z.number().optional(), // Optional side group...
17
+ primaryProvider: zod_1.z.enum(market_1.OddsServices),
16
18
  });
17
19
  exports.CreateMarketSchema = zod_1.z.object({
18
20
  chainId: zod_1.z.number(),
19
21
  gameId: zod_1.z.number(),
20
- levrMarketIds: zod_1.z.array(zod_1.z.enum(contracts_1.LevrMarketId)).min(1),
21
- normalizationFactor: zod_1.z.number(),
22
- marketDetails: zod_1.z.object({}), // details as needed
23
22
  marketRiskAllocations: zod_1.z.array(exports.MarketRiskAllocationSchema).min(1),
24
- providers: zod_1.z.object({}), // providers as needed
25
- activeProvider: zod_1.z.object({}), // active provider as needed
26
23
  levrGameObjectId: validators_1.objectIdSchema,
27
24
  });
28
25
  exports.ProviderDetailsSchema = zod_1.z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"market.request.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/requests/market.request.types.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,kDAAiD;AACjD,oDAAoD;AAEvC,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,4BAA4B;IAC/C,YAAY,EAAE,OAAC,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,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAA;AAEW,QAAA,0BAA0B,GAAG,OAAC,CAAC,KAAK,CAAC,6BAAqB,CAAC,CAAA"}
1
+ {"version":3,"file":"market.request.types.js","sourceRoot":"","sources":["../../../../../src/core/types/oracle/requests/market.request.types.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,kDAAiD;AACjD,oDAAoD;AACpD,sCAAwC;AAE3B,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,YAAY,EAAE,OAAC,CAAC,IAAI,CAAC,wBAAY,CAAC;IAClC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,4BAA4B;IAC/C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;IACxB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,EAAE,4BAA4B;IACvD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,wBAAwB;IAC5D,eAAe,EAAE,OAAC,CAAC,IAAI,CAAC,qBAAY,CAAC;CACxC,CAAC,CAAA;AACW,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,qBAAqB,EAAE,OAAC,CAAC,KAAK,CAAC,kCAA0B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,gBAAgB,EAAE,2BAAc;CACnC,CAAC,CAAA;AAIW,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,UAAU,EAAE,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