@azuro-org/toolkit 4.5.0-beta.1 → 4.5.0-beta.2

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
  };
@@ -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
@@ -4530,6 +4530,11 @@ const chainsDataByEnv = {
4530
4530
  AffiliateMonthly_OrderBy["Month"] = "month";
4531
4531
  AffiliateMonthly_OrderBy["Year"] = "year";
4532
4532
  })(AffiliateMonthly_OrderBy || (AffiliateMonthly_OrderBy = {}));
4533
+ var Aggregation_Interval$1;
4534
+ (function (Aggregation_Interval) {
4535
+ Aggregation_Interval["Day"] = "day";
4536
+ Aggregation_Interval["Hour"] = "hour";
4537
+ })(Aggregation_Interval$1 || (Aggregation_Interval$1 = {}));
4533
4538
  var AzuroBetContract_OrderBy;
4534
4539
  (function (AzuroBetContract_OrderBy) {
4535
4540
  AzuroBetContract_OrderBy["Address"] = "address";
@@ -5140,7 +5145,12 @@ var _SubgraphErrorPolicy_$1;
5140
5145
  _SubgraphErrorPolicy_["Allow"] = "allow";
5141
5146
  /** If the subgraph has indexing errors, data will be omitted. The default. */
5142
5147
  _SubgraphErrorPolicy_["Deny"] = "deny";
5143
- })(_SubgraphErrorPolicy_$1 || (_SubgraphErrorPolicy_$1 = {}));var ConditionStatus;
5148
+ })(_SubgraphErrorPolicy_$1 || (_SubgraphErrorPolicy_$1 = {}));var Aggregation_Interval;
5149
+ (function (Aggregation_Interval) {
5150
+ Aggregation_Interval["Day"] = "day";
5151
+ Aggregation_Interval["Hour"] = "hour";
5152
+ })(Aggregation_Interval || (Aggregation_Interval = {}));
5153
+ var ConditionStatus;
5144
5154
  (function (ConditionStatus) {
5145
5155
  ConditionStatus["Canceled"] = "Canceled";
5146
5156
  ConditionStatus["Created"] = "Created";
@@ -5309,7 +5319,10 @@ var _SubgraphErrorPolicy_;
5309
5319
  _SubgraphErrorPolicy_["Allow"] = "allow";
5310
5320
  /** If the subgraph has indexing errors, data will be omitted. The default. */
5311
5321
  _SubgraphErrorPolicy_["Deny"] = "deny";
5312
- })(_SubgraphErrorPolicy_ || (_SubgraphErrorPolicy_ = {}));const calcMindOdds = (props) => {
5322
+ })(_SubgraphErrorPolicy_ || (_SubgraphErrorPolicy_ = {}));const CONDITION_PROVIDER_LENGTH = 3;
5323
+ const getProviderFromId = (id) => {
5324
+ return +(id.slice(1, 1 + CONDITION_PROVIDER_LENGTH));
5325
+ };const calcMindOdds = (props) => {
5313
5326
  const totalOdds = typeof props.odds === 'number' ? props.odds : props.odds.reduce((acc, odds) => acc * +odds, 1);
5314
5327
  const minOdds = 1 + (totalOdds - 1) * (100 - props.slippage) / 100;
5315
5328
  return minOdds.toFixed(ODDS_DECIMALS);
@@ -6141,4 +6154,4 @@ const createCashout = async (props) => {
6141
6154
  }
6142
6155
  const data = await response.json();
6143
6156
  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};
6157
+ };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.2",
4
4
  "description": "Set of helpers to work with Azuro protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",