@provable-games/budokan-sdk 0.1.17 → 0.1.18
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-C4PUxzuO.d.cts} +6 -4
- package/dist/{client-CP4dxHGv.d.ts → client-C4PUxzuO.d.ts} +6 -4
- package/dist/index.cjs +10 -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 +12 -27
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +10 -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 +11 -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-C4PUxzuO.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-C4PUxzuO.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-C4PUxzuO.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-C4PUxzuO.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 {
|
|
@@ -250,13 +250,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
|
|
|
250
250
|
);
|
|
251
251
|
return normalizeTournament(result.data);
|
|
252
252
|
}
|
|
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
253
|
async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
|
|
261
254
|
const qs = buildQueryString({
|
|
262
255
|
player_address: params?.playerAddress,
|
|
@@ -598,15 +591,15 @@ var CHAINS = {
|
|
|
598
591
|
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
|
|
599
592
|
apiBaseUrl: "https://budokan-api-production.up.railway.app",
|
|
600
593
|
wsUrl: "wss://budokan-api-production.up.railway.app/ws",
|
|
601
|
-
budokanAddress: "
|
|
602
|
-
viewerAddress: "
|
|
594
|
+
budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
|
|
595
|
+
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
603
596
|
},
|
|
604
597
|
sepolia: {
|
|
605
598
|
rpcUrl: "https://starknet-sepolia.public.blastapi.io",
|
|
606
599
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
607
600
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
608
|
-
budokanAddress: "
|
|
609
|
-
viewerAddress: "
|
|
601
|
+
budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
|
|
602
|
+
viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
|
|
610
603
|
}
|
|
611
604
|
};
|
|
612
605
|
function getChainConfig(chain) {
|
|
@@ -4508,22 +4501,14 @@ var BudokanClient = class {
|
|
|
4508
4501
|
return budokanTournamentDistributionShares(contract, tournamentId);
|
|
4509
4502
|
}
|
|
4510
4503
|
/**
|
|
4511
|
-
* Fetch the leaderboard for a tournament
|
|
4512
|
-
*
|
|
4504
|
+
* Fetch the leaderboard for a tournament from the on-chain viewer
|
|
4505
|
+
* contract. Live leaderboard data for UIs is best sourced via
|
|
4506
|
+
* denshokan-sdk's `useLiveLeaderboard`; this method is kept for
|
|
4507
|
+
* one-shot RPC reads (e.g. server-side scoring scripts).
|
|
4513
4508
|
*/
|
|
4514
4509
|
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
|
-
);
|
|
4510
|
+
const contract = await this.getViewerContract();
|
|
4511
|
+
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4527
4512
|
}
|
|
4528
4513
|
/**
|
|
4529
4514
|
* Fetch registrations for a tournament.
|
|
@@ -4767,6 +4752,6 @@ function createBudokanClient(config) {
|
|
|
4767
4752
|
return new BudokanClient(config);
|
|
4768
4753
|
}
|
|
4769
4754
|
|
|
4770
|
-
export { BudokanApiError, BudokanClient, BudokanConnectionError, BudokanError, BudokanTimeoutError, CHAINS, ConnectionStatus, DataSourceError, RpcError, TournamentNotFoundError, WSManager, camelToSnake, createBudokanClient, getActivity, getActivityStats, getChainConfig, getGameStats, getGameTournaments, getPlayerStats, getPlayerTournaments, getPrizeStats, getTournament,
|
|
4755
|
+
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
4756
|
//# sourceMappingURL=index.js.map
|
|
4772
4757
|
//# sourceMappingURL=index.js.map
|