@provable-games/budokan-sdk 0.1.7 → 0.1.8
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 +146 -36
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +14 -14
- package/dist/react.d.ts +14 -14
- package/dist/react.js +146 -36
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.d.cts
CHANGED
|
@@ -24,7 +24,7 @@ interface UseTournamentsResult {
|
|
|
24
24
|
tournaments: PaginatedResult<Tournament> | null;
|
|
25
25
|
loading: boolean;
|
|
26
26
|
error: Error | null;
|
|
27
|
-
refetch: () => void
|
|
27
|
+
refetch: () => Promise<void>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Hook to fetch a paginated list of tournaments.
|
|
@@ -35,7 +35,7 @@ interface UseTournamentResult {
|
|
|
35
35
|
tournament: Tournament | null;
|
|
36
36
|
loading: boolean;
|
|
37
37
|
error: Error | null;
|
|
38
|
-
refetch: () => void
|
|
38
|
+
refetch: () => Promise<void>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Hook to fetch a single tournament by ID.
|
|
@@ -46,7 +46,7 @@ interface UseTournamentCountResult {
|
|
|
46
46
|
count: number | null;
|
|
47
47
|
loading: boolean;
|
|
48
48
|
error: Error | null;
|
|
49
|
-
refetch: () => void
|
|
49
|
+
refetch: () => Promise<void>;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Hook to fetch the total count of tournaments matching a phase filter.
|
|
@@ -61,7 +61,7 @@ interface UseLeaderboardResult {
|
|
|
61
61
|
leaderboard: LeaderboardEntry[] | null;
|
|
62
62
|
loading: boolean;
|
|
63
63
|
error: Error | null;
|
|
64
|
-
refetch: () => void
|
|
64
|
+
refetch: () => Promise<void>;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Hook to fetch the leaderboard for a tournament.
|
|
@@ -72,7 +72,7 @@ interface UseRegistrationsResult {
|
|
|
72
72
|
registrations: PaginatedResult<Registration> | null;
|
|
73
73
|
loading: boolean;
|
|
74
74
|
error: Error | null;
|
|
75
|
-
refetch: () => void
|
|
75
|
+
refetch: () => Promise<void>;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Hook to fetch registrations for a tournament.
|
|
@@ -97,7 +97,7 @@ interface UsePlayerStatsResult {
|
|
|
97
97
|
stats: PlayerStats | null;
|
|
98
98
|
loading: boolean;
|
|
99
99
|
error: Error | null;
|
|
100
|
-
refetch: () => void
|
|
100
|
+
refetch: () => Promise<void>;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Hook to fetch stats for a player.
|
|
@@ -107,7 +107,7 @@ interface UsePlayerTournamentsResult {
|
|
|
107
107
|
tournaments: PaginatedResult<PlayerTournament> | null;
|
|
108
108
|
loading: boolean;
|
|
109
109
|
error: Error | null;
|
|
110
|
-
refetch: () => void
|
|
110
|
+
refetch: () => Promise<void>;
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Hook to fetch tournaments a player has registered for.
|
|
@@ -118,7 +118,7 @@ interface UseRewardClaimsResult {
|
|
|
118
118
|
rewardClaims: PaginatedResult<RewardClaim> | null;
|
|
119
119
|
loading: boolean;
|
|
120
120
|
error: Error | null;
|
|
121
|
-
refetch: () => void
|
|
121
|
+
refetch: () => Promise<void>;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Hook to fetch reward claims for a tournament.
|
|
@@ -128,7 +128,7 @@ interface UseRewardClaimsSummaryResult {
|
|
|
128
128
|
summary: RewardClaimSummary | null;
|
|
129
129
|
loading: boolean;
|
|
130
130
|
error: Error | null;
|
|
131
|
-
refetch: () => void
|
|
131
|
+
refetch: () => Promise<void>;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Hook to fetch reward claims summary for a tournament.
|
|
@@ -139,7 +139,7 @@ interface UsePrizesResult {
|
|
|
139
139
|
prizes: Prize[] | null;
|
|
140
140
|
loading: boolean;
|
|
141
141
|
error: Error | null;
|
|
142
|
-
refetch: () => void
|
|
142
|
+
refetch: () => Promise<void>;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Hook to fetch prizes for a tournament.
|
|
@@ -149,7 +149,7 @@ interface UsePrizeStatsResult {
|
|
|
149
149
|
prizeStats: PrizeStats | null;
|
|
150
150
|
loading: boolean;
|
|
151
151
|
error: Error | null;
|
|
152
|
-
refetch: () => void
|
|
152
|
+
refetch: () => Promise<void>;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Hook to fetch platform-wide prize stats.
|
|
@@ -160,7 +160,7 @@ interface UsePrizeAggregationResult {
|
|
|
160
160
|
prizeAggregation: PrizeAggregation[] | null;
|
|
161
161
|
loading: boolean;
|
|
162
162
|
error: Error | null;
|
|
163
|
-
refetch: () => void
|
|
163
|
+
refetch: () => Promise<void>;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Hook to fetch prize aggregation for a tournament.
|
|
@@ -171,7 +171,7 @@ interface UseQualificationsResult {
|
|
|
171
171
|
qualifications: PaginatedResult<QualificationEntry> | null;
|
|
172
172
|
loading: boolean;
|
|
173
173
|
error: Error | null;
|
|
174
|
-
refetch: () => void
|
|
174
|
+
refetch: () => Promise<void>;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Hook to fetch qualification entries for a tournament.
|
|
@@ -182,7 +182,7 @@ interface UseActivityStatsResult {
|
|
|
182
182
|
stats: PlatformStats | null;
|
|
183
183
|
loading: boolean;
|
|
184
184
|
error: Error | null;
|
|
185
|
-
refetch: () => void
|
|
185
|
+
refetch: () => Promise<void>;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
188
|
* Hook to fetch platform-wide activity stats.
|
package/dist/react.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ interface UseTournamentsResult {
|
|
|
24
24
|
tournaments: PaginatedResult<Tournament> | null;
|
|
25
25
|
loading: boolean;
|
|
26
26
|
error: Error | null;
|
|
27
|
-
refetch: () => void
|
|
27
|
+
refetch: () => Promise<void>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Hook to fetch a paginated list of tournaments.
|
|
@@ -35,7 +35,7 @@ interface UseTournamentResult {
|
|
|
35
35
|
tournament: Tournament | null;
|
|
36
36
|
loading: boolean;
|
|
37
37
|
error: Error | null;
|
|
38
|
-
refetch: () => void
|
|
38
|
+
refetch: () => Promise<void>;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Hook to fetch a single tournament by ID.
|
|
@@ -46,7 +46,7 @@ interface UseTournamentCountResult {
|
|
|
46
46
|
count: number | null;
|
|
47
47
|
loading: boolean;
|
|
48
48
|
error: Error | null;
|
|
49
|
-
refetch: () => void
|
|
49
|
+
refetch: () => Promise<void>;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Hook to fetch the total count of tournaments matching a phase filter.
|
|
@@ -61,7 +61,7 @@ interface UseLeaderboardResult {
|
|
|
61
61
|
leaderboard: LeaderboardEntry[] | null;
|
|
62
62
|
loading: boolean;
|
|
63
63
|
error: Error | null;
|
|
64
|
-
refetch: () => void
|
|
64
|
+
refetch: () => Promise<void>;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Hook to fetch the leaderboard for a tournament.
|
|
@@ -72,7 +72,7 @@ interface UseRegistrationsResult {
|
|
|
72
72
|
registrations: PaginatedResult<Registration> | null;
|
|
73
73
|
loading: boolean;
|
|
74
74
|
error: Error | null;
|
|
75
|
-
refetch: () => void
|
|
75
|
+
refetch: () => Promise<void>;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Hook to fetch registrations for a tournament.
|
|
@@ -97,7 +97,7 @@ interface UsePlayerStatsResult {
|
|
|
97
97
|
stats: PlayerStats | null;
|
|
98
98
|
loading: boolean;
|
|
99
99
|
error: Error | null;
|
|
100
|
-
refetch: () => void
|
|
100
|
+
refetch: () => Promise<void>;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Hook to fetch stats for a player.
|
|
@@ -107,7 +107,7 @@ interface UsePlayerTournamentsResult {
|
|
|
107
107
|
tournaments: PaginatedResult<PlayerTournament> | null;
|
|
108
108
|
loading: boolean;
|
|
109
109
|
error: Error | null;
|
|
110
|
-
refetch: () => void
|
|
110
|
+
refetch: () => Promise<void>;
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Hook to fetch tournaments a player has registered for.
|
|
@@ -118,7 +118,7 @@ interface UseRewardClaimsResult {
|
|
|
118
118
|
rewardClaims: PaginatedResult<RewardClaim> | null;
|
|
119
119
|
loading: boolean;
|
|
120
120
|
error: Error | null;
|
|
121
|
-
refetch: () => void
|
|
121
|
+
refetch: () => Promise<void>;
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Hook to fetch reward claims for a tournament.
|
|
@@ -128,7 +128,7 @@ interface UseRewardClaimsSummaryResult {
|
|
|
128
128
|
summary: RewardClaimSummary | null;
|
|
129
129
|
loading: boolean;
|
|
130
130
|
error: Error | null;
|
|
131
|
-
refetch: () => void
|
|
131
|
+
refetch: () => Promise<void>;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Hook to fetch reward claims summary for a tournament.
|
|
@@ -139,7 +139,7 @@ interface UsePrizesResult {
|
|
|
139
139
|
prizes: Prize[] | null;
|
|
140
140
|
loading: boolean;
|
|
141
141
|
error: Error | null;
|
|
142
|
-
refetch: () => void
|
|
142
|
+
refetch: () => Promise<void>;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Hook to fetch prizes for a tournament.
|
|
@@ -149,7 +149,7 @@ interface UsePrizeStatsResult {
|
|
|
149
149
|
prizeStats: PrizeStats | null;
|
|
150
150
|
loading: boolean;
|
|
151
151
|
error: Error | null;
|
|
152
|
-
refetch: () => void
|
|
152
|
+
refetch: () => Promise<void>;
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Hook to fetch platform-wide prize stats.
|
|
@@ -160,7 +160,7 @@ interface UsePrizeAggregationResult {
|
|
|
160
160
|
prizeAggregation: PrizeAggregation[] | null;
|
|
161
161
|
loading: boolean;
|
|
162
162
|
error: Error | null;
|
|
163
|
-
refetch: () => void
|
|
163
|
+
refetch: () => Promise<void>;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* Hook to fetch prize aggregation for a tournament.
|
|
@@ -171,7 +171,7 @@ interface UseQualificationsResult {
|
|
|
171
171
|
qualifications: PaginatedResult<QualificationEntry> | null;
|
|
172
172
|
loading: boolean;
|
|
173
173
|
error: Error | null;
|
|
174
|
-
refetch: () => void
|
|
174
|
+
refetch: () => Promise<void>;
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Hook to fetch qualification entries for a tournament.
|
|
@@ -182,7 +182,7 @@ interface UseActivityStatsResult {
|
|
|
182
182
|
stats: PlatformStats | null;
|
|
183
183
|
loading: boolean;
|
|
184
184
|
error: Error | null;
|
|
185
|
-
refetch: () => void
|
|
185
|
+
refetch: () => Promise<void>;
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
188
|
* Hook to fetch platform-wide activity stats.
|
package/dist/react.js
CHANGED
|
@@ -2819,11 +2819,18 @@ function useTournaments(params) {
|
|
|
2819
2819
|
const [error, setError] = useState(null);
|
|
2820
2820
|
const paramsKey = JSON.stringify(params);
|
|
2821
2821
|
useResetOnClient(client, setTournaments, setError);
|
|
2822
|
-
const fetch2 = useCallback(() => {
|
|
2822
|
+
const fetch2 = useCallback(async () => {
|
|
2823
2823
|
if (params === void 0) return;
|
|
2824
2824
|
setLoading(true);
|
|
2825
2825
|
setError(null);
|
|
2826
|
-
|
|
2826
|
+
try {
|
|
2827
|
+
const result = await client.getTournaments(params);
|
|
2828
|
+
setTournaments(result);
|
|
2829
|
+
} catch (e) {
|
|
2830
|
+
setError(e);
|
|
2831
|
+
} finally {
|
|
2832
|
+
setLoading(false);
|
|
2833
|
+
}
|
|
2827
2834
|
}, [client, paramsKey]);
|
|
2828
2835
|
useEffect(() => {
|
|
2829
2836
|
fetch2();
|
|
@@ -2836,11 +2843,18 @@ function useTournament(tournamentId) {
|
|
|
2836
2843
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
2837
2844
|
const [error, setError] = useState(null);
|
|
2838
2845
|
useResetOnClient(client, setTournament, setError);
|
|
2839
|
-
const fetch2 = useCallback(() => {
|
|
2846
|
+
const fetch2 = useCallback(async () => {
|
|
2840
2847
|
if (!tournamentId) return;
|
|
2841
2848
|
setLoading(true);
|
|
2842
2849
|
setError(null);
|
|
2843
|
-
|
|
2850
|
+
try {
|
|
2851
|
+
const data = await client.getTournament(tournamentId);
|
|
2852
|
+
setTournament(data);
|
|
2853
|
+
} catch (e) {
|
|
2854
|
+
setError(e);
|
|
2855
|
+
} finally {
|
|
2856
|
+
setLoading(false);
|
|
2857
|
+
}
|
|
2844
2858
|
}, [client, tournamentId]);
|
|
2845
2859
|
useEffect(() => {
|
|
2846
2860
|
fetch2();
|
|
@@ -2853,10 +2867,17 @@ function useTournamentCount(phase) {
|
|
|
2853
2867
|
const [loading, setLoading] = useState(true);
|
|
2854
2868
|
const [error, setError] = useState(null);
|
|
2855
2869
|
useResetOnClient(client, setCount, setError);
|
|
2856
|
-
const fetch2 = useCallback(() => {
|
|
2870
|
+
const fetch2 = useCallback(async () => {
|
|
2857
2871
|
setLoading(true);
|
|
2858
2872
|
setError(null);
|
|
2859
|
-
|
|
2873
|
+
try {
|
|
2874
|
+
const result = await client.getTournaments({ phase, limit: 1 });
|
|
2875
|
+
setCount(result.total ?? 0);
|
|
2876
|
+
} catch (e) {
|
|
2877
|
+
setError(e);
|
|
2878
|
+
} finally {
|
|
2879
|
+
setLoading(false);
|
|
2880
|
+
}
|
|
2860
2881
|
}, [client, phase]);
|
|
2861
2882
|
useEffect(() => {
|
|
2862
2883
|
fetch2();
|
|
@@ -2869,11 +2890,18 @@ function usePlayerTournamentCount(address, phase) {
|
|
|
2869
2890
|
const [loading, setLoading] = useState(!!address);
|
|
2870
2891
|
const [error, setError] = useState(null);
|
|
2871
2892
|
useResetOnClient(client, setCount, setError);
|
|
2872
|
-
const fetch2 = useCallback(() => {
|
|
2893
|
+
const fetch2 = useCallback(async () => {
|
|
2873
2894
|
if (!address) return;
|
|
2874
2895
|
setLoading(true);
|
|
2875
2896
|
setError(null);
|
|
2876
|
-
|
|
2897
|
+
try {
|
|
2898
|
+
const result = await client.getPlayerTournaments(address, { phase, limit: 1 });
|
|
2899
|
+
setCount(result.total ?? 0);
|
|
2900
|
+
} catch (e) {
|
|
2901
|
+
setError(e);
|
|
2902
|
+
} finally {
|
|
2903
|
+
setLoading(false);
|
|
2904
|
+
}
|
|
2877
2905
|
}, [client, address, phase]);
|
|
2878
2906
|
useEffect(() => {
|
|
2879
2907
|
fetch2();
|
|
@@ -2886,11 +2914,18 @@ function useLeaderboard(tournamentId) {
|
|
|
2886
2914
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
2887
2915
|
const [error, setError] = useState(null);
|
|
2888
2916
|
useResetOnClient(client, setLeaderboard, setError);
|
|
2889
|
-
const fetch2 = useCallback(() => {
|
|
2917
|
+
const fetch2 = useCallback(async () => {
|
|
2890
2918
|
if (!tournamentId) return;
|
|
2891
2919
|
setLoading(true);
|
|
2892
2920
|
setError(null);
|
|
2893
|
-
|
|
2921
|
+
try {
|
|
2922
|
+
const result = await client.getTournamentLeaderboard(tournamentId);
|
|
2923
|
+
setLeaderboard(result);
|
|
2924
|
+
} catch (e) {
|
|
2925
|
+
setError(e);
|
|
2926
|
+
} finally {
|
|
2927
|
+
setLoading(false);
|
|
2928
|
+
}
|
|
2894
2929
|
}, [client, tournamentId]);
|
|
2895
2930
|
useEffect(() => {
|
|
2896
2931
|
fetch2();
|
|
@@ -2904,11 +2939,18 @@ function useRegistrations(tournamentId, params) {
|
|
|
2904
2939
|
const [error, setError] = useState(null);
|
|
2905
2940
|
useResetOnClient(client, setRegistrations, setError);
|
|
2906
2941
|
const paramsKey = JSON.stringify(params);
|
|
2907
|
-
const fetch2 = useCallback(() => {
|
|
2942
|
+
const fetch2 = useCallback(async () => {
|
|
2908
2943
|
if (!tournamentId) return;
|
|
2909
2944
|
setLoading(true);
|
|
2910
2945
|
setError(null);
|
|
2911
|
-
|
|
2946
|
+
try {
|
|
2947
|
+
const result = await client.getTournamentRegistrations(tournamentId, params);
|
|
2948
|
+
setRegistrations(result);
|
|
2949
|
+
} catch (e) {
|
|
2950
|
+
setError(e);
|
|
2951
|
+
} finally {
|
|
2952
|
+
setLoading(false);
|
|
2953
|
+
}
|
|
2912
2954
|
}, [client, tournamentId, paramsKey]);
|
|
2913
2955
|
useEffect(() => {
|
|
2914
2956
|
fetch2();
|
|
@@ -2922,17 +2964,22 @@ function usePlayer(address) {
|
|
|
2922
2964
|
const [loading, setLoading] = useState(!!address);
|
|
2923
2965
|
const [error, setError] = useState(null);
|
|
2924
2966
|
useResetOnClient(client, setTournaments, setStats, setError);
|
|
2925
|
-
const fetch2 = useCallback(() => {
|
|
2967
|
+
const fetch2 = useCallback(async () => {
|
|
2926
2968
|
if (!address) return;
|
|
2927
2969
|
setLoading(true);
|
|
2928
2970
|
setError(null);
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2971
|
+
try {
|
|
2972
|
+
const [tournamentsResult, statsResult] = await Promise.all([
|
|
2973
|
+
client.getPlayerTournaments(address),
|
|
2974
|
+
client.getPlayerStats(address)
|
|
2975
|
+
]);
|
|
2933
2976
|
setTournaments(tournamentsResult);
|
|
2934
2977
|
setStats(statsResult);
|
|
2935
|
-
}
|
|
2978
|
+
} catch (e) {
|
|
2979
|
+
setError(e);
|
|
2980
|
+
} finally {
|
|
2981
|
+
setLoading(false);
|
|
2982
|
+
}
|
|
2936
2983
|
}, [client, address]);
|
|
2937
2984
|
useEffect(() => {
|
|
2938
2985
|
fetch2();
|
|
@@ -2945,11 +2992,18 @@ function usePlayerStats(address) {
|
|
|
2945
2992
|
const [loading, setLoading] = useState(!!address);
|
|
2946
2993
|
const [error, setError] = useState(null);
|
|
2947
2994
|
useResetOnClient(client, setStats, setError);
|
|
2948
|
-
const fetch2 = useCallback(() => {
|
|
2995
|
+
const fetch2 = useCallback(async () => {
|
|
2949
2996
|
if (!address) return;
|
|
2950
2997
|
setLoading(true);
|
|
2951
2998
|
setError(null);
|
|
2952
|
-
|
|
2999
|
+
try {
|
|
3000
|
+
const result = await client.getPlayerStats(address);
|
|
3001
|
+
setStats(result);
|
|
3002
|
+
} catch (e) {
|
|
3003
|
+
setError(e);
|
|
3004
|
+
} finally {
|
|
3005
|
+
setLoading(false);
|
|
3006
|
+
}
|
|
2953
3007
|
}, [client, address]);
|
|
2954
3008
|
useEffect(() => {
|
|
2955
3009
|
fetch2();
|
|
@@ -2963,11 +3017,18 @@ function usePlayerTournaments(address, params) {
|
|
|
2963
3017
|
const [error, setError] = useState(null);
|
|
2964
3018
|
useResetOnClient(client, setTournaments, setError);
|
|
2965
3019
|
const paramsKey = JSON.stringify(params);
|
|
2966
|
-
const fetch2 = useCallback(() => {
|
|
3020
|
+
const fetch2 = useCallback(async () => {
|
|
2967
3021
|
if (!address) return;
|
|
2968
3022
|
setLoading(true);
|
|
2969
3023
|
setError(null);
|
|
2970
|
-
|
|
3024
|
+
try {
|
|
3025
|
+
const result = await client.getPlayerTournaments(address, params);
|
|
3026
|
+
setTournaments(result);
|
|
3027
|
+
} catch (e) {
|
|
3028
|
+
setError(e);
|
|
3029
|
+
} finally {
|
|
3030
|
+
setLoading(false);
|
|
3031
|
+
}
|
|
2971
3032
|
}, [client, address, paramsKey]);
|
|
2972
3033
|
useEffect(() => {
|
|
2973
3034
|
fetch2();
|
|
@@ -2980,11 +3041,18 @@ function useRewardClaims(tournamentId) {
|
|
|
2980
3041
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
2981
3042
|
const [error, setError] = useState(null);
|
|
2982
3043
|
useResetOnClient(client, setRewardClaims, setError);
|
|
2983
|
-
const fetch2 = useCallback(() => {
|
|
3044
|
+
const fetch2 = useCallback(async () => {
|
|
2984
3045
|
if (!tournamentId) return;
|
|
2985
3046
|
setLoading(true);
|
|
2986
3047
|
setError(null);
|
|
2987
|
-
|
|
3048
|
+
try {
|
|
3049
|
+
const result = await client.getTournamentRewardClaims(tournamentId);
|
|
3050
|
+
setRewardClaims(result);
|
|
3051
|
+
} catch (e) {
|
|
3052
|
+
setError(e);
|
|
3053
|
+
} finally {
|
|
3054
|
+
setLoading(false);
|
|
3055
|
+
}
|
|
2988
3056
|
}, [client, tournamentId]);
|
|
2989
3057
|
useEffect(() => {
|
|
2990
3058
|
fetch2();
|
|
@@ -2997,11 +3065,18 @@ function useRewardClaimsSummary(tournamentId) {
|
|
|
2997
3065
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
2998
3066
|
const [error, setError] = useState(null);
|
|
2999
3067
|
useResetOnClient(client, setSummary, setError);
|
|
3000
|
-
const fetch2 = useCallback(() => {
|
|
3068
|
+
const fetch2 = useCallback(async () => {
|
|
3001
3069
|
if (!tournamentId) return;
|
|
3002
3070
|
setLoading(true);
|
|
3003
3071
|
setError(null);
|
|
3004
|
-
|
|
3072
|
+
try {
|
|
3073
|
+
const result = await client.getTournamentRewardClaimsSummary(tournamentId);
|
|
3074
|
+
setSummary(result);
|
|
3075
|
+
} catch (e) {
|
|
3076
|
+
setError(e);
|
|
3077
|
+
} finally {
|
|
3078
|
+
setLoading(false);
|
|
3079
|
+
}
|
|
3005
3080
|
}, [client, tournamentId]);
|
|
3006
3081
|
useEffect(() => {
|
|
3007
3082
|
fetch2();
|
|
@@ -3014,11 +3089,18 @@ function usePrizes(tournamentId) {
|
|
|
3014
3089
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
3015
3090
|
const [error, setError] = useState(null);
|
|
3016
3091
|
useResetOnClient(client, setPrizes, setError);
|
|
3017
|
-
const fetch2 = useCallback(() => {
|
|
3092
|
+
const fetch2 = useCallback(async () => {
|
|
3018
3093
|
if (!tournamentId) return;
|
|
3019
3094
|
setLoading(true);
|
|
3020
3095
|
setError(null);
|
|
3021
|
-
|
|
3096
|
+
try {
|
|
3097
|
+
const result = await client.getTournamentPrizes(tournamentId);
|
|
3098
|
+
setPrizes(result);
|
|
3099
|
+
} catch (e) {
|
|
3100
|
+
setError(e);
|
|
3101
|
+
} finally {
|
|
3102
|
+
setLoading(false);
|
|
3103
|
+
}
|
|
3022
3104
|
}, [client, tournamentId]);
|
|
3023
3105
|
useEffect(() => {
|
|
3024
3106
|
fetch2();
|
|
@@ -3031,10 +3113,17 @@ function usePrizeStats() {
|
|
|
3031
3113
|
const [loading, setLoading] = useState(true);
|
|
3032
3114
|
const [error, setError] = useState(null);
|
|
3033
3115
|
useResetOnClient(client, setPrizeStats, setError);
|
|
3034
|
-
const fetch2 = useCallback(() => {
|
|
3116
|
+
const fetch2 = useCallback(async () => {
|
|
3035
3117
|
setLoading(true);
|
|
3036
3118
|
setError(null);
|
|
3037
|
-
|
|
3119
|
+
try {
|
|
3120
|
+
const result = await client.getPrizeStats();
|
|
3121
|
+
setPrizeStats(result);
|
|
3122
|
+
} catch (e) {
|
|
3123
|
+
setError(e);
|
|
3124
|
+
} finally {
|
|
3125
|
+
setLoading(false);
|
|
3126
|
+
}
|
|
3038
3127
|
}, [client]);
|
|
3039
3128
|
useEffect(() => {
|
|
3040
3129
|
fetch2();
|
|
@@ -3047,11 +3136,18 @@ function usePrizeAggregation(tournamentId) {
|
|
|
3047
3136
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
3048
3137
|
const [error, setError] = useState(null);
|
|
3049
3138
|
useResetOnClient(client, setPrizeAggregation, setError);
|
|
3050
|
-
const fetch2 = useCallback(() => {
|
|
3139
|
+
const fetch2 = useCallback(async () => {
|
|
3051
3140
|
if (!tournamentId) return;
|
|
3052
3141
|
setLoading(true);
|
|
3053
3142
|
setError(null);
|
|
3054
|
-
|
|
3143
|
+
try {
|
|
3144
|
+
const result = await client.getTournamentPrizeAggregation(tournamentId);
|
|
3145
|
+
setPrizeAggregation(result);
|
|
3146
|
+
} catch (e) {
|
|
3147
|
+
setError(e);
|
|
3148
|
+
} finally {
|
|
3149
|
+
setLoading(false);
|
|
3150
|
+
}
|
|
3055
3151
|
}, [client, tournamentId]);
|
|
3056
3152
|
useEffect(() => {
|
|
3057
3153
|
fetch2();
|
|
@@ -3064,11 +3160,18 @@ function useQualifications(tournamentId) {
|
|
|
3064
3160
|
const [loading, setLoading] = useState(!!tournamentId);
|
|
3065
3161
|
const [error, setError] = useState(null);
|
|
3066
3162
|
useResetOnClient(client, setQualifications, setError);
|
|
3067
|
-
const fetch2 = useCallback(() => {
|
|
3163
|
+
const fetch2 = useCallback(async () => {
|
|
3068
3164
|
if (!tournamentId) return;
|
|
3069
3165
|
setLoading(true);
|
|
3070
3166
|
setError(null);
|
|
3071
|
-
|
|
3167
|
+
try {
|
|
3168
|
+
const result = await client.getTournamentQualifications(tournamentId);
|
|
3169
|
+
setQualifications(result);
|
|
3170
|
+
} catch (e) {
|
|
3171
|
+
setError(e);
|
|
3172
|
+
} finally {
|
|
3173
|
+
setLoading(false);
|
|
3174
|
+
}
|
|
3072
3175
|
}, [client, tournamentId]);
|
|
3073
3176
|
useEffect(() => {
|
|
3074
3177
|
fetch2();
|
|
@@ -3081,10 +3184,17 @@ function useActivityStats() {
|
|
|
3081
3184
|
const [loading, setLoading] = useState(true);
|
|
3082
3185
|
const [error, setError] = useState(null);
|
|
3083
3186
|
useResetOnClient(client, setStats, setError);
|
|
3084
|
-
const fetch2 = useCallback(() => {
|
|
3187
|
+
const fetch2 = useCallback(async () => {
|
|
3085
3188
|
setLoading(true);
|
|
3086
3189
|
setError(null);
|
|
3087
|
-
|
|
3190
|
+
try {
|
|
3191
|
+
const result = await client.getActivityStats();
|
|
3192
|
+
setStats(result);
|
|
3193
|
+
} catch (e) {
|
|
3194
|
+
setError(e);
|
|
3195
|
+
} finally {
|
|
3196
|
+
setLoading(false);
|
|
3197
|
+
}
|
|
3088
3198
|
}, [client]);
|
|
3089
3199
|
useEffect(() => {
|
|
3090
3200
|
fetch2();
|