Skip to content

Commit

Permalink
Merge pull request #789 from hats-finance/performance-thegraph
Browse files Browse the repository at this point in the history
performance improvements
  • Loading branch information
shayzluf authored Dec 17, 2024
2 parents 8601f95 + d3d96a1 commit eac1e7f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hats.finance/shared",
"version": "1.1.124",
"version": "1.1.125",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
11 changes: 10 additions & 1 deletion packages/shared/src/utils/vaults.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,23 @@ export const getVaultInfoWithCommittee = async (

export const getAllVaultsAddressesByChain = async (
chainId: number
): Promise<{ id: string; registered: boolean; version: IVault["version"]; claimsManager: IVault["claimsManager"] }[]> => {
): Promise<
{
id: string;
descriptionHash: string;
registered: boolean;
version: IVault["version"];
claimsManager: IVault["claimsManager"];
}[]
> => {
if (!chainId) return [];

try {
const GET_VAULTS = `
query getVaults {
vaults(where: {version_not: "v1"}) {
id
descriptionHash
registered
claimsManager
version
Expand Down
14 changes: 0 additions & 14 deletions packages/web/src/components/Seo/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ export const Seo = ({ isMainPage, title, description, image }: SeoProps) => {
image: image ?? require("../../assets/images/hats_og.png"),
};

// const allowedEndpoints = [
// "'self'",
// "https://*.hats.finance",
// "https://*.infura.io",
// "https://api.coingecko.com/",
// "https://cloudflare-eth.com/",
// new URL(stagingServiceUrl).protocol + "//" + new URL(stagingServiceUrl).host,
// new URL(prodServiceUrl).protocol + "//" + new URL(prodServiceUrl).host,
// ...Object.values(appChains).map((chain) => chain.subgraph),
// ...Object.values(appChains).map((chain) => chain.uniswapSubgraph),
// ...Object.values(externalPricingProvidersUrls),
// ];
// const connectSrc = allowedEndpoints.join(" ");

return (
<Helmet prioritizeSeoTags htmlAttributes={{ lang: "en" }} titleTemplate="%s | HatsFinance" title={seo.title}>
{isMainPage && (
Expand Down
22 changes: 0 additions & 22 deletions packages/web/src/hooks/nft/getStakerData.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { useAccount } from "wagmi";
import { parseMasters, parsePayouts, parseUserNfts, parseVaults } from "./parser";
import { IGraphVaultsData, getSubgraphData } from "./vaultsService";

const DATA_REFRESH_TIME = 30000;

const INITIAL_NETWORK_DATA = {
vaults: [] as IVault[],
masters: [] as IMaster[],
Expand All @@ -29,8 +27,7 @@ export const useMultiChainVaultsV2 = () => {
queries: Object.keys(appChains).map((chainId) => ({
queryKey: ["subgraph", chainId],
queryFn: () => getSubgraphData(+chainId, account),
// refetchInterval: DATA_REFRESH_TIME, // We dont want to refetch data automatically anymore
refetchIntervalInBackground: false,
refetchOnWindowFocus: false,
retry: false,
})),
});
Expand Down

0 comments on commit eac1e7f

Please sign in to comment.