@@ -17,22 +17,6 @@ export function useDebugMode(): boolean {
1717export function useAlloIndexerClient ( ) : Client {
1818 const { chainId } = useAccount ( ) ;
1919
20- return useMemo ( ( ) => {
21- if ( ! chainId ) {
22- throw new Error ( "Chain ID is not set" ) ;
23- }
24- return new Client (
25- fetch . bind ( window ) ,
26- process . env . REACT_APP_INDEXER_V2_API_URL ?? "" ,
27- chainId
28- ) ;
29- } , [ chainId ] ) ;
30- }
31-
32- // todo: remove when Huss finished the new calculator
33- export function useLegacyAlloIndexerClient ( ) : Client {
34- const { chainId } = useAccount ( ) ;
35-
3620 return useMemo ( ( ) => {
3721 if ( ! chainId ) {
3822 throw new Error ( "Chain ID is not set" ) ;
@@ -50,7 +34,7 @@ export function useRoundMatchingFunds(
5034 ignoreSaturation ?: boolean ,
5135 overrides ?: Blob
5236) {
53- const client = useLegacyAlloIndexerClient ( ) ;
37+ const client = useAlloIndexerClient ( ) ;
5438 return useSWR (
5539 [ roundId , "/matches" , overrides , ignoreSaturation ] ,
5640 ( [ roundId ] ) => {
@@ -60,14 +44,14 @@ export function useRoundMatchingFunds(
6044}
6145
6246export function useRound ( roundId : string | number ) {
63- const client = useLegacyAlloIndexerClient ( ) ;
47+ const client = useAlloIndexerClient ( ) ;
6448 return useSWR ( [ roundId , "/stats" ] , ( [ roundId ] ) => {
6549 return client . getRoundBy ( "id" , roundId ) ;
6650 } ) ;
6751}
6852
6953export function useRoundApplications ( roundId : string ) {
70- const client = useLegacyAlloIndexerClient ( ) ;
54+ const client = useAlloIndexerClient ( ) ;
7155 return useSWR ( [ roundId , "/applications" ] , ( [ roundId ] ) => {
7256 return client . getRoundApplications ( roundId ) ;
7357 } ) ;
0 commit comments