Skip to content

Commit

Permalink
Update URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Jun 2, 2024
1 parent 102a1da commit d3c319b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/hooks/useExpiryNames.tsx
Original file line number Diff line number Diff line change
@@ -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`
{
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit d3c319b

Please sign in to comment.