@provable-games/budokan-sdk 0.1.16 → 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/react.cjs CHANGED
@@ -240,13 +240,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
240
240
  );
241
241
  return normalizeTournament(result.data);
242
242
  }
243
- async function getTournamentLeaderboard(baseUrl, tournamentId, ctx) {
244
- const result = await apiFetch(
245
- `${baseUrl}/tournaments/${tournamentId}/leaderboard`,
246
- fetchOpts(ctx)
247
- );
248
- return result.data.map((item) => snakeToCamel(item));
249
- }
250
243
  async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
251
244
  const qs = buildQueryString({
252
245
  player_address: params?.playerAddress,
@@ -588,15 +581,15 @@ var CHAINS = {
588
581
  rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
589
582
  apiBaseUrl: "https://budokan-api-production.up.railway.app",
590
583
  wsUrl: "wss://budokan-api-production.up.railway.app/ws",
591
- budokanAddress: "0x0765e6f07c1a5cebe08aba7f840741242dffb1ed77ac619120501f540ec9a52a",
592
- viewerAddress: "0x0232fb32bd06e38f3555000f255c01812198418d5fced3b6246900725bf2f4d1"
584
+ budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
585
+ viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
593
586
  },
594
587
  sepolia: {
595
588
  rpcUrl: "https://starknet-sepolia.public.blastapi.io",
596
589
  apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
597
590
  wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
598
- budokanAddress: "0x0105573bf9184f0a3da78dda70a87055e6aafc7b3fb6e331732a0d25675b7be5",
599
- viewerAddress: "0x0414fe2f48db1e3598a83f017d17b4d06cec180b160141fea9244054267c1ff1"
591
+ budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
592
+ viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
600
593
  }
601
594
  };
602
595
  function getChainConfig(chain) {
@@ -4498,22 +4491,14 @@ var BudokanClient = class {
4498
4491
  return budokanTournamentDistributionShares(contract, tournamentId);
4499
4492
  }
4500
4493
  /**
4501
- * Fetch the leaderboard for a tournament.
4502
- * Supports RPC fallback when API is unavailable.
4494
+ * Fetch the leaderboard for a tournament from the on-chain viewer
4495
+ * contract. Live leaderboard data for UIs is best sourced via
4496
+ * denshokan-sdk's `useLiveLeaderboard`; this method is kept for
4497
+ * one-shot RPC reads (e.g. server-side scoring scripts).
4503
4498
  */
4504
4499
  async getTournamentLeaderboard(tournamentId) {
4505
- const rpcFallback = async () => {
4506
- const contract = await this.getViewerContract();
4507
- return viewerLeaderboard(contract, tournamentId, 0, 1e3);
4508
- };
4509
- if (this.resolvedConfig.primarySource === "rpc") {
4510
- return rpcFallback();
4511
- }
4512
- return withFallback(
4513
- () => getTournamentLeaderboard(this.resolvedConfig.apiBaseUrl, tournamentId, this.apiCtx),
4514
- rpcFallback,
4515
- this.connectionStatus
4516
- );
4500
+ const contract = await this.getViewerContract();
4501
+ return viewerLeaderboard(contract, tournamentId, 0, 1e3);
4517
4502
  }
4518
4503
  /**
4519
4504
  * Fetch registrations for a tournament.