diff --git a/apis/farms/src/bindings.d.ts b/apis/farms/src/bindings.d.ts index 66be099f734b9..ec18adf6697a0 100644 --- a/apis/farms/src/bindings.d.ts +++ b/apis/farms/src/bindings.d.ts @@ -16,4 +16,5 @@ declare global { const OPBNB_NODE: string const OPBNB_TESTNET_NODE: string const NODE_REAL_SUBGRAPH_API_KEY: string + const THE_GRAPH_API_KEY: string } diff --git a/apis/farms/src/lpApr.ts b/apis/farms/src/lpApr.ts index 28811155284ff..29e46268426ee 100644 --- a/apis/farms/src/lpApr.ts +++ b/apis/farms/src/lpApr.ts @@ -26,10 +26,13 @@ const blockClientWithChain = (chainId: FarmSupportedChainId) => { } const infoClientWithChain = (chainId: FarmSupportedChainId) => { - // @ts-ignore - return new GraphQLClient(getV2Subgraphs({ noderealApiKey: NODE_REAL_SUBGRAPH_API_KEY })[chainId], { - fetch, - }) + return new GraphQLClient( + // @ts-ignore + getV2Subgraphs({ noderealApiKey: NODE_REAL_SUBGRAPH_API_KEY, theGraphApiKey: THE_GRAPH_API_KEY })[chainId], + { + fetch, + }, + ) } const stableSwapClient = new GraphQLClient(STABLESWAP_SUBGRAPH_ENDPOINT, { diff --git a/apis/farms/src/provider.ts b/apis/farms/src/provider.ts index ad31a7eecc348..da1d4db4d200b 100644 --- a/apis/farms/src/provider.ts +++ b/apis/farms/src/provider.ts @@ -26,6 +26,7 @@ const requireCheck = [ OPBNB_NODE, OPBNB_TESTNET_NODE, NODE_REAL_SUBGRAPH_API_KEY, + THE_GRAPH_API_KEY, ] const base = { diff --git a/apis/farms/src/v3.ts b/apis/farms/src/v3.ts index 0d88bdb3efe05..9dd0ccede9159 100644 --- a/apis/farms/src/v3.ts +++ b/apis/farms/src/v3.ts @@ -31,6 +31,7 @@ type SupportChainId = (typeof V3_SUBGRAPH_CLIENTS_CHAIN_IDS)[number] const V3_SUBGRAPHS = getV3Subgraphs({ noderealApiKey: NODE_REAL_SUBGRAPH_API_KEY, + theGraphApiKey: THE_GRAPH_API_KEY, }) export const V3_SUBGRAPH_CLIENTS = V3_SUBGRAPH_CLIENTS_CHAIN_IDS.reduce((acc, chainId) => { diff --git a/apis/farms/wrangler.toml b/apis/farms/wrangler.toml index 6cb164c8df4bb..be304cad5dbac 100644 --- a/apis/farms/wrangler.toml +++ b/apis/farms/wrangler.toml @@ -33,4 +33,5 @@ crons = ["0 0 * * *", "*/1 * * * *"] # - LINEA_NODE # - BASE_NODE # - NODE_REAL_SUBGRAPH_API_KEY +# - THE_GRAPH_API_KEY # Run `echo | wrangler secret put ` for each of these diff --git a/apis/routing/src/bindings.d.ts b/apis/routing/src/bindings.d.ts index f4f669e1cca8e..c3e89c87d8150 100644 --- a/apis/routing/src/bindings.d.ts +++ b/apis/routing/src/bindings.d.ts @@ -7,6 +7,7 @@ declare global { const BSC_NODE: string const BSC_TESTNET_NODE: string const NODE_REAL_SUBGRAPH_API_KEY: string + const THE_GRAPH_API_KEY: string const SUBGRAPH_POOLS: R2Bucket } diff --git a/apis/routing/src/provider.ts b/apis/routing/src/provider.ts index f7e8bf323ff7b..706919ecfd82b 100644 --- a/apis/routing/src/provider.ts +++ b/apis/routing/src/provider.ts @@ -6,7 +6,7 @@ import { GraphQLClient } from 'graphql-request' import { SupportedChainId } from './constants' -const requireCheck = [ETH_NODE, GOERLI_NODE, BSC_NODE, BSC_TESTNET_NODE, NODE_REAL_SUBGRAPH_API_KEY] +const requireCheck = [ETH_NODE, GOERLI_NODE, BSC_NODE, BSC_TESTNET_NODE, NODE_REAL_SUBGRAPH_API_KEY, THE_GRAPH_API_KEY] requireCheck.forEach((node) => { if (!node) { throw new Error('Missing env var') @@ -15,6 +15,7 @@ requireCheck.forEach((node) => { const V3_SUBGRAPHS = getV3Subgraphs({ noderealApiKey: NODE_REAL_SUBGRAPH_API_KEY, + theGraphApiKey: THE_GRAPH_API_KEY, }) const mainnetClient = createPublicClient({ diff --git a/apis/routing/wrangler.toml b/apis/routing/wrangler.toml index d53726a9e1cc1..838c42ba352e3 100644 --- a/apis/routing/wrangler.toml +++ b/apis/routing/wrangler.toml @@ -28,4 +28,5 @@ crons = ["*/30 * * * *"] # - BSC_NODE # - BSC_TESTNET_NODE # - NODE_REAL_SUBGRAPH_API_KEY +# - THE_GRAPH_API_KEY # Run `echo | wrangler secret put ` for each of these