Skip to content

Commit

Permalink
feat: Creates env vars to handle our subgraph API endpoints (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElRodrigote authored Aug 20, 2024
1 parent 90cfae4 commit 6ddb80a
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions packages/sdk/src/vaults/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,25 @@ export const COW_SETTLEMENT_ADDRESS_LIST: Record<ChainId, string> = {
[ChainId.ARBITRUM]: COW_SETTLEMENT_ADDRESS,
};

const STACKLY_SUBGRAPH_API_KEY =
process.env.STACKLY_SUBGRAPH_API_KEY ?? "e7b7ff845e506590498946cd6bf83bf6";
const API_BASE_URL = "https://gateway-arbitrum.network.thegraph.com/api";
const SUBGRAPH_API_KEY = process.env.STACKLY_SUBGRAPH_API_KEY ?? "";

const ETHEREUM_SUBGRAPH_ENDPOINT_URL =
process.env.ETHEREUM_SUBGRAPH_API_URL ??
`${API_BASE_URL}/${SUBGRAPH_API_KEY}/subgraphs/id/7s9rGBffUTL8kDZuxvvpuc46v44iuDarbrADBFw5uVp2`;

const GNOSIS_SUBGRAPH_ENDPOINT_URL =
process.env.GNOSIS_SUBGRAPH_API_URL ??
`${API_BASE_URL}/${SUBGRAPH_API_KEY}/subgraphs/id/9fUVQpFwzpdWS9bq5WkAnmKbNNcoBwatMR4yZq81pbbz`;

const ARBITRUM_SUBGRAPH_ENDPOINT_URL =
process.env.ARBITRUM_SUBGRAPH_API_URL ??
`${API_BASE_URL}/${SUBGRAPH_API_KEY}/subgraphs/id/D58aXwnRLfosFtRaVJAbAjjvKZ11bEsbdiDLkJJRdSC9`;

export const SUBGRAPH_ENDPOINT_LIST: Readonly<Record<string, string>> = {
[ChainId.ETHEREUM]: `https://gateway-arbitrum.network.thegraph.com/api/${STACKLY_SUBGRAPH_API_KEY}/subgraphs/id/35bL4ohk2tnXqDnrp7NSyAKW8bbUmGDapyfe2ddCxV8H`,
[ChainId.GNOSIS]: `https://gateway-arbitrum.network.thegraph.com/api/${STACKLY_SUBGRAPH_API_KEY}/subgraphs/id/72Lysd4A2kZFqMqJtPQk3zMEEBExFfXeZbkJGTx8phRL`,
[ChainId.ARBITRUM]: `https://gateway-arbitrum.network.thegraph.com/api/${STACKLY_SUBGRAPH_API_KEY}/subgraphs/id/FNmemHB6tUh7eHmJnBFKYFf27U5GUAzXnatry4ZbrF7f`,
[ChainId.ETHEREUM]: ETHEREUM_SUBGRAPH_ENDPOINT_URL,
[ChainId.GNOSIS]: GNOSIS_SUBGRAPH_ENDPOINT_URL,
[ChainId.ARBITRUM]: ARBITRUM_SUBGRAPH_ENDPOINT_URL,
};

/**
Expand Down

0 comments on commit 6ddb80a

Please sign in to comment.