@provable-games/budokan-sdk 0.1.17 → 0.1.19
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/{client-CP4dxHGv.d.cts → client-B97mEKJc.d.cts} +14 -4
- package/dist/{client-CP4dxHGv.d.ts → client-B97mEKJc.d.ts} +14 -4
- package/dist/index.cjs +11 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -7
- package/dist/index.d.ts +3 -7
- package/dist/index.js +13 -27
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +11 -25
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +12 -26
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Tournament,
|
|
2
|
-
export { B as BudokanClient, m as BudokanClientConfig, C as ConnectionMode, n as ConnectionStatus, o as ConnectionStatusState, D as DataSource, G as GameConfig,
|
|
1
|
+
import { T as Tournament, P as PrizeAggregation, a as Prize, b as PaginatedResult, Q as QualificationEntry, R as Registration, c as RewardClaim, d as RewardClaimSummary, e as TournamentListParams, f as PlayerStats, g as PlayerTournamentParams, h as PlayerTournament, i as PlatformStats, A as ActivityParams, j as ActivityEvent, k as PrizeStats, W as WSSubscribeOptions, l as WSEventHandler } from './client-B97mEKJc.cjs';
|
|
2
|
+
export { B as BudokanClient, m as BudokanClientConfig, C as ConnectionMode, n as ConnectionStatus, o as ConnectionStatusState, D as DataSource, G as GameConfig, L as LeaderboardConfig, p as LeaderboardEntry, q as Phase, S as Schedule, r as WSChannel, s as WSEventMessage, t as WSMessage, u as WSSubscribeMessage, v as WSUnsubscribeMessage, w as createBudokanClient } from './client-B97mEKJc.cjs';
|
|
3
3
|
export { EntryFee } from '@provable-games/metagame-sdk';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
|
|
@@ -44,10 +44,6 @@ declare function getTournaments(baseUrl: string, params?: TournamentListParams,
|
|
|
44
44
|
* Fetch a single tournament by ID.
|
|
45
45
|
*/
|
|
46
46
|
declare function getTournament(baseUrl: string, tournamentId: string, ctx?: ApiContext$3): Promise<Tournament>;
|
|
47
|
-
/**
|
|
48
|
-
* Fetch the leaderboard for a tournament.
|
|
49
|
-
*/
|
|
50
|
-
declare function getTournamentLeaderboard(baseUrl: string, tournamentId: string, ctx?: ApiContext$3): Promise<LeaderboardEntry[]>;
|
|
51
47
|
/**
|
|
52
48
|
* Fetch registrations for a tournament.
|
|
53
49
|
*/
|
|
@@ -208,4 +204,4 @@ interface ChainConfig {
|
|
|
208
204
|
declare const CHAINS: Record<string, ChainConfig>;
|
|
209
205
|
declare function getChainConfig(chain: string): ChainConfig | undefined;
|
|
210
206
|
|
|
211
|
-
export { ActivityEvent, ActivityParams, BudokanApiError, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, type ChainConfig, DataSourceError,
|
|
207
|
+
export { ActivityEvent, ActivityParams, BudokanApiError, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, type ChainConfig, DataSourceError, PaginatedResult, PlatformStats, PlayerStats, PlayerTournament, PlayerTournamentParams, Prize, PrizeAggregation, PrizeStats, QualificationEntry, Registration, RewardClaim, RewardClaimSummary, RpcError, Tournament, TournamentListParams, TournamentNotFoundError, WSEventHandler, WSManager, WSSubscribeOptions, camelToSnake, getActivity, getActivityStats, getChainConfig, getGameStats, getGameTournaments, getPlayerStats, getPlayerTournaments, getPrizeStats, getTournament, getTournamentPrizeAggregation, getTournamentPrizes, getTournamentQualifications, getTournamentRegistrations, getTournamentRewardClaims, getTournamentRewardClaimsSummary, getTournaments, normalizeAddress, snakeToCamel, withRetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as Tournament,
|
|
2
|
-
export { B as BudokanClient, m as BudokanClientConfig, C as ConnectionMode, n as ConnectionStatus, o as ConnectionStatusState, D as DataSource, G as GameConfig,
|
|
1
|
+
import { T as Tournament, P as PrizeAggregation, a as Prize, b as PaginatedResult, Q as QualificationEntry, R as Registration, c as RewardClaim, d as RewardClaimSummary, e as TournamentListParams, f as PlayerStats, g as PlayerTournamentParams, h as PlayerTournament, i as PlatformStats, A as ActivityParams, j as ActivityEvent, k as PrizeStats, W as WSSubscribeOptions, l as WSEventHandler } from './client-B97mEKJc.js';
|
|
2
|
+
export { B as BudokanClient, m as BudokanClientConfig, C as ConnectionMode, n as ConnectionStatus, o as ConnectionStatusState, D as DataSource, G as GameConfig, L as LeaderboardConfig, p as LeaderboardEntry, q as Phase, S as Schedule, r as WSChannel, s as WSEventMessage, t as WSMessage, u as WSSubscribeMessage, v as WSUnsubscribeMessage, w as createBudokanClient } from './client-B97mEKJc.js';
|
|
3
3
|
export { EntryFee } from '@provable-games/metagame-sdk';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
|
|
@@ -44,10 +44,6 @@ declare function getTournaments(baseUrl: string, params?: TournamentListParams,
|
|
|
44
44
|
* Fetch a single tournament by ID.
|
|
45
45
|
*/
|
|
46
46
|
declare function getTournament(baseUrl: string, tournamentId: string, ctx?: ApiContext$3): Promise<Tournament>;
|
|
47
|
-
/**
|
|
48
|
-
* Fetch the leaderboard for a tournament.
|
|
49
|
-
*/
|
|
50
|
-
declare function getTournamentLeaderboard(baseUrl: string, tournamentId: string, ctx?: ApiContext$3): Promise<LeaderboardEntry[]>;
|
|
51
47
|
/**
|
|
52
48
|
* Fetch registrations for a tournament.
|
|
53
49
|
*/
|
|
@@ -208,4 +204,4 @@ interface ChainConfig {
|
|
|
208
204
|
declare const CHAINS: Record<string, ChainConfig>;
|
|
209
205
|
declare function getChainConfig(chain: string): ChainConfig | undefined;
|
|
210
206
|
|
|
211
|
-
export { ActivityEvent, ActivityParams, BudokanApiError, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, type ChainConfig, DataSourceError,
|
|
207
|
+
export { ActivityEvent, ActivityParams, BudokanApiError, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, type ChainConfig, DataSourceError, PaginatedResult, PlatformStats, PlayerStats, PlayerTournament, PlayerTournamentParams, Prize, PrizeAggregation, PrizeStats, QualificationEntry, Registration, RewardClaim, RewardClaimSummary, RpcError, Tournament, TournamentListParams, TournamentNotFoundError, WSEventHandler, WSManager, WSSubscribeOptions, camelToSnake, getActivity, getActivityStats, getChainConfig, getGameStats, getGameTournaments, getPlayerStats, getPlayerTournaments, getPrizeStats, getTournament, getTournamentPrizeAggregation, getTournamentPrizes, getTournamentQualifications, getTournamentRegistrations, getTournamentRewardClaims, getTournamentRewardClaimsSummary, getTournaments, normalizeAddress, snakeToCamel, withRetry };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { num, CairoCustomEnum } from 'starknet';
|
|
2
2
|
|
|
3
3
|
// src/errors/index.ts
|
|
4
4
|
var BudokanError = class extends Error {
|
|
@@ -231,6 +231,7 @@ async function getTournaments(baseUrl, params, ctx) {
|
|
|
231
231
|
sort: params?.sort,
|
|
232
232
|
from_id: params?.fromId,
|
|
233
233
|
exclude_ids: params?.excludeIds?.join(","),
|
|
234
|
+
tournament_ids: params?.tournamentIds?.join(","),
|
|
234
235
|
whitelisted_extensions: params?.whitelistedExtensions?.join(","),
|
|
235
236
|
include_prizes: params?.includePrizeSummary
|
|
236
237
|
});
|
|
@@ -250,13 +251,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
|
|
|
250
251
|
);
|
|
251
252
|
return normalizeTournament(result.data);
|
|
252
253
|
}
|
|
253
|
-
async function getTournamentLeaderboard(baseUrl, tournamentId, ctx) {
|
|
254
|
-
const result = await apiFetch(
|
|
255
|
-
`${baseUrl}/tournaments/${tournamentId}/leaderboard`,
|
|
256
|
-
fetchOpts(ctx)
|
|
257
|
-
);
|
|
258
|
-
return result.data.map((item) => snakeToCamel(item));
|
|
259
|
-
}
|
|
260
254
|
async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
|
|
261
255
|
const qs = buildQueryString({
|
|
262
256
|
player_address: params?.playerAddress,
|
|
@@ -598,15 +592,15 @@ var CHAINS = {
|
|
|
598
592
|
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
|
|
599
593
|
apiBaseUrl: "https://budokan-api-production.up.railway.app",
|
|
600
594
|
wsUrl: "wss://budokan-api-production.up.railway.app/ws",
|
|
601
|
-
budokanAddress: "
|
|
602
|
-
viewerAddress: "
|
|
595
|
+
budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
|
|
596
|
+
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
603
597
|
},
|
|
604
598
|
sepolia: {
|
|
605
599
|
rpcUrl: "https://starknet-sepolia.public.blastapi.io",
|
|
606
600
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
607
601
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
608
|
-
budokanAddress: "
|
|
609
|
-
viewerAddress: "
|
|
602
|
+
budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
|
|
603
|
+
viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
|
|
610
604
|
}
|
|
611
605
|
};
|
|
612
606
|
function getChainConfig(chain) {
|
|
@@ -4508,22 +4502,14 @@ var BudokanClient = class {
|
|
|
4508
4502
|
return budokanTournamentDistributionShares(contract, tournamentId);
|
|
4509
4503
|
}
|
|
4510
4504
|
/**
|
|
4511
|
-
* Fetch the leaderboard for a tournament
|
|
4512
|
-
*
|
|
4505
|
+
* Fetch the leaderboard for a tournament from the on-chain viewer
|
|
4506
|
+
* contract. Live leaderboard data for UIs is best sourced via
|
|
4507
|
+
* denshokan-sdk's `useLiveLeaderboard`; this method is kept for
|
|
4508
|
+
* one-shot RPC reads (e.g. server-side scoring scripts).
|
|
4513
4509
|
*/
|
|
4514
4510
|
async getTournamentLeaderboard(tournamentId) {
|
|
4515
|
-
const
|
|
4516
|
-
|
|
4517
|
-
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4518
|
-
};
|
|
4519
|
-
if (this.resolvedConfig.primarySource === "rpc") {
|
|
4520
|
-
return rpcFallback();
|
|
4521
|
-
}
|
|
4522
|
-
return withFallback(
|
|
4523
|
-
() => getTournamentLeaderboard(this.resolvedConfig.apiBaseUrl, tournamentId, this.apiCtx),
|
|
4524
|
-
rpcFallback,
|
|
4525
|
-
this.connectionStatus
|
|
4526
|
-
);
|
|
4511
|
+
const contract = await this.getViewerContract();
|
|
4512
|
+
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4527
4513
|
}
|
|
4528
4514
|
/**
|
|
4529
4515
|
* Fetch registrations for a tournament.
|
|
@@ -4767,6 +4753,6 @@ function createBudokanClient(config) {
|
|
|
4767
4753
|
return new BudokanClient(config);
|
|
4768
4754
|
}
|
|
4769
4755
|
|
|
4770
|
-
export { BudokanApiError, BudokanClient, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, ConnectionStatus, DataSourceError, RpcError, TournamentNotFoundError, WSManager, camelToSnake, createBudokanClient, getActivity, getActivityStats, getChainConfig, getGameStats, getGameTournaments, getPlayerStats, getPlayerTournaments, getPrizeStats, getTournament,
|
|
4756
|
+
export { BudokanApiError, BudokanClient, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, ConnectionStatus, DataSourceError, RpcError, TournamentNotFoundError, WSManager, camelToSnake, createBudokanClient, getActivity, getActivityStats, getChainConfig, getGameStats, getGameTournaments, getPlayerStats, getPlayerTournaments, getPrizeStats, getTournament, getTournamentPrizeAggregation, getTournamentPrizes, getTournamentQualifications, getTournamentRegistrations, getTournamentRewardClaims, getTournamentRewardClaimsSummary, getTournaments, normalizeAddress, snakeToCamel, withRetry };
|
|
4771
4757
|
//# sourceMappingURL=index.js.map
|
|
4772
4758
|
//# sourceMappingURL=index.js.map
|