@azuro-org/toolkit 6.0.0-beta.3 → 6.0.0-beta.5
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/index.js
CHANGED
|
@@ -7982,7 +7982,7 @@ const getBetCalculation = async (props) => {
|
|
|
7982
7982
|
if (account && isAddress(account)) {
|
|
7983
7983
|
params.wallet = account;
|
|
7984
7984
|
}
|
|
7985
|
-
const response = await fetch(`${api}/bet/
|
|
7985
|
+
const response = await fetch(`${api}/bet/calculation`, {
|
|
7986
7986
|
method: 'POST',
|
|
7987
7987
|
headers: {
|
|
7988
7988
|
'Accept': 'application/json',
|
|
@@ -8046,7 +8046,7 @@ const getBetsByBettor = async (props) => {
|
|
|
8046
8046
|
environment,
|
|
8047
8047
|
offset: offset || 0,
|
|
8048
8048
|
limit: limit || 100,
|
|
8049
|
-
state,
|
|
8049
|
+
states: state,
|
|
8050
8050
|
result,
|
|
8051
8051
|
affiliate,
|
|
8052
8052
|
isRedeemed,
|
|
@@ -8077,6 +8077,7 @@ const getBetsByBettor = async (props) => {
|
|
|
8077
8077
|
const getConditionsByGameIds = async (props) => {
|
|
8078
8078
|
const gameIds = Array.isArray(props.gameIds) ? props.gameIds.filter(Boolean) : [props.gameIds];
|
|
8079
8079
|
if (!gameIds.length) {
|
|
8080
|
+
console.warn('getConditionsByGameIds: no game id passed');
|
|
8080
8081
|
return [];
|
|
8081
8082
|
}
|
|
8082
8083
|
const api = getApiEndpoint(props.chainId);
|
|
@@ -8088,7 +8089,7 @@ const getConditionsByGameIds = async (props) => {
|
|
|
8088
8089
|
'Content-Type': 'application/json',
|
|
8089
8090
|
},
|
|
8090
8091
|
body: JSON.stringify({
|
|
8091
|
-
gameIds
|
|
8092
|
+
gameIds,
|
|
8092
8093
|
environment,
|
|
8093
8094
|
}),
|
|
8094
8095
|
});
|
|
@@ -8153,19 +8154,21 @@ const getConditionsState = async (props) => {
|
|
|
8153
8154
|
* })
|
|
8154
8155
|
* */
|
|
8155
8156
|
const getGamesByFilters = async (props) => {
|
|
8156
|
-
const
|
|
8157
|
-
const
|
|
8157
|
+
const { chainId, leagueSlug, sportSlug, sportHub, orderBy, orderDir, sportIds, page, perPage, state } = props;
|
|
8158
|
+
const api = getApiEndpoint(chainId);
|
|
8159
|
+
const environment = environments[chainId];
|
|
8158
8160
|
const params = serializeApiParams({
|
|
8159
8161
|
environment,
|
|
8160
|
-
|
|
8161
|
-
sportId:
|
|
8162
|
-
|
|
8163
|
-
|
|
8162
|
+
gameState: state,
|
|
8163
|
+
sportId: sportIds,
|
|
8164
|
+
sportSlug,
|
|
8165
|
+
leagueSlug,
|
|
8166
|
+
sportHub,
|
|
8164
8167
|
// conditionState: props.conditionsState,
|
|
8165
|
-
orderBy:
|
|
8166
|
-
orderDirection:
|
|
8167
|
-
perPage:
|
|
8168
|
-
page:
|
|
8168
|
+
orderBy: orderBy || GameOrderBy.StartsAt,
|
|
8169
|
+
orderDirection: orderDir || OrderDirection$1.Asc,
|
|
8170
|
+
perPage: perPage || 100,
|
|
8171
|
+
page: page || 1,
|
|
8169
8172
|
});
|
|
8170
8173
|
const response = await fetch(`${api}/market-manager/games-by-filters?${params}`, {
|
|
8171
8174
|
method: 'GET',
|
|
@@ -8178,13 +8181,7 @@ const getGamesByFilters = async (props) => {
|
|
|
8178
8181
|
throw new Error(`getGamesByFilters API request failed: ${response.status} ${response.statusText}`);
|
|
8179
8182
|
}
|
|
8180
8183
|
const data = await response.json();
|
|
8181
|
-
return
|
|
8182
|
-
...data,
|
|
8183
|
-
games: data.games.map(game => ({
|
|
8184
|
-
...game,
|
|
8185
|
-
gameId: game.id,
|
|
8186
|
-
})),
|
|
8187
|
-
};
|
|
8184
|
+
return data;
|
|
8188
8185
|
};/**
|
|
8189
8186
|
* Fetches game data for a specific list of game IDs.
|
|
8190
8187
|
* Returns detailed information for each requested game including participants, timing, and league data.
|
|
@@ -8208,23 +8205,22 @@ const getGamesByIds = async (props) => {
|
|
|
8208
8205
|
return [];
|
|
8209
8206
|
}
|
|
8210
8207
|
const api = getApiEndpoint(props.chainId);
|
|
8211
|
-
const environment = environments[props.chainId]
|
|
8212
|
-
const response = await fetch(`${api}/market-manager/games-
|
|
8208
|
+
// const environment = environments[props.chainId]
|
|
8209
|
+
const response = await fetch(`${api}/market-manager/games-by-ids`, {
|
|
8213
8210
|
method: 'POST',
|
|
8214
8211
|
headers: {
|
|
8215
8212
|
'Accept': 'application/json',
|
|
8216
8213
|
'Content-Type': 'application/json',
|
|
8217
8214
|
},
|
|
8218
8215
|
body: JSON.stringify({
|
|
8219
|
-
environment,
|
|
8220
8216
|
gameIds,
|
|
8221
8217
|
}),
|
|
8222
8218
|
});
|
|
8223
8219
|
if (!response.ok) {
|
|
8224
|
-
throw new Error(`
|
|
8220
|
+
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
8225
8221
|
}
|
|
8226
8222
|
const data = await response.json();
|
|
8227
|
-
return data;
|
|
8223
|
+
return data.games;
|
|
8228
8224
|
};/**
|
|
8229
8225
|
* Fetches navigation structure with sports, countries, and leagues hierarchy.
|
|
8230
8226
|
* Returns active game counts at each level for building navigation menus.
|
|
@@ -8240,12 +8236,13 @@ const getGamesByIds = async (props) => {
|
|
|
8240
8236
|
* })
|
|
8241
8237
|
* */
|
|
8242
8238
|
const getNavigation = async (props) => {
|
|
8243
|
-
const
|
|
8244
|
-
const
|
|
8239
|
+
const { chainId, sportIds, sportHub } = props;
|
|
8240
|
+
const api = getApiEndpoint(chainId);
|
|
8241
|
+
const environment = environments[chainId];
|
|
8245
8242
|
const params = serializeApiParams({
|
|
8246
8243
|
environment,
|
|
8247
|
-
sportHub
|
|
8248
|
-
sportIds
|
|
8244
|
+
sportHub,
|
|
8245
|
+
sportIds,
|
|
8249
8246
|
});
|
|
8250
8247
|
const response = await fetch(`${api}/market-manager/navigation?${params}`, {
|
|
8251
8248
|
method: 'GET',
|
|
@@ -8282,19 +8279,19 @@ const getNavigation = async (props) => {
|
|
|
8282
8279
|
* })
|
|
8283
8280
|
* */
|
|
8284
8281
|
const getSports = async (props) => {
|
|
8285
|
-
const
|
|
8286
|
-
const
|
|
8282
|
+
const { chainId, gameState, sportIds, sportSlug, countrySlug, leagueSlug, numberOfGames, orderBy, orderDir } = props;
|
|
8283
|
+
const api = getApiEndpoint(chainId);
|
|
8284
|
+
const environment = environments[chainId];
|
|
8287
8285
|
const params = serializeApiParams({
|
|
8288
8286
|
environment,
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
// sportHub: props.sportHub,
|
|
8287
|
+
gameState,
|
|
8288
|
+
sportId: sportIds,
|
|
8289
|
+
sportSlug,
|
|
8290
|
+
countrySlug,
|
|
8291
|
+
leagueSlug,
|
|
8292
|
+
numberOfGames: numberOfGames && numberOfGames > 10 ? numberOfGames : 10,
|
|
8293
|
+
orderBy,
|
|
8294
|
+
orderDirection: orderDir,
|
|
8298
8295
|
});
|
|
8299
8296
|
const response = await fetch(`${api}/market-manager/sports?${params}`, {
|
|
8300
8297
|
method: 'GET',
|
|
@@ -8307,40 +8304,6 @@ const getSports = async (props) => {
|
|
|
8307
8304
|
throw new Error(`Status ${response.status}: ${response.statusText}`);
|
|
8308
8305
|
}
|
|
8309
8306
|
const data = await response.json();
|
|
8310
|
-
// return data.sports.map((sport) => {
|
|
8311
|
-
// const sportId = String(sport.id)
|
|
8312
|
-
//
|
|
8313
|
-
// return {
|
|
8314
|
-
// ...sport,
|
|
8315
|
-
// sportId,
|
|
8316
|
-
// countries: sport.countries.map((country) => {
|
|
8317
|
-
// return {
|
|
8318
|
-
// ...country,
|
|
8319
|
-
// leagues: country.leagues.map((league) => {
|
|
8320
|
-
// return {
|
|
8321
|
-
// ...league,
|
|
8322
|
-
// games: league.games.map(game => {
|
|
8323
|
-
// const sportInfo: GameData['sport'] = {
|
|
8324
|
-
// ...game.sport,
|
|
8325
|
-
// sportId,
|
|
8326
|
-
// sporthub: {
|
|
8327
|
-
// id: (game.sport as any).sportHub.id,
|
|
8328
|
-
// slug: (game.sport as any).sportHub.slug,
|
|
8329
|
-
// },
|
|
8330
|
-
// }
|
|
8331
|
-
//
|
|
8332
|
-
// return {
|
|
8333
|
-
// ...game,
|
|
8334
|
-
// gameId: game.id,
|
|
8335
|
-
// sport: sportInfo,
|
|
8336
|
-
// }
|
|
8337
|
-
// }),
|
|
8338
|
-
// }
|
|
8339
|
-
// }),
|
|
8340
|
-
// }
|
|
8341
|
-
// }),
|
|
8342
|
-
// }
|
|
8343
|
-
// })
|
|
8344
8307
|
return data.sports;
|
|
8345
8308
|
};const minQueryLength = 3;
|
|
8346
8309
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,15 +3,16 @@ import { type GameState, OrderDirection } from '../../global';
|
|
|
3
3
|
import { GameOrderBy, type PaginatedGamesResponse, type SportHubSlug } from './types';
|
|
4
4
|
export type GetGamesByFiltersParams = {
|
|
5
5
|
chainId: ChainId;
|
|
6
|
-
state
|
|
6
|
+
state: GameState.Live | GameState.Prematch;
|
|
7
7
|
sportHub?: SportHubSlug;
|
|
8
8
|
sportIds?: string | number | (string | number)[];
|
|
9
|
+
sportSlug?: string;
|
|
9
10
|
leagueSlug?: string;
|
|
10
11
|
orderBy?: GameOrderBy;
|
|
11
12
|
orderDir?: OrderDirection;
|
|
12
13
|
/** 1-based, default: 1 */
|
|
13
14
|
page?: number;
|
|
14
|
-
/** 1-based, default:
|
|
15
|
+
/** 1-based, default: 100 */
|
|
15
16
|
perPage?: number;
|
|
16
17
|
};
|
|
17
18
|
export type GetGamesByFiltersResult = PaginatedGamesResponse;
|
|
@@ -4,8 +4,10 @@ export type GetGamesByIdsParams = {
|
|
|
4
4
|
chainId: ChainId;
|
|
5
5
|
gameIds: string[];
|
|
6
6
|
};
|
|
7
|
-
type GetGamesByIdsResponse =
|
|
8
|
-
|
|
7
|
+
type GetGamesByIdsResponse = {
|
|
8
|
+
games: GameData[];
|
|
9
|
+
};
|
|
10
|
+
export type GetGamesByIdsResult = GetGamesByIdsResponse['games'];
|
|
9
11
|
/**
|
|
10
12
|
* Fetches game data for a specific list of game IDs.
|
|
11
13
|
* Returns detailed information for each requested game including participants, timing, and league data.
|
|
@@ -3,14 +3,15 @@ import type { ChainId } from '../../config';
|
|
|
3
3
|
import { type GameData, type GameOrderBy } from './types';
|
|
4
4
|
export type GetSportsParams = {
|
|
5
5
|
chainId: ChainId;
|
|
6
|
+
gameState: GameState.Live | GameState.Prematch;
|
|
6
7
|
sportIds?: (string | number) | (string | number)[];
|
|
8
|
+
sportSlug?: string;
|
|
7
9
|
countrySlug?: string;
|
|
8
10
|
leagueSlug?: string;
|
|
9
|
-
/** Number of games per league, default: 10 */
|
|
11
|
+
/** Number of games per league, default and minimum: 10 */
|
|
10
12
|
numberOfGames?: number;
|
|
11
13
|
orderBy?: GameOrderBy;
|
|
12
14
|
orderDir?: OrderDirection;
|
|
13
|
-
gameState?: GameState.Live | GameState.Prematch;
|
|
14
15
|
};
|
|
15
16
|
export type SportData = {
|
|
16
17
|
id: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azuro-org/toolkit",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.5",
|
|
4
4
|
"description": "This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"eslint": "9.39.2",
|
|
61
61
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
62
62
|
"eslint-plugin-import": "^1.14.0",
|
|
63
|
-
"minimist": "^1.2.
|
|
63
|
+
"minimist": "^1.2.8",
|
|
64
64
|
"rimraf": "^6.1.3",
|
|
65
65
|
"rollup": "^2.79.2",
|
|
66
66
|
"rollup-plugin-typescript2": "^0.34.1",
|