@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/react.cjs
CHANGED
|
@@ -221,6 +221,7 @@ async function getTournaments(baseUrl, params, ctx) {
|
|
|
221
221
|
sort: params?.sort,
|
|
222
222
|
from_id: params?.fromId,
|
|
223
223
|
exclude_ids: params?.excludeIds?.join(","),
|
|
224
|
+
tournament_ids: params?.tournamentIds?.join(","),
|
|
224
225
|
whitelisted_extensions: params?.whitelistedExtensions?.join(","),
|
|
225
226
|
include_prizes: params?.includePrizeSummary
|
|
226
227
|
});
|
|
@@ -240,13 +241,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
|
|
|
240
241
|
);
|
|
241
242
|
return normalizeTournament(result.data);
|
|
242
243
|
}
|
|
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
244
|
async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
|
|
251
245
|
const qs = buildQueryString({
|
|
252
246
|
player_address: params?.playerAddress,
|
|
@@ -588,15 +582,15 @@ var CHAINS = {
|
|
|
588
582
|
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
|
|
589
583
|
apiBaseUrl: "https://budokan-api-production.up.railway.app",
|
|
590
584
|
wsUrl: "wss://budokan-api-production.up.railway.app/ws",
|
|
591
|
-
budokanAddress: "
|
|
592
|
-
viewerAddress: "
|
|
585
|
+
budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
|
|
586
|
+
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
593
587
|
},
|
|
594
588
|
sepolia: {
|
|
595
589
|
rpcUrl: "https://starknet-sepolia.public.blastapi.io",
|
|
596
590
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
597
591
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
598
|
-
budokanAddress: "
|
|
599
|
-
viewerAddress: "
|
|
592
|
+
budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
|
|
593
|
+
viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
|
|
600
594
|
}
|
|
601
595
|
};
|
|
602
596
|
function getChainConfig(chain) {
|
|
@@ -4498,22 +4492,14 @@ var BudokanClient = class {
|
|
|
4498
4492
|
return budokanTournamentDistributionShares(contract, tournamentId);
|
|
4499
4493
|
}
|
|
4500
4494
|
/**
|
|
4501
|
-
* Fetch the leaderboard for a tournament
|
|
4502
|
-
*
|
|
4495
|
+
* Fetch the leaderboard for a tournament from the on-chain viewer
|
|
4496
|
+
* contract. Live leaderboard data for UIs is best sourced via
|
|
4497
|
+
* denshokan-sdk's `useLiveLeaderboard`; this method is kept for
|
|
4498
|
+
* one-shot RPC reads (e.g. server-side scoring scripts).
|
|
4503
4499
|
*/
|
|
4504
4500
|
async getTournamentLeaderboard(tournamentId) {
|
|
4505
|
-
const
|
|
4506
|
-
|
|
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
|
-
);
|
|
4501
|
+
const contract = await this.getViewerContract();
|
|
4502
|
+
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4517
4503
|
}
|
|
4518
4504
|
/**
|
|
4519
4505
|
* Fetch registrations for a tournament.
|