@azuro-org/toolkit 4.5.0-beta.1 → 4.5.0-beta.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.
@@ -57,7 +57,15 @@ export type Scalars = {
57
57
  input: any;
58
58
  output: any;
59
59
  };
60
+ Timestamp: {
61
+ input: any;
62
+ output: any;
63
+ };
60
64
  };
65
+ export declare enum Aggregation_Interval {
66
+ Day = "day",
67
+ Hour = "hour"
68
+ }
61
69
  export type BlockChangedFilter = {
62
70
  number_gte: Scalars['Int']['input'];
63
71
  };
@@ -1875,6 +1883,8 @@ export type _Block_ = {
1875
1883
  hash?: Maybe<Scalars['Bytes']['output']>;
1876
1884
  /** The block number */
1877
1885
  number: Scalars['Int']['output'];
1886
+ /** The hash of the parent block */
1887
+ parentHash?: Maybe<Scalars['Bytes']['output']>;
1878
1888
  /** Integer representation of the timestamp stored in blocks for the chain */
1879
1889
  timestamp?: Maybe<Scalars['Int']['output']>;
1880
1890
  };
@@ -39,5 +39,9 @@ export type LiveBetFragment = {
39
39
  };
40
40
  };
41
41
  }>;
42
+ cashout?: {
43
+ __typename?: 'Cashout';
44
+ payout: string;
45
+ } | null;
42
46
  };
43
47
  export declare const LiveBetFragmentDoc: import("@apollo/client").DocumentNode;
@@ -74,5 +74,9 @@ export type PrematchBetFragment = {
74
74
  freebetId: string;
75
75
  contractAddress: string;
76
76
  } | null;
77
+ cashout?: {
78
+ __typename?: 'Cashout';
79
+ payout: string;
80
+ } | null;
77
81
  };
78
82
  export declare const PrematchBetFragmentDoc: import("@apollo/client").DocumentNode;
@@ -49,6 +49,10 @@ export type LiveBetsQuery = {
49
49
  };
50
50
  };
51
51
  }>;
52
+ cashout?: {
53
+ __typename?: 'Cashout';
54
+ payout: string;
55
+ } | null;
52
56
  }>;
53
57
  };
54
58
  export declare const LiveBetsDocument: Apollo.DocumentNode;
@@ -84,6 +84,10 @@ export type PrematchBetsQuery = {
84
84
  freebetId: string;
85
85
  contractAddress: string;
86
86
  } | null;
87
+ cashout?: {
88
+ __typename?: 'Cashout';
89
+ payout: string;
90
+ } | null;
87
91
  }>;
88
92
  };
89
93
  export declare const PrematchBetsDocument: Apollo.DocumentNode;
@@ -57,6 +57,10 @@ export type Scalars = {
57
57
  input: any;
58
58
  output: any;
59
59
  };
60
+ Timestamp: {
61
+ input: any;
62
+ output: any;
63
+ };
60
64
  };
61
65
  export type AffiliateMonthly = {
62
66
  __typename?: 'AffiliateMonthly';
@@ -142,6 +146,10 @@ export declare enum AffiliateMonthly_OrderBy {
142
146
  Month = "month",
143
147
  Year = "year"
144
148
  }
149
+ export declare enum Aggregation_Interval {
150
+ Day = "day",
151
+ Hour = "hour"
152
+ }
145
153
  export type AzuroBetContract = {
146
154
  __typename?: 'AzuroBetContract';
147
155
  address: Scalars['String']['output'];
@@ -6976,6 +6984,8 @@ export type _Block_ = {
6976
6984
  hash?: Maybe<Scalars['Bytes']['output']>;
6977
6985
  /** The block number */
6978
6986
  number: Scalars['Int']['output'];
6987
+ /** The hash of the parent block */
6988
+ parentHash?: Maybe<Scalars['Bytes']['output']>;
6979
6989
  /** Integer representation of the timestamp stored in blocks for the chain */
6980
6990
  timestamp?: Maybe<Scalars['Int']['output']>;
6981
6991
  };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './config';
3
3
  export * from './global';
4
4
  export * from './abis';
5
5
  export * from './docs';
6
+ export { getProviderFromId } from './utils/getProviderFromId';
6
7
  export { calcMindOdds } from './utils/calcMindOdds';
7
8
  export { calcLiveOdds, calcPrematchOdds } from './utils/calcOdds';
8
9
  export { getGameStatus, GameStatus } from './utils/getGameStatus';
package/dist/index.js CHANGED
@@ -4271,6 +4271,9 @@ const chainsDataByEnv = {
4271
4271
  }
4272
4272
  }
4273
4273
  }
