@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.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { m as BudokanClientConfig, B as BudokanClient, T as Tournament, b as PaginatedResult, e as TournamentListParams, q as Phase,
|
|
3
|
+
import { m as BudokanClientConfig, B as BudokanClient, T as Tournament, b as PaginatedResult, e as TournamentListParams, q as Phase, p as LeaderboardEntry, R as Registration, h as PlayerTournament, f as PlayerStats, g as PlayerTournamentParams, c as RewardClaim, d as RewardClaimSummary, k as PrizeStats, a as Prize, P as PrizeAggregation, Q as QualificationEntry, i as PlatformStats, s as WSEventMessage, r as WSChannel, C as ConnectionMode } from './client-B97mEKJc.cjs';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@provable-games/metagame-sdk';
|
|
6
6
|
|
package/dist/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { m as BudokanClientConfig, B as BudokanClient, T as Tournament, b as PaginatedResult, e as TournamentListParams, q as Phase,
|
|
3
|
+
import { m as BudokanClientConfig, B as BudokanClient, T as Tournament, b as PaginatedResult, e as TournamentListParams, q as Phase, p as LeaderboardEntry, R as Registration, h as PlayerTournament, f as PlayerStats, g as PlayerTournamentParams, c as RewardClaim, d as RewardClaimSummary, k as PrizeStats, a as Prize, P as PrizeAggregation, Q as QualificationEntry, i as PlatformStats, s as WSEventMessage, r as WSChannel, C as ConnectionMode } from './client-B97mEKJc.js';
|
|
4
4
|
import 'starknet';
|
|
5
5
|
import '@provable-games/metagame-sdk';
|
|
6
6
|
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useMemo, useRef, useEffect, useContext, useState, useCallback } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { num, CairoCustomEnum } from 'starknet';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
// src/react/context.tsx
|
|
@@ -219,6 +219,7 @@ async function getTournaments(baseUrl, params, ctx) {
|
|
|
219
219
|
sort: params?.sort,
|
|
220
220
|
from_id: params?.fromId,
|
|
221
221
|
exclude_ids: params?.excludeIds?.join(","),
|
|
222
|
+
tournament_ids: params?.tournamentIds?.join(","),
|
|
222
223
|
whitelisted_extensions: params?.whitelistedExtensions?.join(","),
|
|
223
224
|
include_prizes: params?.includePrizeSummary
|
|
224
225
|
});
|
|
@@ -238,13 +239,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
|
|
|
238
239
|
);
|
|
239
240
|
return normalizeTournament(result.data);
|
|
240
241
|
}
|
|
241
|
-
async function getTournamentLeaderboard(baseUrl, tournamentId, ctx) {
|
|
242
|
-
const result = await apiFetch(
|
|
243
|
-
`${baseUrl}/tournaments/${tournamentId}/leaderboard`,
|
|
244
|
-
fetchOpts(ctx)
|
|
245
|
-
);
|
|
246
|
-
return result.data.map((item) => snakeToCamel(item));
|
|
247
|
-
}
|
|
248
242
|
async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
|
|
249
243
|
const qs = buildQueryString({
|
|
250
244
|
player_address: params?.playerAddress,
|
|
@@ -586,15 +580,15 @@ var CHAINS = {
|
|
|
586
580
|
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
|
|
587
581
|
apiBaseUrl: "https://budokan-api-production.up.railway.app",
|
|
588
582
|
wsUrl: "wss://budokan-api-production.up.railway.app/ws",
|
|
589
|
-
budokanAddress: "
|
|
590
|
-
viewerAddress: "
|
|
583
|
+
budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
|
|
584
|
+
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
591
585
|
},
|
|
592
586
|
sepolia: {
|
|
593
587
|
rpcUrl: "https://starknet-sepolia.public.blastapi.io",
|
|
594
588
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
595
589
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
596
|
-
budokanAddress: "
|
|
597
|
-
viewerAddress: "
|
|
590
|
+
budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
|
|
591
|
+
viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
|
|
598
592
|
}
|
|
599
593
|
};
|
|
600
594
|
function getChainConfig(chain) {
|
|
@@ -4496,22 +4490,14 @@ var BudokanClient = class {
|
|
|
4496
4490
|
return budokanTournamentDistributionShares(contract, tournamentId);
|
|
4497
4491
|
}
|
|
4498
4492
|
/**
|
|
4499
|
-
* Fetch the leaderboard for a tournament
|
|
4500
|
-
*
|
|
4493
|
+
* Fetch the leaderboard for a tournament from the on-chain viewer
|
|
4494
|
+
* contract. Live leaderboard data for UIs is best sourced via
|
|
4495
|
+
* denshokan-sdk's `useLiveLeaderboard`; this method is kept for
|
|
4496
|
+
* one-shot RPC reads (e.g. server-side scoring scripts).
|
|
4501
4497
|
*/
|
|
4502
4498
|
async getTournamentLeaderboard(tournamentId) {
|
|
4503
|
-
const
|
|
4504
|
-
|
|
4505
|
-
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4506
|
-
};
|
|
4507
|
-
if (this.resolvedConfig.primarySource === "rpc") {
|
|
4508
|
-
return rpcFallback();
|
|
4509
|
-
}
|
|
4510
|
-
return withFallback(
|
|
4511
|
-
() => getTournamentLeaderboard(this.resolvedConfig.apiBaseUrl, tournamentId, this.apiCtx),
|
|
4512
|
-
rpcFallback,
|
|
4513
|
-
this.connectionStatus
|
|
4514
|
-
);
|
|
4499
|
+
const contract = await this.getViewerContract();
|
|
4500
|
+
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4515
4501
|
}
|
|
4516
4502
|
/**
|
|
4517
4503
|
* Fetch registrations for a tournament.
|