@azuro-org/toolkit 3.0.0 → 4.1.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 +40 -0
  19. package/dist/docs/prematch/conditions.d.ts +41 -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 +32 -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 +5709 -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 -25
  63. package/dist/index.es.js +0 -109
  64. package/lib/aggregateOutcomesByMarkets.d.ts +0 -25
  65. package/lib/index.d.ts +0 -1
  66. package/lib/index.js +0 -109
@@ -0,0 +1,137 @@
1
+ declare const _default: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly stateMutability: "nonpayable";
4
+ readonly type: "constructor";
5
+ }, {
6
+ readonly inputs: readonly [];
7
+ readonly name: "IncorrectValue";
8
+ readonly type: "error";
9
+ }, {
10
+ readonly anonymous: false;
11
+ readonly inputs: readonly [{
12
+ readonly indexed: false;
13
+ readonly internalType: "uint8";
14
+ readonly name: "version";
15
+ readonly type: "uint8";
16
+ }];
17
+ readonly name: "Initialized";
18
+ readonly type: "event";
19
+ }, {
20
+ readonly anonymous: false;
21
+ readonly inputs: readonly [{
22
+ readonly indexed: true;
23
+ readonly internalType: "address";
24
+ readonly name: "previousOwner";
25
+ readonly type: "address";
26
+ }, {
27
+ readonly indexed: true;
28
+ readonly internalType: "address";
29
+ readonly name: "newOwner";
30
+ readonly type: "address";
31
+ }];
32
+ readonly name: "OwnershipTransferred";
33
+ readonly type: "event";
34
+ }, {
35
+ readonly inputs: readonly [{
36
+ readonly internalType: "address";
37
+ readonly name: "lp";
38
+ readonly type: "address";
39
+ }, {
40
+ readonly components: readonly [{
41
+ readonly internalType: "address";
42
+ readonly name: "core";
43
+ readonly type: "address";
44
+ }, {
45
+ readonly internalType: "uint128";
46
+ readonly name: "amount";
47
+ readonly type: "uint128";
48
+ }, {
49
+ readonly internalType: "uint64";
50
+ readonly name: "expiresAt";
51
+ readonly type: "uint64";
52
+ }, {
53
+ readonly components: readonly [{
54
+ readonly internalType: "address";
55
+ readonly name: "affiliate";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly internalType: "uint64";
59
+ readonly name: "minOdds";
60
+ readonly type: "uint64";
61
+ }, {
62
+ readonly internalType: "bytes";
63
+ readonly name: "data";
64
+ readonly type: "bytes";
65
+ }];
66
+ readonly internalType: "struct IBet.BetData";
67
+ readonly name: "extraData";
68
+ readonly type: "tuple";
69
+ }];
70
+ readonly internalType: "struct IProxyFront.BetData[]";
71
+ readonly name: "data";
72
+ readonly type: "tuple[]";
73
+ }];
74
+ readonly name: "bet";
75
+ readonly outputs: readonly [];
76
+ readonly stateMutability: "payable";
77
+ readonly type: "function";
78
+ }, {
79
+ readonly inputs: readonly [{
80
+ readonly internalType: "address";
81
+ readonly name: "account";
82
+ readonly type: "address";
83
+ }];
84
+ readonly name: "checkOwner";
85
+ readonly outputs: readonly [];
86
+ readonly stateMutability: "view";
87
+ readonly type: "function";
88
+ }, {
89
+ readonly inputs: readonly [];
90
+ readonly name: "initialize";
91
+ readonly outputs: readonly [];
92
+ readonly stateMutability: "nonpayable";
93
+ readonly type: "function";
94
+ }, {
95
+ readonly inputs: readonly [];
96
+ readonly name: "owner";
97
+ readonly outputs: readonly [{
98
+ readonly internalType: "address";
99
+ readonly name: "";
100
+ readonly type: "address";
101
+ }];
102
+ readonly stateMutability: "view";
103
+ readonly type: "function";
104
+ }, {
105
+ readonly inputs: readonly [{
106
+ readonly internalType: "address";
107
+ readonly name: "newOwner";
108
+ readonly type: "address";
109
+ }];
110
+ readonly name: "transferOwnership";
111
+ readonly outputs: readonly [];
112
+ readonly stateMutability: "nonpayable";
113
+ readonly type: "function";
114
+ }, {
115
+ readonly inputs: readonly [{
116
+ readonly components: readonly [{
117
+ readonly internalType: "address";
118
+ readonly name: "core";
119
+ readonly type: "address";
120
+ }, {
121
+ readonly internalType: "uint256";
122
+ readonly name: "tokenId";
123
+ readonly type: "uint256";
124
+ }];
125
+ readonly internalType: "struct IProxyFront.WithdrawPayoutData[]";
126
+ readonly name: "data";
127
+ readonly type: "tuple[]";
128
+ }];
129
+ readonly name: "withdrawPayouts";
130
+ readonly outputs: readonly [];
131
+ readonly stateMutability: "nonpayable";
132
+ readonly type: "function";
133
+ }, {
134
+ readonly stateMutability: "payable";
135
+ readonly type: "receive";
136
+ }];
137
+ export default _default;
@@ -0,0 +1,6 @@
1
+ export { default as lpAbi } from './LP';
2
+ export { default as liveCoreAbi } from './LiveCore';
3
+ export { default as prematchComboCoreAbi } from './PrematchComboCore';
4
+ export { default as prematchCoreAbi } from './PrematchCore';
5
+ export { default as proxyFrontAbi } from './ProxyFront';
6
+ export { default as freeBetAbi } from './FreeBet';
@@ -0,0 +1,51 @@
1
+ import { type Chain } from 'viem/chains';
2
+ import { type Address } from 'viem';
3
+ import { type Contracts } from './utils/setupContracts';
4
+ export declare const ODDS_DECIMALS = 12;
5
+ export declare const MIN_LIVE_BET_AMOUNT = 1;
6
+ export declare const deBridgeUrl = "https://api.dln.trade/v1.0";
7
+ export declare const deBridgeTxUrl = "https://stats-api.dln.trade/api";
8
+ export declare const liveHostAddress = "0x67Fca88E2f5F2C33b86bFa4EccfCb8dCD6a56D17";
9
+ export declare const liveSupportedChains: ChainId[];
10
+ export declare enum Environment {
11
+ GnosisXDAI = "GnosisXDAI",
12
+ PolygonUSDT = "PolygonUSDT",
13
+ PolygonAmoyAZUSD = "PolygonAmoyAZUSD",
14
+ ChilizWCHZ = "ChilizWCHZ",
15
+ ChilizSpicyWCHZ = "ChilizSpicyWCHZ"
16
+ }
17
+ export declare const environments: {
18
+ readonly 100: Environment.GnosisXDAI;
19
+ readonly 137: Environment.PolygonUSDT;
20
+ readonly 80002: Environment.PolygonAmoyAZUSD;
21
+ readonly 88888: Environment.ChilizWCHZ;
22
+ readonly 88882: Environment.ChilizSpicyWCHZ;
23
+ };
24
+ type BetToken = {
25
+ address: Address;
26
+ symbol: string;
27
+ decimals: number;
28
+ };
29
+ export type ChainData = {
30
+ chain: Omit<Chain, 'id'> & {
31
+ id: ChainId;
32
+ };
33
+ graphql: {
34
+ prematch: string;
35
+ live: string;
36
+ };
37
+ socket: string;
38
+ api: string;
39
+ environment: Environment;
40
+ contracts: Contracts;
41
+ betToken: BetToken;
42
+ };
43
+ export declare const chainsData: {
44
+ readonly 100: ChainData;
45
+ readonly 137: ChainData;
46
+ readonly 80002: ChainData;
47
+ readonly 88888: ChainData;
48
+ readonly 88882: ChainData;
49
+ };
50
+ export type ChainId = keyof typeof chainsData;
51
+ export {};
@@ -0,0 +1,22 @@
1
+ export * from './live/fragments/condition';
2
+ export * from './live/condition';
3
+ export * from './live/conditions';
4
+ export * from './prematch/fragments/bettor';
5
+ export * from './prematch/fragments/condition';
6
+ export * from './prematch/fragments/liveBet';
7
+ export * from './prematch/fragments/prematchBet';
8
+ export * from './prematch/fragments/mainGameInfo';
9
+ export * from './prematch/bettors';
10
+ export * from './prematch/condition';
11
+ export * from './prematch/conditions';
12
+ export * from './prematch/conditionsBatch';
13
+ export * from './prematch/game';
14
+ export * from './prematch/gameBets';
15
+ export * from './prematch/games';
16
+ export * from './prematch/liveBets';
17
+ export * from './prematch/navigation';
18
+ export * from './prematch/prematchBets';
19
+ export * from './prematch/sports';
20
+ export * from './prematch/sportsNavigation';
21
+ export { type Condition_Filter, BetResult, Game_OrderBy, Bet_OrderBy, ConditionStatus, OrderDirection, SelectionResult, BetStatus as GraphBetStatus, GameStatus as PrematchGraphGameStatus } from './prematch/types';
22
+ export { GameStatus as LiveGraphGameStatus } from './live/types';
@@ -0,0 +1,28 @@
1
+ import * as Types from './types';
2
+ import * as Apollo from '@apollo/client';
3
+ export type LiveConditionQueryVariables = Types.Exact<{
4
+ conditionId: Types.Scalars['BigInt']['input'];
5
+ }>;
6
+ export type LiveConditionQuery = {
7
+ __typename?: 'Query';
8
+ condition?: {
9
+ __typename?: 'Condition';
10
+ id: string;
11
+ conditionId: string;
12
+ status: Types.ConditionStatus;
13
+ outcomes: Array<{
14
+ __typename?: 'Outcome';
15
+ outcomeId: string;
16
+ }>;
17
+ game: {
18
+ __typename?: 'Game';
19
+ gameId: string;
20
+ sport: {
21
+ __typename?: 'Sport';
22
+ sportId: string;
23
+ };
24
+ };
25
+ } | null;
26
+ };
27
+ export declare const LiveConditionDocument: Apollo.DocumentNode;
28
+ export type LiveConditionQueryResult = Apollo.QueryResult<LiveConditionQuery, LiveConditionQueryVariables>;
@@ -0,0 +1,29 @@
1
+ import * as Types from './types';
2
+ import * as Apollo from '@apollo/client';
3
+ export type LiveConditionsQueryVariables = Types.Exact<{
4
+ where: Types.Condition_Filter;
5
+ }>;
6
+ export type LiveConditionsQuery = {
7
+ __typename?: 'Query';
8
+ conditions: Array<{
9
+ __typename?: 'Condition';
10
+ wonOutcomeIds?: Array<string> | null;
11
+ id: string;
12
+ conditionId: string;
13
+ status: Types.ConditionStatus;
14
+ outcomes: Array<{
15
+ __typename?: 'Outcome';
16
+ outcomeId: string;
17
+ }>;
18
+ game: {
19
+ __typename?: 'Game';
20
+ gameId: string;
21
+ sport: {
22
+ __typename?: 'Sport';
23
+ sportId: string;
24
+ };
25
+ };
26
+ }>;
27
+ };
28
+ export declare const LiveConditionsDocument: Apollo.DocumentNode;
29
+ export type LiveConditionsQueryResult = Apollo.QueryResult<LiveConditionsQuery, LiveConditionsQueryVariables>;
@@ -0,0 +1,20 @@
1
+ import * as Types from '../types';
2
+ export type LiveConditionFragment = {
3
+ __typename?: 'Condition';
4
+ id: string;
5
+ conditionId: string;
6
+ status: Types.ConditionStatus;
7
+ outcomes: Array<{
8
+ __typename?: 'Outcome';
9
+ outcomeId: string;
10
+ }>;
11
+ game: {
12
+ __typename?: 'Game';
13
+ gameId: string;
14
+ sport: {
15
+ __typename?: 'Sport';
16
+ sportId: string;
17
+ };
18
+ };
19
+ };
20
+ export declare const LiveConditionFragmentDoc: import("@apollo/client").DocumentNode;