4274
+ cashout {
4275
+ payout
4276
+ }
4274
4277
  }
4275
4278
  `;const MainGameInfoFragmentDoc = gql `
4276
4279
  fragment MainGameInfo on Game {
@@ -4340,6 +4343,9 @@ const chainsDataByEnv = {
4340
4343
  freebetId
4341
4344
  contractAddress: freebetContractAddress
4342
4345
  }
4346
+ cashout {
4347
+ payout
4348
+ }
4343
4349
  }
4344
4350
  ${MainGameInfoFragmentDoc}`;const BettorsDocument = gql `
4345
4351
  query Bettors($where: Bettor_filter!) {
@@ -4530,6 +4536,11 @@ const chainsDataByEnv = {
4530
4536
  AffiliateMonthly_OrderBy["Month"] = "month";
4531
4537
  AffiliateMonthly_OrderBy["Year"] = "year";
4532
4538
  })(AffiliateMonthly_OrderBy || (AffiliateMonthly_OrderBy = {}));
4539
+ var Aggregation_Interval$1;
4540
+ (function (Aggregation_Interval) {
4541
+ Aggregation_Interval["Day"] = "day";
4542
+ Aggregation_Interval["Hour"] = "hour";
4543
+ })(Aggregation_Interval$1 || (Aggregation_Interval$1 = {}));
4533
4544
  var AzuroBetContract_OrderBy;
