Skip to content

Commit

Permalink
graph key
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed Jun 11, 2024
1 parent 14811b0 commit 8489511
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ jobs:
ZEROX_API: ${{ secrets.ZEROX_API }}
SMARDEX_SUBGRAPH_API_KEY: ${{ secrets.SMARDEX_SUBGRAPH_API_KEY }}
VENDOR_FINANCE: ${{ secrets.VENDOR_FINANCE }}
GRAPH_PROTOCOL: ${{ secrets.GRAPH_PROTOCOL }}
1 change: 1 addition & 0 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
ZEROX_API: process.env.ZEROX_API,
SMARDEX_SUBGRAPH_API_KEY: process.env.SMARDEX_SUBGRAPH_API_KEY,
VENDOR_FINANCE: process.env.VENDOR_FINANCE,
GRAPH_PROTOCOL: process.env.GRAPH_PROTOCOL,
// DB
DATABASE_URL: process.env.DATABASE_URL,
};
1 change: 1 addition & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ functions:
NEW_YIELDS_WEBHOOK: ${file(./env.js):NEW_YIELDS_WEBHOOK}
SMARDEX_SUBGRAPH_API_KEY: ${file(./env.js):SMARDEX_SUBGRAPH_API_KEY}
VENDOR_FINANCE: ${file(./env.js):VENDOR_FINANCE}
GRAPH_PROTOCOL: ${file(./env.js):GRAPH_PROTOCOL}

# --- data enrichment
triggerEnrichment:
Expand Down
2 changes: 1 addition & 1 deletion src/adaptors/uniswap-v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { request, gql } = require('graphql-request');

const utils = require('../utils');

const url = 'https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v2-dev';
const url = `https://gateway-arbitrum.network.thegraph.com/api/${process.env.GRAPH_PROTOCOL}/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu`;

const query = gql`
{
Expand Down
19 changes: 1 addition & 18 deletions src/adaptors/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ exports.getBlocksByTime = async (timestamps, chainString) => {
};

const getLatestBlockSubgraph = async (url) => {
// const queryGraph = gql`
// {
// indexingStatusForCurrentVersion(subgraphName: "<PLACEHOLDER>") {
// chains {
// latestBlock {
// number
// }
// }
// }
// }
// `;
const queryGraph = gql`
{
_meta {
Expand All @@ -87,11 +76,8 @@ const getLatestBlockSubgraph = async (url) => {
}
`;

// const blockGraph = await request(
// 'https://api.thegraph.com/index-node/graphql',
// queryGraph.replace('<PLACEHOLDER>', url.split('name/')[1])
// );
const blockGraph =
url.includes('https://gateway-arbitrum.network.thegraph.com/api') ||
url.includes('metis-graph.maiadao.io') ||
url.includes('babydoge/faas') ||
url.includes('kybernetwork/kyberswap-elastic-cronos') ||
Expand All @@ -112,9 +98,6 @@ const getLatestBlockSubgraph = async (url) => {
url.includes('horizondex') ||
url.includes(
'https://api.thegraph.com/subgraphs/id/QmZ5uwhnwsJXAQGYEF8qKPQ85iVhYAcVZcZAPfrF7ZNb9z'
) ||
url.includes(
'https://gateway-arbitrum.network.thegraph.com/api/a265c39f5a123ab2d40b25dc352adc22/subgraphs/id/3hCPRGf4z88VC5rsBKU5AA9FBBq5nF3jbKJG7VZCbhjm'
)
? await request(url, queryGraph)
: url.includes('aperture/uniswap-v3')
Expand Down

0 comments on commit 8489511

Please sign in to comment.