@azuro-org/toolkit 2.0.0 → 4.0.0

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.
Files changed (66) hide show
  1. package/.eslintrc +166 -0
  2. package/README.md +7 -110
  3. package/codegen.ts +62 -0
  4. package/dist/abis/FreeBet.d.ts +426 -0
  5. package/dist/abis/LP.d.ts +1469 -0
  6. package/dist/abis/LiveCore.d.ts +694 -0
  7. package/dist/abis/PrematchComboCore.d.ts +740 -0
  8. package/dist/abis/PrematchCore.d.ts +819 -0
  9. package/dist/abis/ProxyFront.d.ts +137 -0
  10. package/dist/abis/index.d.ts +6 -0
  11. package/dist/config.d.ts +51 -0
  12. package/dist/docs/index.d.ts +22 -0
  13. package/dist/docs/live/condition.d.ts +28 -0
  14. package/dist/docs/live/conditions.d.ts +29 -0
  15. package/dist/docs/live/fragments/condition.d.ts +20 -0
  16. package/dist/docs/live/types.d.ts +1902 -0
  17. package/dist/docs/prematch/bettors.d.ts +21 -0
  18. package/dist/docs/prematch/condition.d.ts +38 -0
  19. package/dist/docs/prematch/conditions.d.ts +39 -0
  20. package/dist/docs/prematch/conditionsBatch.d.ts +22 -0
  21. package/dist/docs/prematch/fragments/bettor.d.ts +12 -0
  22. package/dist/docs/prematch/fragments/condition.d.ts +30 -0
  23. package/dist/docs/prematch/fragments/liveBet.d.ts +42 -0
  24. package/dist/docs/prematch/fragments/mainGameInfo.d.ts +31 -0
  25. package/dist/docs/prematch/fragments/prematchBet.d.ts +75 -0
  26. package/dist/docs/prematch/game.d.ts +39 -0
  27. package/dist/docs/prematch/gameBets.d.ts +54 -0
  28. package/dist/docs/prematch/games.d.ts +43 -0
  29. package/dist/docs/prematch/liveBets.d.ts +54 -0
  30. package/dist/docs/prematch/navigation.d.ts +34 -0
  31. package/dist/docs/prematch/prematchBets.d.ts +87 -0
  32. package/dist/docs/prematch/sports.d.ts +63 -0
  33. package/dist/docs/prematch/sportsNavigation.d.ts +22 -0
  34. package/dist/docs/prematch/types.d.ts +6307 -0
  35. package/dist/global.d.ts +6 -0
  36. package/dist/helpers/formatToFixed.d.ts +1 -0
  37. package/dist/index.d.ts +24 -1
  38. package/dist/index.js +5705 -0
  39. package/dist/utils/calcMindOdds.d.ts +6 -0
  40. package/dist/utils/calcOdds.d.ts +28 -0
  41. package/dist/utils/deBridge/createDeBridgeBet.d.ts +65 -0
  42. package/dist/utils/deBridge/getDeBridgeOrder.d.ts +39 -0
  43. package/dist/utils/deBridge/getDeBridgeSupportedChains.d.ts +4 -0
  44. package/dist/utils/deBridge/getDeBridgeSupportedTokens.d.ts +8 -0
  45. package/dist/utils/getBetStatus.d.ts +17 -0
  46. package/dist/utils/getEndpoints.d.ts +5 -0
  47. package/dist/utils/getFreebets.d.ts +35 -0
  48. package/dist/utils/getGameStatus.d.ts +16 -0
  49. package/dist/utils/getLiveBetFee.d.ts +14 -0
  50. package/dist/utils/getPrematchBetDataBytes.d.ts +3 -0
  51. package/dist/utils/groupByConditionId.d.ts +5 -0
  52. package/dist/utils/groupConditionsByMarket.d.ts +23 -0
  53. package/dist/utils/setupContracts.d.ts +37 -0
  54. package/dist/utils/wave/activateWave.d.ts +10 -0
  55. package/dist/utils/wave/getWaveLeaderBoard.d.ts +22 -0
  56. package/dist/utils/wave/getWaveLevels.d.ts +26 -0
  57. package/dist/utils/wave/getWavePeriods.d.ts +18 -0
  58. package/dist/utils/wave/getWaveStats.d.ts +30 -0
  59. package/graphql.config.yml +21 -0
  60. package/package.json +24 -8
  61. package/tsconfig.json +25 -10
  62. package/dist/aggregateOutcomesByMarkets.d.ts +0 -27
  63. package/dist/index.es.js +0 -109
  64. package/lib/aggregateOutcomesByMarkets.d.ts +0 -27
  65. package/lib/index.d.ts +0 -1
  66. package/lib/index.js +0 -109
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ odds: number | number[];
3
+ slippage: number;
4
+ };
5
+ export declare const calcMindOdds: (props: Props) => string;
6
+ export {};
@@ -0,0 +1,28 @@
1
+ import { type Config } from '@wagmi/core';
2
+ import { type ChainId } from '../config';
3
+ import { type Selection } from '../global';
4
+ type OddsData = {
5
+ conditionId: string;
6
+ margin: number;
7
+ reinforcement: number;
8
+ winningOutcomesCount: number;
9
+ outcomes: Record<string, {
10
+ odds: number;
11
+ clearOdds: number;
12
+ }>;
13
+ };
14
+ type CalcLiveOddsProps = {
15
+ selection: Selection;
16
+ oddsData: OddsData;
17
+ betAmount?: string;
18
+ };
19
+ export declare const calcLiveOdds: ({ selection, betAmount, oddsData }: CalcLiveOddsProps) => number;
20
+ type CalcPrematchOddsProps = {
21
+ config: Config;
22
+ selections: Selection[];
23
+ chainId: ChainId;
24
+ betAmount?: string;
25
+ batchBetAmounts?: Record<string, string>;
26
+ };
27
+ export declare const calcPrematchOdds: (props: CalcPrematchOddsProps) => Promise<Record<string, number>>;
28
+ export {};
@@ -0,0 +1,65 @@
1
+ import { type Address, type Hex } from 'viem';
2
+ import { type Selection } from '../../global';
3
+ import { type ChainId } from '../../config';
4
+ export type DeBridgeCreateTxResponse = {
5
+ orderId: Hex;
6
+ estimation: {
7
+ srcChainTokenIn: {
8
+ address: Address;
9
+ name: string;
10
+ symbol: string;
11
+ decimals: number;
12
+ amount: string;
13
+ approximateOperatingExpense: string;
14
+ mutatedWithOperatingExpense: boolean;
15
+ };
16
+ srcChainTokenOut: {
17
+ address: Address;
18
+ name: string;
19
+ symbol: string;
20
+ decimals: number;
21
+ amount: string;
22
+ maxRefundAmount: string;
23
+ };
24
+ dstChainTokenOut: {
25
+ address: Address;
26
+ name: string;
27
+ symbol: string;
28
+ decimals: number;
29
+ amount: string;
30
+ recommendedAmount: string;
31
+ withoutAdditionalTakerRewardsAmount: string;
32
+ maxTheoreticalAmount: string;
33
+ };
34
+ recommendedSlippage: number;
35
+ costsDetails: [string];
36
+ };
37
+ tx: {
38
+ to: Address;
39
+ data: Hex;
40
+ value: bigint;
41
+ };
42
+ order: {
43
+ approximateFulfillmentDelay: number;
44
+ };
45
+ prependedOperatingExpenseCost: string;
46
+ fixFee: string;
47
+ userPoints: number;
48
+ integratorPoints: number;
49
+ };
50
+ type Props = {
51
+ account: Address;
52
+ betAmount: string;
53
+ dstChainId: ChainId;
54
+ srcChainId: number;
55
+ srcChainTokenIn: string;
56
+ selections: Selection[];
57
+ totalOdds: number;
58
+ slippage: number;
59
+ affiliate: Address;
60
+ referralCode: number;
61
+ deadline?: number;
62
+ };
63
+ export declare const DE_BRIDGE_DEFAULT_DEADLINE = 300;
64
+ export declare const createDeBridgeBet: (props: Props) => Promise<DeBridgeCreateTxResponse | null>;
65
+ export {};
@@ -0,0 +1,39 @@
1
+ import { type Hex } from 'viem';
2
+ export declare enum DeBridgeOrderStatus {
3
+ None = "None",
4
+ Created = "Created",
5
+ Fulfilled = "Fulfilled",
6
+ SentUnlock = "SentUnlock",
7
+ OrderCancelled = "OrderCancelled",
8
+ SentOrderCancel = "SentOrderCancel",
9
+ ClaimedUnlock = "ClaimedUnlock",
10
+ ClaimedOrderCancel = "ClaimedOrderCancel"
11
+ }
12
+ export declare enum DeBridgeExternalCallStatus {
13
+ NoExtCall = "NoExtCall",
14
+ AwaitingOrderFulfillment = "AwaitingOrderFulfillment",
15
+ AwaitingExecution = "AwaitingExecution",
16
+ Executing = "Executing",
17
+ Completed = "Completed",
18
+ Failed = "Failed",
19
+ Cancelled = "Cancelled"
20
+ }
21
+ type OrderStatusResponse = {
22
+ orderId: {
23
+ stringValue: Hex;
24
+ };
25
+ fulfilledDstEventMetadata: {
26
+ transactionHash: {
27
+ stringValue: Hex;
28
+ };
29
+ } | null;
30
+ state: DeBridgeOrderStatus;
31
+ externalCallState: DeBridgeExternalCallStatus;
32
+ takeOfferWithMetadata: {
33
+ chainId: {
34
+ bigIntegerValue: number;
35
+ };
36
+ };
37
+ };
38
+ export declare const getDeBridgeOrder: (orderId: Hex) => Promise<OrderStatusResponse | null>;
39
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const getDeBridgeSupportedChains: () => Promise<{
2
+ chainId: number;
3
+ chainName: string;
4
+ }[] | null>;
@@ -0,0 +1,8 @@
1
+ export declare const getDeBridgeSupportedTokens: (chainId: number) => Promise<Record<string, {
2
+ address: string;
3
+ symbol: string;
4
+ decimals: number;
5
+ name: string;
6
+ logoURI: string;
7
+ tags: Array<string>;
8
+ }> | null>;
@@ -0,0 +1,17 @@
1
+ import { BetStatus as GraphBetStatus } from '../docs/prematch/types';
2
+ import { type GameQuery } from '../docs/prematch/game';
3
+ export declare enum BetStatus {
4
+ Accepted = 0,
5
+ Live = 1,
6
+ PendingResolution = 2,
7
+ Resolved = 3,
8
+ Canceled = 4
9
+ }
10
+ type Game = Pick<GameQuery['games'][0], 'status' | 'startsAt'>;
11
+ type Props = {
12
+ games: Game[];
13
+ graphStatus: GraphBetStatus;
14
+ isLiveBet: boolean;
15
+ };
16
+ export declare const getBetStatus: (props: Props) => BetStatus;
17
+ export {};
@@ -0,0 +1,5 @@
1
+ import { type ChainId } from '../config';
2
+ export declare const getPrematchGraphqlEndpoint: (chainId: ChainId) => string;
3
+ export declare const getLiveGraphqlEndpoint: (chainId: ChainId) => "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed-preprod" | "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed-dev" | "https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed";
4
+ export declare const getSocketEndpoint: (chainId: ChainId) => "wss://preprod-streams.azuro.org/v1/streams/conditions" | "wss://dev-streams.azuro.org/v1/streams/conditions" | "wss://streams.azuro.org/v1/streams/conditions";
5
+ export declare const getApiEndpoint: (chainId: ChainId) => "https://preprod-api.azuro.org/api/v1/public" | "https://dev-api.azuro.org/api/v1/public" | "https://api.azuro.org/api/v1/public";
@@ -0,0 +1,35 @@
1
+ import { type Hex, type Address } from 'viem';
2
+ import { type ChainId } from '../config';
3
+ export declare enum FreeBetStatus {
4
+ New = "New",
5
+ Claimed = "Claimed",
6
+ Redeemed = "Redeemed",
7
+ Canceled = "Canceled",
8
+ Reissued = "Reissued",
9
+ Withdrawn = "Withdrawn"
10
+ }
11
+ export type FreeBet = {
12
+ id: number;
13
+ owner: Address;
14
+ amount: string;
15
+ minOdds: string;
16
+ contractId: number;
17
+ signature: Hex;
18
+ expiresAt: number;
19
+ campaign: string;
20
+ status: FreeBetStatus;
21
+ contract: {
22
+ id: number;
23
+ affiliate: Address;
24
+ chainId: string;
25
+ freebetContractAddress: Address;
26
+ decimals: number;
27
+ };
28
+ };
29
+ type Props = {
30
+ chainId: ChainId;
31
+ account: Address;
32
+ affiliate: Address;
33
+ };
34
+ export declare const getFreeBets: ({ chainId, account, affiliate }: Props) => Promise<FreeBet[] | null>;
35
+ export {};
@@ -0,0 +1,16 @@
1
+ import { GameStatus as GraphGameStatus } from '../docs/live/types';
2
+ export declare enum GameStatus {
3
+ Created = 0,
4
+ Live = 1,
5
+ Resolved = 2,
6
+ Canceled = 3,
7
+ Paused = 4,
8
+ PendingResolution = 5
9
+ }
10
+ type Props = {
11
+ graphStatus: GraphGameStatus;
12
+ startsAt: number;
13
+ isGameInLive: boolean;
14
+ };
15
+ export declare const getGameStatus: (props: Props) => GameStatus;
16
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type ChainId } from '../config';
2
+ export type LiveBetFeeResponse = {
3
+ gasLimit: number;
4
+ gasPrice: number;
5
+ betTokenRate: number;
6
+ gasPriceInBetToken: number;
7
+ slippage: number;
8
+ gasAmount: number;
9
+ relayerFeeAmount: string;
10
+ beautyRelayerFeeAmount: string;
11
+ symbol: string;
12
+ decimals: number;
13
+ };
14
+ export declare const getLiveBetFee: (chainId: ChainId) => Promise<LiveBetFeeResponse>;
@@ -0,0 +1,3 @@
1
+ import { type Hex } from 'viem';
2
+ import { type Selection } from '../global';
3
+ export declare const getPrematchBetDataBytes: (selections: Selection[]) => Hex;
@@ -0,0 +1,5 @@
1
+ type Condition = {
2
+ conditionId: string;
3
+ };
4
+ export declare const groupByConditionId: <T extends Condition>(data: T[]) => Record<string, T[]>;
5
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { ConditionStatus } from '../docs/prematch/types';
2
+ import { type PrematchConditionsQuery } from '../docs/prematch/conditions';
3
+ import { type LiveConditionsQuery } from '../docs/live/conditions';
4
+ import type { Selection } from '../global';
5
+ export type ConditionsQuery = PrematchConditionsQuery | LiveConditionsQuery;
6
+ export type MarketOutcome = {
7
+ selectionName: string;
8
+ odds?: number;
9
+ lpAddress: string;
10
+ coreAddress: string;
11
+ status: ConditionStatus;
12
+ gameId: string;
13
+ isExpressForbidden: boolean;
14
+ isWon?: boolean;
15
+ } & Selection;
16
+ export type Market = {
17
+ marketKey: string;
18
+ name: string;
19
+ description: string;
20
+ outcomeRows: MarketOutcome[][];
21
+ };
22
+ export type GameMarkets = Market[];
23
+ export declare const groupConditionsByMarket: (conditions: ConditionsQuery["conditions"]) => GameMarkets;
@@ -0,0 +1,37 @@
1
+ import { type Address } from 'viem';
2
+ import { liveCoreAbi, lpAbi, prematchComboCoreAbi, prematchCoreAbi, proxyFrontAbi } from '../abis';
3
+ export type Contracts = {
4
+ lp: {
5
+ address: Address;
6
+ abi: typeof lpAbi;
7
+ };
8
+ prematchCore: {
9
+ address: Address;
10
+ abi: typeof prematchCoreAbi;
11
+ };
12
+ prematchComboCore: {
13
+ address: Address;
14
+ abi: typeof prematchComboCoreAbi;
15
+ };
16
+ proxyFront: {
17
+ address: Address;
18
+ abi: typeof proxyFrontAbi;
19
+ };
20
+ liveRelayer?: {
21
+ address: Address;
22
+ };
23
+ liveCore?: {
24
+ address: Address;
25
+ abi: typeof liveCoreAbi;
26
+ };
27
+ };
28
+ type Props = {
29
+ lp: Address;
30
+ prematchCore: Address;
31
+ prematchComboCore: Address;
32
+ proxyFront: Address;
33
+ liveRelayer?: Address;
34
+ liveCore?: Address;
35
+ };
36
+ export declare const setupContracts: ({ lp, prematchCore, prematchComboCore, proxyFront, liveRelayer, liveCore }: Props) => Contracts;
37
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type Address } from 'viem';
2
+ import { type ChainId } from '../../config';
3
+ import { type WaveId } from '../../global';
4
+ type Props = {
5
+ account: Address;
6
+ waveId?: WaveId;
7
+ chainId?: ChainId;
8
+ };
9
+ export declare const activateWave: ({ account, waveId, chainId }: Props) => Promise<void>;
10
+ export {};
@@ -0,0 +1,22 @@
1
+ import { type Address } from 'viem';
2
+ import { type ChainId } from '../../config';
3
+ import { type WaveId } from '../../global';
4
+ import { type WaveLevelData } from './getWaveLevels';
5
+ export type WaveLeaderBoardItem = {
6
+ position: number;
7
+ address: Address;
8
+ points: string;
9
+ bonusPoints: string | null;
10
+ totalMultipliedPoints: string;
11
+ bonusMultiplier: number | null;
12
+ level: number | null;
13
+ levelDescription: WaveLevelData | null;
14
+ };
15
+ type Props = {
16
+ waveId?: WaveId;
17
+ account?: Address;
18
+ startsAt?: number;
19
+ chainId?: ChainId;
20
+ };
21
+ export declare const getWaveLeaderBoard: (props?: Props) => Promise<WaveLeaderBoardItem[] | null>;
22
+ export {};
@@ -0,0 +1,26 @@
1
+ import { type ChainId } from '../../config';
2
+ import { type WaveId } from '../../global';
3
+ export declare enum WaveLevelName {
4
+ Grey = "Grey",
5
+ Mist = "Mist",
6
+ Sky = "Sky",
7
+ Blue = "Blue",
8
+ Ultramarine = "Ultramarine",
9
+ Bright = "Bright",
10
+ Brilliant = "Brilliant",
11
+ Royal = "Royal"
12
+ }
13
+ export type WaveLevelData = {
14
+ level: number;
15
+ name: WaveLevelName;
16
+ boost: string;
17
+ pointsNeeded: string;
18
+ comment: string;
19
+ };
20
+ export type WaveLevelsResponse = WaveLevelData[];
21
+ type Props = {
22
+ waveId?: WaveId;
23
+ chainId?: ChainId;
24
+ };
25
+ export declare const getWaveLevels: ({ waveId, chainId }?: Props) => Promise<WaveLevelData[] | null>;
26
+ export {};
@@ -0,0 +1,18 @@
1
+ import { type ChainId } from '../../config';
2
+ import { type WaveId } from '../../global';
3
+ type Period = {
4
+ id: number;
5
+ /** ISO String "2024-05-13T00:00:00.000Z" */
6
+ startsAt: string;
7
+ /** ISO String "2024-05-20T00:00:00.000Z". It's a startsAt of next period */
8
+ endsAt: string;
9
+ totalPoints: string;
10
+ waveId: number;
11
+ };
12
+ export type WavePeriodsResponse = Period[];
13
+ type Props = {
14
+ waveId?: WaveId;
15
+ chainId?: ChainId;
16
+ };
17
+ export declare const getWavePeriods: ({ waveId, chainId }?: Props) => Promise<WavePeriodsResponse | null>;
18
+ export {};
@@ -0,0 +1,30 @@
1
+ import { type Address } from 'viem';
2
+ import { type ChainId } from '../../config';
3
+ import { type WaveId } from '../../global';
4
+ import { type WaveLevelData } from './getWaveLevels';
5
+ export type WaveStatsResponse = {
6
+ address: Address;
7
+ waveId: number;
8
+ levelActivated: boolean;
9
+ initialLevel: number;
10
+ level: number;
11
+ betPoints: string;
12
+ dexPoints: string;
13
+ liqudityPoints: string;
14
+ stakingPoints: string;
15
+ leaderboardPoints: string;
16
+ manualPoints: string;
17
+ /** "2.100000", final points without level multiplier */
18
+ points: string;
19
+ /** "2.100000", final points with level multiplier ('boost') */
20
+ multipliedPoints: string;
21
+ sharePercent: string;
22
+ levelDescription: WaveLevelData;
23
+ };
24
+ type Props = {
25
+ account: Address;
26
+ waveId?: WaveId;
27
+ chainId?: ChainId;
28
+ };
29
+ export declare const getWaveStats: ({ account, waveId, chainId }: Props) => Promise<WaveStatsResponse | null>;
30
+ export {};
@@ -0,0 +1,21 @@
1
+ projects:
2
+ protocol-dev:
3
+ schema: protocol.schema.graphql
4
+ include: src/docs/prematch/**/*.graphql
5
+ extensions:
6
+ endpoints:
7
+ Protocol:
8
+ url: https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-mumbai-dev-v3
9
+ headers:
10
+ user-agent: JS GraphQL
11
+ introspect: false
12
+ live-dev:
13
+ schema: live.schema.graphql
14
+ include: src/docs/live/**/*.graphql
15
+ extensions:
16
+ endpoints:
17
+ Protocol:
18
+ url: https://thegraph.azuro.org/subgraphs/name/azuro-protocol/azuro-api-live-data-feed-preprod
19
+ headers:
20
+ user-agent: JS GraphQL
21
+ introspect: false
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@azuro-org/toolkit",
3
- "version": "2.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Set of helpers to work with Azuro protocol",
5
- "module": "dist/index.es.js",
6
- "main": "lib/index.js",
7
- "types": "lib/index.d.ts",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
8
7
  "scripts": {
8
+ "gql:cleanup": "rimraf src/docs/**/*.ts src/docs/**/**/*.ts",
9
+ "gql": "npm run gql:cleanup & graphql-codegen",
9
10
  "dev": "rollup -cw",
10
- "build": "rimraf ./dist && rimraf ./lib && rollup -c --compact",
11
- "prepublishOnly": "npm run build"
11
+ "build": "rimraf ./dist && npm run gql && rollup -c --compact",
12
+ "prepublishOnly": "npm run build",
13
+ "------------------ Lint --------------------------------------------------------------------------------": "",
14
+ "lint": "next lint && tsc --noEmit",
15
+ "lint-fix": "eslint ./src -c .eslintrc --fix --ext js,ts,tsx",
16
+ "lint-ts": "tsc --noEmit"
12
17
  },
