From d3c319b043e6b5e4d9fc03130ddae29b82ab2aa3 Mon Sep 17 00:00:00 2001 From: Lucemans Date: Sun, 2 Jun 2024 08:32:05 +0000 Subject: [PATCH] Update URL --- src/hooks/useExpiryNames.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/useExpiryNames.tsx b/src/hooks/useExpiryNames.tsx index b774ef4..2c3eb98 100644 --- a/src/hooks/useExpiryNames.tsx +++ b/src/hooks/useExpiryNames.tsx @@ -1,6 +1,7 @@ import axios from "axios"; import { gql } from "graphql-request"; import useSWR from "swr"; +import { useBlockNumber, useChainId } from "wagmi"; const query = gql` { @@ -29,13 +30,16 @@ export type ExpiryNames = { }; export const useExpiryNames = () => { + const chainId = useChainId(); + const { data: block } = useBlockNumber({ chainId }); + return useSWR( - "/my/names", + "/subgrpah/" + block, async (): Promise<{ name: string; vault: string }[]> => { const x = await axios.post( // Yes, this uses a cors-anywhere bypass. This is a demo. // The streamingfast entrypoint doesnt output the right cors headers - "https://cors-anywhere.herokuapp.com/https://srv.streamingfast.io/708f83b3/graphql", + "https://cors-anywhere.herokuapp.com/https://srv.streamingfast.io/01bfe668/graphql", { query }