@provable-games/budokan-sdk 0.1.7 → 0.1.9
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-CYj1Iw_w.d.cts → client-B-QSLs81.d.cts} +1 -1
- package/dist/{client-CYj1Iw_w.d.ts → client-B-QSLs81.d.ts} +1 -1
- package/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +159 -42
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +15 -15
- package/dist/react.d.ts +15 -15
- package/dist/react.js +159 -42
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
|
@@ -349,7 +349,7 @@ declare class BudokanClient {
|
|
|
349
349
|
* Fetch a single tournament by its ID.
|
|
350
350
|
* Supports RPC fallback when API is unavailable.
|
|
351
351
|
*/
|
|
352
|
-
getTournament(tournamentId: string): Promise<Tournament>;
|
|
352
|
+
getTournament(tournamentId: string): Promise<Tournament | null>;
|
|
353
353
|
/**
|
|
354
354
|
* Fetch the leaderboard for a tournament.
|
|
355
355
|
* Supports RPC fallback when API is unavailable.
|
|
@@ -349,7 +349,7 @@ declare class BudokanClient {
|
|
|
349
349
|
* Fetch a single tournament by its ID.
|
|
350
350
|
* Supports RPC fallback when API is unavailable.
|
|
351
351
|
*/
|
|
352
|
-
getTournament(tournamentId: string): Promise<Tournament>;
|
|
352
|
+
getTournament(tournamentId: string): Promise<Tournament | null>;
|
|
353
353
|
/**
|
|
354
354
|
* Fetch the leaderboard for a tournament.
|
|
355
355
|
* Supports RPC fallback when API is unavailable.
|
package/dist/index.cjs
CHANGED
|
@@ -1124,7 +1124,9 @@ async function viewerTournamentsByPhase(contract, phase, offset, limit) {
|
|
|
1124
1124
|
async function viewerTournamentDetail(contract, tournamentId) {
|
|
1125
1125
|
return wrapRpcCall(async () => {
|
|
1126
1126
|
const result = await contract.call("tournament_detail", [tournamentId]);
|
|
1127
|
-
|
|
1127
|
+
const tournament = parseTournamentFullState(result);
|
|
1128
|
+
if (!tournament.gameAddress || tournament.gameAddress === "0x0") return null;
|
|
1129
|
+
return tournament;
|
|
1128
1130
|
}, contract.address);
|
|
1129
1131
|
}
|
|
1130
1132
|
async function viewerTournamentsBatch(contract, tournamentIds) {
|
|
@@ -2533,11 +2535,16 @@ var BudokanClient = class {
|
|
|
2533
2535
|
if (this.resolvedConfig.primarySource === "rpc") {
|
|
2534
2536
|
return rpcFallback();
|
|
2535
2537
|
}
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2538
|
+
try {
|
|
2539
|
+
return await getTournament(this.resolvedConfig.apiBaseUrl, tournamentId, this.apiCtx);
|
|
2540
|
+
} catch {
|
|
2541
|
+
try {
|
|
2542
|
+
this.connectionStatus.markApiUnavailable();
|
|
2543
|
+
return await rpcFallback();
|
|
2544
|
+
} catch {
|
|
2545
|
+
return null;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2541
2548
|
}
|
|
2542
2549
|
/**
|
|
2543
2550
|
* Fetch the leaderboard for a tournament.
|