4534
4545
  (function (AzuroBetContract_OrderBy) {
4535
4546
  AzuroBetContract_OrderBy["Address"] = "address";
@@ -5140,7 +5151,12 @@ var _SubgraphErrorPolicy_$1;
5140
5151
  _SubgraphErrorPolicy_["Allow"] = "allow";
5141
5152
  /** If the subgraph has indexing errors, data will be omitted. The default. */
5142
5153
  _SubgraphErrorPolicy_["Deny"] = "deny";
5143
- })(_SubgraphErrorPolicy_$1 || (_SubgraphErrorPolicy_$1 = {}));var ConditionStatus;
5154
+ })(_SubgraphErrorPolicy_$1 || (_SubgraphErrorPolicy_$1 = {}));var Aggregation_Interval;
5155
+ (function (Aggregation_Interval) {
5156
+ Aggregation_Interval["Day"] = "day";
5157
+ Aggregation_Interval["Hour"] = "hour";
5158
+ })(Aggregation_Interval || (Aggregation_Interval = {}));
5159
+ var ConditionStatus;
5144
5160
  (function (ConditionStatus) {
5145
5161
  ConditionStatus["Canceled"] = "Canceled";
5146
5162
  ConditionStatus["Created"] = "Created";
@@ -5309,7 +5325,10 @@ var _SubgraphErrorPolicy_;
5309
5325
  _SubgraphErrorPolicy_["Allow"] = "allow";
5310
5326
  /** If the subgraph has indexing errors, data will be omitted. The default. */
5311
5327
  _SubgraphErrorPolicy_["Deny"] = "deny";
5312
- })(_SubgraphErrorPolicy_ || (_SubgraphErrorPolicy_ = {}));const calcMindOdds = (props) => {
5328
+ })(_SubgraphErrorPolicy_ || (_SubgraphErrorPolicy_ = {}));const CONDITION_PROVIDER_LENGTH = 3;
5329
+ const getProviderFromId = (id) => {
5330
+ return +(id.slice(1, 1 + CONDITION_PROVIDER_LENGTH));
5331
+ };const calcMindOdds = (props) => {
5313
5332
  const totalOdds = typeof props.odds === 'number' ? props.odds : props.odds.reduce((acc, odds) => acc * +odds, 1);
5314
5333
  const minOdds = 1 + (totalOdds - 1) * (100 - props.slippage) / 100;
5315
5334
  return minOdds.toFixed(ODDS_DECIMALS);
@@ -6141,4 +6160,4 @@ const createCashout = async (props) => {
6141
6160
  }
6142
6161
  const data = await response.json();
6143
6162
  return data;
6144
- };export{BetResult,BetStatus,Bet_OrderBy,BettorFragmentDoc,BettorsDocument,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CashoutState,ConditionStatus$1 as ConditionStatus,DeBridgeExternalCallStatus,DeBridgeOrderStatus,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameStatus,Game_OrderBy$1 as Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LIVE_BET_DATA_TYPES,LIVE_TYPED_DATA_DOMAIN_NAME,LIVE_TYPED_DATA_DOMAIN_VERSION,LiveBetFragmentDoc,LiveBetState,LiveBetsDocument,LiveConditionDocument,LiveConditionFragmentDoc,Condition_OrderBy as LiveConditionOrderBy,LiveConditionsDocument,GameStatus$1 as LiveGraphGameStatus,MARGIN_DECIMALS,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,NavigationDocument,ODDS_DECIMALS,OrderDirection$1 as OrderDirection,PrematchBetFragmentDoc,PrematchBetsDocument,PrematchConditionDocument,PrematchConditionFragmentDoc,Condition_OrderBy$1 as PrematchConditionOrderBy,PrematchConditionsBatchDocument,PrematchConditionsDocument,GameStatus$2 as PrematchGraphGameStatus,SelectionResult$1 as SelectionResult,SportsDocument,SportsNavigationDocument,WaveLevelName,activateWave,calcLiveOdds,calcMindOdds,calcPrematchOdds,chainsData,chainsDataByEnv,createCashout,createDeBridgeBet,createLiveBet,deBridgeChainIdByOriginalChainId,deBridgeTxUrl,deBridgeUrl,environments,FreeBet as freeBetAbi,getApiEndpoint,getBetStatus,getCalculatedCashout,getCashout,getCashoutTypedData,getDeBridgeOrder,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,getFreeBets,getGameStatus,getLiveBet,getLiveBetFee,getLiveBetTypedData,getLiveGraphqlEndpoint,getPrecalculatedCashouts,getPrematchBetDataBytes,getPrematchGraphqlEndpoint,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupByConditionId,groupConditionsByMarket,liveCoreAbi,liveHostAddress,liveSupportedChains,lpAbi,prematchComboCoreAbi,prematchCoreAbi,proxyFrontAbi,setupContracts};
6163
+ };export{BetResult,BetStatus,Bet_OrderBy,BettorFragmentDoc,BettorsDocument,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CashoutState,ConditionStatus$1 as ConditionStatus,DeBridgeExternalCallStatus,DeBridgeOrderStatus,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameStatus,Game_OrderBy$1 as Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LIVE_BET_DATA_TYPES,LIVE_TYPED_DATA_DOMAIN_NAME,LIVE_TYPED_DATA_DOMAIN_VERSION,LiveBetFragmentDoc,LiveBetState,LiveBetsDocument,LiveConditionDocument,LiveConditionFragmentDoc,Condition_OrderBy as LiveConditionOrderBy,LiveConditionsDocument,GameStatus$1 as LiveGraphGameStatus,MARGIN_DECIMALS,MIN_LIVE_BET_AMOUNT,MainGameInfoFragmentDoc,NavigationDocument,ODDS_DECIMALS,OrderDirection$1 as OrderDirection,PrematchBetFragmentDoc,PrematchBetsDocument,PrematchConditionDocument,PrematchConditionFragmentDoc,Condition_OrderBy$1 as PrematchConditionOrderBy,PrematchConditionsBatchDocument,PrematchConditionsDocument,GameStatus$2 as PrematchGraphGameStatus,SelectionResult$1 as SelectionResult,SportsDocument,SportsNavigationDocument,WaveLevelName,activateWave,calcLiveOdds,calcMindOdds,calcPrematchOdds,chainsData,chainsDataByEnv,createCashout,createDeBridgeBet,createLiveBet,deBridgeChainIdByOriginalChainId,deBridgeTxUrl,deBridgeUrl,environments,FreeBet as freeBetAbi,getApiEndpoint,getBetStatus,getCalculatedCashout,getCashout,getCashoutTypedData,getDeBridgeOrder,getDeBridgeSupportedChains,getDeBridgeSupportedTokens,getFreeBets,getGameStatus,getLiveBet,getLiveBetFee,getLiveBetTypedData,getLiveGraphqlEndpoint,getPrecalculatedCashouts,getPrematchBetDataBytes,getPrematchGraphqlEndpoint,getProviderFromId,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupByConditionId,groupConditionsByMarket,liveCoreAbi,liveHostAddress,liveSupportedChains,lpAbi,prematchComboCoreAbi,prematchCoreAbi,proxyFrontAbi,setupContracts};
@@ -0,0 +1 @@
1
+ export declare const getProviderFromId: (id: string) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azuro-org/toolkit",
3
- "version": "4.5.0-beta.1",
3
+ "version": "4.5.0-beta.3",
4
4
  "description": "Set of helpers to work with Azuro protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",