13
18
  "keywords": [
14
19
  "azuro",
@@ -27,9 +32,20 @@
27
32
  },
28
33
  "homepage": "https://github.com/Azuro-protocol/toolkit#readme",
29
34
  "peerDependencies": {
30
- "@azuro-org/dictionaries": "^2.0.2"
35
+ "@apollo/client": "^3.10.8",
36
+ "@azuro-org/dictionaries": "^3.0.12",
37
+ "viem": "^2.17.3",
38
+ "@wagmi/core": "^2.11.7"
31
39
  },
32
40
  "devDependencies": {
41
+ "@graphql-codegen/cli": "^4.0.1",
42
+ "@graphql-codegen/client-preset": "^4.0.0",
43
+ "@graphql-codegen/near-operation-file-preset": "^2.5.0",
44
+ "@graphql-codegen/typescript-react-apollo": "^3.3.7",
45
+ "@typescript-eslint/eslint-plugin": "^6.19.1",
46
+ "eslint": "^8.56.0",
47
+ "eslint-import-resolver-typescript": "^3.6.1",
48
+ "eslint-plugin-import": "^2.29.1",
33
49
  "@babel/core": "^7.17.0",
34
50
  "@rollup/plugin-babel": "^6.0.3",
35
51
  "@rollup/plugin-commonjs": "^23.0.3",
@@ -42,6 +58,6 @@
42
58
  "rollup-plugin-babel": "^4.4.0",
43
59
  "rollup-plugin-typescript2": "^0.34.1",
44
60
  "tslib": "^2.4.1",
45
- "typescript": "^4.6.2"
61
+ "typescript": "^5.1.6"
46
62
  }
