Skip to content

Commit

Permalink
Merge pull request #494 from HausDAO/sk/02052024-subgraph-migration
Browse files Browse the repository at this point in the history
updates endpoints and api keys
  • Loading branch information
skuhlmann authored May 2, 2024
2 parents 478a2d9 + cfd34f6 commit cc37975
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
6 changes: 2 additions & 4 deletions apps/admin/src/components/HomeDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
widthQuery,
} from '@daohaus/ui';
import {
GRAPH_API_KEYS,
HAUS_NETWORK_DATA,
isValidNetwork,
ValidNetwork,
Expand Down Expand Up @@ -52,10 +53,7 @@ export const HomeDashboard = () => {
daoFilter: { name_contains_nocase: debouncedSearchTerm },
memberFilter: getDelegateFilter(filterDelegate, address),
ordering: SORT_FIELDS[sortBy].ordering,
graphApiKeys: {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x64': process.env['NX_GRAPH_API_KEY_MAINNET'],
},
graphApiKeys: GRAPH_API_KEYS,
});
if (query.data?.daos && shouldUpdate) {
setDaoData(query.data.daos);
Expand Down
7 changes: 2 additions & 5 deletions apps/summon-safe/src/utils/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValidNetwork } from '@daohaus/keychain-utils';
import { GRAPH_API_KEYS, ValidNetwork } from '@daohaus/keychain-utils';
import { listDaos } from '@daohaus/moloch-v3-data';

export const fetchDaos = async (
Expand All @@ -8,10 +8,7 @@ export const fetchDaos = async (
const query = await listDaos({
networkId,
filter: { safeAddress },
graphApiKeys: {
'0x1': process.env.NX_GRAPH_API_KEY_MAINNET,
'0x64': process.env.NX_GRAPH_API_KEY_MAINNET,
},
graphApiKeys: GRAPH_API_KEYS,
});
if (query.error) {
console.error('An error has occurred', query.error);
Expand Down
17 changes: 11 additions & 6 deletions libs/keychain-utils/src/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ export const ENDPOINTS: KeychainList = {
'https://gateway.thegraph.com/api/[api-key]/subgraphs/id/GfHFdFmiSwW1PKtnDhhcxhArwtTjVuMnXxQ5XcETF1bP',
'0x5': 'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-goerli',
'0x64':
'https://gateway.thegraph.com/api/[api-key]/subgraphs/id/5oXHJGgAWTSEXHK5FGf7mcxYtk6rSz7MJV5ccvGfoW6q',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/6x9FK3iuhVFaH9sZ39m8bKB5eckax8sjxooBPNKWWK8r',
'0x89':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-polygon',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/A4su27JYXR5TkPZmiFHzzqMJnmYttfU3FyrdNBDnnu8T',
'0xa':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-optimism',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/CgH5vtz9CJPdcSmD3XEh8fCVDjQjnRwrSawg71T1ySXW',
'0xa4b1':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-arbitrum',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/GPACxuMWrrPSEJpFqupnePJNMfuArpFabrXLnWvXU2bp',
'0xaa36a7':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-sepolia-2',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/3k93SNY5Y1r4YYWEuPY9mpCm2wnGoYDKRtk82QZJ3Kvw',
'0x2105':
'https://api.studio.thegraph.com/query/36740/daohaus-v3-base/version/latest',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/7yh4eHJ4qpHEiLPAk9BXhL5YgYrTrRE6gWy8x4oHyAqW',
},
EXPLORER: {
'0x1': 'https://etherscan.io',
Expand Down Expand Up @@ -133,6 +133,11 @@ export const HAUS_RPC = {
export const GRAPH_API_KEYS = {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x64': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xaa36a7': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x2105': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xa4b1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x89': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xa': process.env['NX_GRAPH_API_KEY_MAINNET'],
};

export type PinataApiKeys = {
Expand Down
10 changes: 6 additions & 4 deletions libs/moloch-v3-fields/src/utils/fieldHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { HAUS_NETWORK_DATA, ValidNetwork } from '@daohaus/keychain-utils';
import {
GRAPH_API_KEYS,
HAUS_NETWORK_DATA,
ValidNetwork,
} from '@daohaus/keychain-utils';
import {
findMember,
FindMemberQuery,
Expand Down Expand Up @@ -155,9 +159,7 @@ export const isActiveMember = async ({
networkId: daochain,
dao: daoid,
memberAddress: address.toLowerCase(),
graphApiKeys: {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
},
graphApiKeys: GRAPH_API_KEYS,
});

if (
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10513,6 +10513,11 @@ dotenv@^16.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

dotenv@^8.0.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
Expand Down

0 comments on commit cc37975

Please sign in to comment.