@azuro-org/toolkit 5.0.0-beta.3 → 5.0.0-beta.4
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.
- package/dist/config.d.ts +1 -0
- package/dist/docs/feed/condition.d.ts +1 -0
- package/dist/docs/feed/conditions.d.ts +1 -0
- package/dist/docs/feed/fragments/condition.d.ts +1 -0
- package/dist/docs/feed/fragments/gameInfo.d.ts +1 -0
- package/dist/docs/feed/game.d.ts +1 -0
- package/dist/docs/feed/games.d.ts +1 -0
- package/dist/docs/feed/sports.d.ts +1 -1
- package/dist/docs/feed/types.d.ts +20 -0
- package/dist/index.js +10 -5
- package/dist/utils/groupConditionsByMarket.d.ts +1 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
package/dist/docs/feed/game.d.ts
CHANGED
|
@@ -29,12 +29,12 @@ export type SportsQuery = {
|
|
|
29
29
|
turnover: string;
|
|
30
30
|
games: Array<{
|
|
31
31
|
__typename?: 'Game';
|
|
32
|
-
turnover: string;
|
|
33
32
|
id: string;
|
|
34
33
|
gameId: string;
|
|
35
34
|
title: string;
|
|
36
35
|
startsAt: string;
|
|
37
36
|
state: Types.GameState;
|
|
37
|
+
turnover: string;
|
|
38
38
|
sport: {
|
|
39
39
|
__typename?: 'Sport';
|
|
40
40
|
sportId: string;
|
|
@@ -91,6 +91,7 @@ export type Condition = {
|
|
|
91
91
|
isExpressForbidden: Scalars['Boolean']['output'];
|
|
92
92
|
isLiveEnabled: Scalars['Boolean']['output'];
|
|
93
93
|
isPrematchEnabled: Scalars['Boolean']['output'];
|
|
94
|
+
margin: Scalars['BigDecimal']['output'];
|
|
94
95
|
maxConditionPotentialLoss: Scalars['BigDecimal']['output'];
|
|
95
96
|
maxOutcomePotentialLoss: Scalars['BigDecimal']['output'];
|
|
96
97
|
outcomes: Array<Outcome>;
|
|
@@ -254,6 +255,14 @@ export type Condition_Filter = {
|
|
|
254
255
|
isPrematchEnabled_in?: InputMaybe<Array<Scalars['Boolean']['input']>>;
|
|
255
256
|
isPrematchEnabled_not?: InputMaybe<Scalars['Boolean']['input']>;
|
|
256
257
|
isPrematchEnabled_not_in?: InputMaybe<Array<Scalars['Boolean']['input']>>;
|
|
258
|
+
margin?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
259
|
+
margin_gt?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
260
|
+
margin_gte?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
261
|
+
margin_in?: InputMaybe<Array<Scalars['BigDecimal']['input']>>;
|
|
262
|
+
margin_lt?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
263
|
+
margin_lte?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
264
|
+
margin_not?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
265
|
+
margin_not_in?: InputMaybe<Array<Scalars['BigDecimal']['input']>>;
|
|
257
266
|
maxConditionPotentialLoss?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
258
267
|
maxConditionPotentialLoss_gt?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
259
268
|
maxConditionPotentialLoss_gte?: InputMaybe<Scalars['BigDecimal']['input']>;
|
|
@@ -395,6 +404,7 @@ export declare enum Condition_OrderBy {
|
|
|
395
404
|
IsExpressForbidden = "isExpressForbidden",
|
|
396
405
|
IsLiveEnabled = "isLiveEnabled",
|
|
397
406
|
IsPrematchEnabled = "isPrematchEnabled",
|
|
407
|
+
Margin = "margin",
|
|
398
408
|
MaxConditionPotentialLoss = "maxConditionPotentialLoss",
|
|
399
409
|
MaxOutcomePotentialLoss = "maxOutcomePotentialLoss",
|
|
400
410
|
Outcomes = "outcomes",
|
|
@@ -721,6 +731,7 @@ export type Game = {
|
|
|
721
731
|
__typename?: 'Game';
|
|
722
732
|
_providerTitle?: Maybe<Scalars['String']['output']>;
|
|
723
733
|
_updatedAt: Scalars['BigInt']['output'];
|
|
734
|
+
activeAndStoppedConditionsCount: Scalars['Int']['output'];
|
|
724
735
|
activeConditionsCount: Scalars['Int']['output'];
|
|
725
736
|
conditions: Array<Condition>;
|
|
726
737
|
conditionsCount: Scalars['Int']['output'];
|
|
@@ -799,6 +810,14 @@ export type Game_Filter = {
|
|
|
799
810
|
_updatedAt_lte?: InputMaybe<Scalars['BigInt']['input']>;
|
|
800
811
|
_updatedAt_not?: InputMaybe<Scalars['BigInt']['input']>;
|
|
801
812
|
_updatedAt_not_in?: InputMaybe<Array<Scalars['BigInt']['input']>>;
|
|
813
|
+
activeAndStoppedConditionsCount?: InputMaybe<Scalars['Int']['input']>;
|
|
814
|
+
activeAndStoppedConditionsCount_gt?: InputMaybe<Scalars['Int']['input']>;
|
|
815
|
+
activeAndStoppedConditionsCount_gte?: InputMaybe<Scalars['Int']['input']>;
|
|
816
|
+
activeAndStoppedConditionsCount_in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
|
817
|
+
activeAndStoppedConditionsCount_lt?: InputMaybe<Scalars['Int']['input']>;
|
|
818
|
+
activeAndStoppedConditionsCount_lte?: InputMaybe<Scalars['Int']['input']>;
|
|
819
|
+
activeAndStoppedConditionsCount_not?: InputMaybe<Scalars['Int']['input']>;
|
|
820
|
+
activeAndStoppedConditionsCount_not_in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
|
802
821
|
activeConditionsCount?: InputMaybe<Scalars['Int']['input']>;
|
|
803
822
|
activeConditionsCount_gt?: InputMaybe<Scalars['Int']['input']>;
|
|
804
823
|
activeConditionsCount_gte?: InputMaybe<Scalars['Int']['input']>;
|
|
@@ -1062,6 +1081,7 @@ export type Game_Filter = {
|
|
|
1062
1081
|
export declare enum Game_OrderBy {
|
|
1063
1082
|
ProviderTitle = "_providerTitle",
|
|
1064
1083
|
UpdatedAt = "_updatedAt",
|
|
1084
|
+
ActiveAndStoppedConditionsCount = "activeAndStoppedConditionsCount",
|
|
1065
1085
|
ActiveConditionsCount = "activeConditionsCount",
|
|
1066
1086
|
Conditions = "conditions",
|
|
1067
1087
|
ConditionsCount = "conditionsCount",
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {gnosis,polygon,polygonAmoy,chiliz,spicy,base,baseSepolia}from'viem/chains';import gql from'graphql-tag';import {getMarketKey,getMarketName,getMarketDescription,dictionaries,getSelectionName}from'@azuro-org/dictionaries';import {parseUnits
|
|
1
|
+
import {gnosis,polygon,polygonAmoy,chiliz,spicy,base,baseSepolia}from'viem/chains';import gql from'graphql-tag';import {getMarketKey,getMarketName,getMarketDescription,dictionaries,getSelectionName}from'@azuro-org/dictionaries';import {formatUnits,parseUnits}from'viem';const isDevEnabled = Boolean(JSON.parse(process.env.AZURO_UNSTABLE_DEV_ENABLED || 'false'));
|
|
2
2
|
var Environment;
|
|
3
3
|
(function (Environment) {
|
|
4
4
|
Environment["GnosisDevXDAI"] = "GnosisDevXDAI";
|
|
@@ -4548,7 +4548,8 @@ const getApiEndpoint = (chainId) => {
|
|
|
4548
4548
|
return 'https://preprod-api.azuro.org/api/v1/public';
|
|
4549
4549
|
}
|
|
4550
4550
|
return 'https://api.azuro.org/api/v1/public';
|
|
4551
|
-
};const
|
|
4551
|
+
};const MARGIN_DECIMALS = 12;
|
|
4552
|
+
const ODDS_DECIMALS = 12;
|
|
4552
4553
|
const MIN_BET_AMOUNT = 1;
|
|
4553
4554
|
const CLIENT_DATA_TYPES = [
|
|
4554
4555
|
{ name: 'attention', type: 'string' },
|
|
@@ -5112,6 +5113,7 @@ ${LegacyLiveBetFragmentDoc}`;const GameBetsDocument = gql `
|
|
|
5112
5113
|
isExpressForbidden
|
|
5113
5114
|
isPrematchEnabled
|
|
5114
5115
|
isLiveEnabled
|
|
5116
|
+
margin
|
|
5115
5117
|
outcomes {
|
|
5116
5118
|
title
|
|
5117
5119
|
outcomeId
|
|
@@ -5131,6 +5133,7 @@ ${LegacyLiveBetFragmentDoc}`;const GameBetsDocument = gql `
|
|
|
5131
5133
|
title
|
|
5132
5134
|
startsAt
|
|
5133
5135
|
state
|
|
5136
|
+
turnover
|
|
5134
5137
|
sport {
|
|
5135
5138
|
sportId
|
|
5136
5139
|
slug
|
|
@@ -5251,7 +5254,6 @@ ${LegacyLiveBetFragmentDoc}`;const GameBetsDocument = gql `
|
|
|
5251
5254
|
orderBy: $gameOrderBy
|
|
5252
5255
|
orderDirection: $gameOrderDirection
|
|
5253
5256
|
) {
|
|
5254
|
-
turnover
|
|
5255
5257
|
...GameInfo
|
|
5256
5258
|
}
|
|
5257
5259
|
}
|
|
@@ -6099,6 +6101,7 @@ var Condition_OrderBy;
|
|
|
6099
6101
|
Condition_OrderBy["IsExpressForbidden"] = "isExpressForbidden";
|
|
6100
6102
|
Condition_OrderBy["IsLiveEnabled"] = "isLiveEnabled";
|
|
6101
6103
|
Condition_OrderBy["IsPrematchEnabled"] = "isPrematchEnabled";
|
|
6104
|
+
Condition_OrderBy["Margin"] = "margin";
|
|
6102
6105
|
Condition_OrderBy["MaxConditionPotentialLoss"] = "maxConditionPotentialLoss";
|
|
6103
6106
|
Condition_OrderBy["MaxOutcomePotentialLoss"] = "maxOutcomePotentialLoss";
|
|
6104
6107
|
Condition_OrderBy["Outcomes"] = "outcomes";
|
|
@@ -6162,6 +6165,7 @@ var Game_OrderBy;
|
|
|
6162
6165
|
(function (Game_OrderBy) {
|
|
6163
6166
|
Game_OrderBy["ProviderTitle"] = "_providerTitle";
|
|
6164
6167
|
Game_OrderBy["UpdatedAt"] = "_updatedAt";
|
|
6168
|
+
Game_OrderBy["ActiveAndStoppedConditionsCount"] = "activeAndStoppedConditionsCount";
|
|
6165
6169
|
Game_OrderBy["ActiveConditionsCount"] = "activeConditionsCount";
|
|
6166
6170
|
Game_OrderBy["Conditions"] = "conditions";
|
|
6167
6171
|
Game_OrderBy["ConditionsCount"] = "conditionsCount";
|
|
@@ -6350,7 +6354,7 @@ const getBetStatus = (props) => {
|
|
|
6350
6354
|
const stateByOutcomeIds = {};
|
|
6351
6355
|
for (let conditionIndex = 0; conditionIndex < conditions.length; conditionIndex++) {
|
|
6352
6356
|
const condition = conditions[conditionIndex];
|
|
6353
|
-
const { conditionId, outcomes: rawOutcomes, state, wonOutcomeIds, isExpressForbidden, title: customMarketName, game: { gameId }, } = condition;
|
|
6357
|
+
const { conditionId, outcomes: rawOutcomes, state, wonOutcomeIds, isExpressForbidden, title: customMarketName, margin, game: { gameId }, } = condition;
|
|
6354
6358
|
const firstOutcomeId = rawOutcomes[0].outcomeId;
|
|
6355
6359
|
const marketKey = getMarketKey(firstOutcomeId);
|
|
6356
6360
|
const marketName = customMarketName && customMarketName !== 'null' ? customMarketName : getMarketName({ outcomeId: firstOutcomeId });
|
|
@@ -6389,6 +6393,7 @@ const getBetStatus = (props) => {
|
|
|
6389
6393
|
conditionId,
|
|
6390
6394
|
state,
|
|
6391
6395
|
isExpressForbidden,
|
|
6396
|
+
margin: formatUnits(BigInt(margin), MARGIN_DECIMALS),
|
|
6392
6397
|
outcomes: [],
|
|
6393
6398
|
};
|
|
6394
6399
|
new Array(...rawOutcomes).sort((a, b) => {
|
|
@@ -6897,4 +6902,4 @@ const createCashout = async (props) => {
|
|
|
6897
6902
|
}
|
|
6898
6903
|
const data = await response.json();
|
|
6899
6904
|
return data;
|
|
6900
|
-
};export{BET_DATA_TYPES,ConditionStatus as BetConditionStatus,BetFragmentDoc,BetResult,BetState,BetStatus,V3_Bet_OrderBy as Bet_OrderBy,BetsDocument,BettorFragmentDoc,BettorsDocument,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CLIENT_DATA_TYPES,COMBO_BET_DATA_TYPES,CashoutState,ConditionDocument,ConditionFragmentDoc,ConditionState,Condition_OrderBy,ConditionsBatchDocument,ConditionsDocument,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameInfoFragmentDoc,GameState,Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LegacyBetsDocument,GameStatus as LegacyGameStatus,LegacyLiveBetFragmentDoc,LegacyLiveGamesDocument,LegacyPrematchBetFragmentDoc,Bet_OrderBy as Legacy_Bet_OrderBy,MIN_BET_AMOUNT,NavigationDocument,ODDS_DECIMALS,OrderDirection,SelectionResult,SportsDocument,SportsNavigationDocument,TYPED_DATA_DOMAIN_NAME,TYPED_DATA_DOMAIN_VERSION,WaveLevelName,activateWave,azuroBetAbi,calcMindOdds,cashoutAbi,chainsData,chainsDataByEnv,coreAbi,createBet,createCashout,createComboBet,environments,FreeBet as freeBetAbi,getApiEndpoint,getBet,getBetFee,getBetStatus,getBetTypedData,getBetsGraphqlEndpoint,getCalculatedCashout,getCashout,getCashoutTypedData,getComboBetTypedData,getFeedGraphqlEndpoint,getFreeBets,getIsPendingResolution,getMaxBet,getPrecalculatedCashouts,getProviderFromId,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupConditionsByMarket,lpAbi,relayerAbi,setupContracts};
|
|
6905
|
+
};export{BET_DATA_TYPES,ConditionStatus as BetConditionStatus,BetFragmentDoc,BetResult,BetState,BetStatus,V3_Bet_OrderBy as Bet_OrderBy,BetsDocument,BettorFragmentDoc,BettorsDocument,CASHOUT_DATA_TYPES,CASHOUT_TYPED_DATA_DOMAIN_NAME,CASHOUT_TYPED_DATA_DOMAIN_VERSION,CLIENT_DATA_TYPES,COMBO_BET_DATA_TYPES,CashoutState,ConditionDocument,ConditionFragmentDoc,ConditionState,Condition_OrderBy,ConditionsBatchDocument,ConditionsDocument,Environment,FreeBetStatus,GameBetsDocument,GameDocument,GameInfoFragmentDoc,GameState,Game_OrderBy,GamesDocument,BetStatus$1 as GraphBetStatus,LegacyBetsDocument,GameStatus as LegacyGameStatus,LegacyLiveBetFragmentDoc,LegacyLiveGamesDocument,LegacyPrematchBetFragmentDoc,Bet_OrderBy as Legacy_Bet_OrderBy,MARGIN_DECIMALS,MIN_BET_AMOUNT,NavigationDocument,ODDS_DECIMALS,OrderDirection,SelectionResult,SportsDocument,SportsNavigationDocument,TYPED_DATA_DOMAIN_NAME,TYPED_DATA_DOMAIN_VERSION,WaveLevelName,activateWave,azuroBetAbi,calcMindOdds,cashoutAbi,chainsData,chainsDataByEnv,coreAbi,createBet,createCashout,createComboBet,environments,FreeBet as freeBetAbi,getApiEndpoint,getBet,getBetFee,getBetStatus,getBetTypedData,getBetsGraphqlEndpoint,getCalculatedCashout,getCashout,getCashoutTypedData,getComboBetTypedData,getFeedGraphqlEndpoint,getFreeBets,getIsPendingResolution,getMaxBet,getPrecalculatedCashouts,getProviderFromId,getSocketEndpoint,getWaveLeaderBoard,getWaveLevels,getWavePeriods,getWaveStats,groupConditionsByMarket,lpAbi,relayerAbi,setupContracts};
|