47
63
  }
package/tsconfig.json CHANGED
@@ -1,19 +1,34 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es5",
3
+ "baseUrl": ".",
4
+ "allowJs": true,
5
+ "downlevelIteration": true,
6
+ "esModuleInterop": true,
7
+ "isolatedModules": true,
8
+ "jsx": "react-jsx",
9
+ "lib": ["es2021", "dom"],
4
10
  "module": "esnext",
5
11
  "moduleResolution": "node",
6
- "lib": [ "es2017", "es7", "es6", "dom" ],
7
- "outDir": "lib",
8
- "jsx": "react",
9
- "strict": true,
10
12
  "declaration": true,
11
- "declarationDir": ".",
12
- "esModuleInterop": true
13
+ "declarationDir": "dist",
14
+ "noEmit": true,
15
+ "noImplicitAny": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "noUnusedParameters": false,
18
+ "noImplicitReturns": false,
19
+ "resolveJsonModule": true,
20
+ "skipLibCheck": true,
21
+ "strict": true,
22
+ "strictNullChecks": true,
23
+ "target": "es2021",
24
+ "types": ["node"]
13
25
  },
14
26
  "exclude": [
15
- "node_modules",
16
- "dist",
17
- "lib"
27
+ "**/node_modules/**",
28
+ "**/dist/**"
29
+ ],
30
+ "include": [
31
+ "src/**/*.ts",
32
+ "src/**/*.tsx"
18
33
  ]
19
34
  }
@@ -1,27 +0,0 @@
1
- import { type Dictionaries } from '@azuro-org/dictionaries';
2
- type Outcome<T> = T & {
3
- conditionId: string;
4
- outcomeId: string;
5
- selectionName: string;
6
- lpAddress: string;
7
- coreAddress: string;
8
- };
9
- type FinalMarket<T> = {
10
- marketName: string;
11
- outcomes: Outcome<T>[][];
12
- };
13
- type Props = {
14
- lpAddress: string;
15
- conditions: {
16
- [key: string]: any;
17
- conditionId: string;
18
- coreAddress: string;
19
- outcomes: {
20
- [key: string]: any;
21
- outcomeId: string;
22
- }[];
23
- }[];
24
- dictionaries: Dictionaries;
25
- };
26
- export default function aggregateOutcomesByMarkets<T extends {}>(props: Props): FinalMarket<T>[];
27
- export {};