@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/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-C4PUxzuO.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-C4PUxzuO.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
|
|
@@ -238,13 +238,6 @@ async function getTournament(baseUrl, tournamentId, ctx) {
|
|
|
238
238
|
);
|
|
239
239
|
return normalizeTournament(result.data);
|
|
240
240
|
}
|
|
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
241
|
async function getTournamentRegistrations(baseUrl, tournamentId, params, ctx) {
|
|
249
242
|
const qs = buildQueryString({
|
|
250
243
|
player_address: params?.playerAddress,
|
|
@@ -586,15 +579,15 @@ var CHAINS = {
|
|
|
586
579
|
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_10",
|
|
587
580
|
apiBaseUrl: "https://budokan-api-production.up.railway.app",
|
|
588
581
|
wsUrl: "wss://budokan-api-production.up.railway.app/ws",
|
|
589
|
-
budokanAddress: "
|
|
590
|
-
viewerAddress: "
|
|
582
|
+
budokanAddress: "0x0596ced030e74ebc37f33607f07ecd5a62eff22cdc4ae31fe2d724040c1bdc0b",
|
|
583
|
+
viewerAddress: "0x013c8239361fdbd7ec26db2c83f4ff270c5bba83a0bc105b4005b676ff57fdbe"
|
|
591
584
|
},
|
|
592
585
|
sepolia: {
|
|
593
586
|
rpcUrl: "https://starknet-sepolia.public.blastapi.io",
|
|
594
587
|
apiBaseUrl: "https://budokan-api-sepolia.up.railway.app",
|
|
595
588
|
wsUrl: "wss://budokan-api-sepolia.up.railway.app/ws",
|
|
596
|
-
budokanAddress: "
|
|
597
|
-
viewerAddress: "
|
|
589
|
+
budokanAddress: "0x017750a167b7c4968249d7db06dccc8b3908ef8954cb40cfe4d3c651ca0dcd1d",
|
|
590
|
+
viewerAddress: "0x03d5febe0042b943967074f4ebd850a6b5d50850cd3fb84fbd0eb66dadd9ddec"
|
|
598
591
|
}
|
|
599
592
|
};
|
|
600
593
|
function getChainConfig(chain) {
|
|
@@ -4496,22 +4489,14 @@ var BudokanClient = class {
|
|
|
4496
4489
|
return budokanTournamentDistributionShares(contract, tournamentId);
|
|
4497
4490
|
}
|
|
4498
4491
|
/**
|
|
4499
|
-
* Fetch the leaderboard for a tournament
|
|
4500
|
-
*
|
|
4492
|
+
* Fetch the leaderboard for a tournament from the on-chain viewer
|
|
4493
|
+
* contract. Live leaderboard data for UIs is best sourced via
|
|
4494
|
+
* denshokan-sdk's `useLiveLeaderboard`; this method is kept for
|
|
4495
|
+
* one-shot RPC reads (e.g. server-side scoring scripts).
|
|
4501
4496
|
*/
|
|
4502
4497
|
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
|
-
);
|
|
4498
|
+
const contract = await this.getViewerContract();
|
|
4499
|
+
return viewerLeaderboard(contract, tournamentId, 0, 1e3);
|
|
4515
4500
|
}
|
|
4516
4501
|
/**
|
|
4517
4502
|
* Fetch registrations for a tournament.
|