From 24706483e232812abf75551a854fb8a23fea267b Mon Sep 17 00:00:00 2001 From: Hrishikesh-Thakkar Date: Tue, 15 Oct 2024 15:48:54 +0530 Subject: [PATCH] hardcoding the subgraph ids and refactoring --- .env.example | 5 +---- src/strategies/moxie/index.ts | 12 ++++-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.env.example b/.env.example index 8af16a922..09a8f8d33 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,4 @@ SNAPSHOT_API_STRATEGY_SALT=12345 # Salt for the snapshot API strategy to send a key in header (optional) PASSPORT_API_KEY= # API key for the passport API (optional for other strategies) PASSPORT_SCORER_ID= # Scorer ID for the passport API (optional for other strategies) -MOXIE_API_KEY= # API key for the moxie APIs (optional for other strategies) -MOXIE_PROTOCOL_ID= #Protocol ID for the moxie API (optional for other strategies) -MOXIE_VESTING_ID= # Vesting ID for the moxie API (optional for other strategies) -MOXIE_LIQUDITY_ID= # Liquidity ID for the moxie API (optional for other strategies) \ No newline at end of file +MOXIE_API_KEY= # API key for the moxie APIs (optional for other strategies) \ No newline at end of file diff --git a/src/strategies/moxie/index.ts b/src/strategies/moxie/index.ts index 32ee0e511..5de34bc9e 100644 --- a/src/strategies/moxie/index.ts +++ b/src/strategies/moxie/index.ts @@ -33,22 +33,18 @@ export async function strategy( throw new Error("This strategy expects a single address"); }; const MOXIE_API_KEY = process.env.MOXIE_API_KEY || ""; - const MOXIE_PROTOCOL_ID = process.env.MOXIE_PROTOCOL_ID || ""; - const MOXIE_VESTING_ID = process.env.MOXIE_VESTING_ID || ""; - const MOXIE_LIQUIDITY_ID = process.env.MOXIE_LIQUIDITY_ID || ""; + const MOXIE_PROTOCOL_ID = "7zS29h4BDSujQq8R3TFF37JfpjtPQsRUpoC9p4vo4scx"; + const MOXIE_VESTING_ID = "BuR6zAj2GSVZz6smGbJZkgQx8S6GUS881R493ZYZKSk3"; + const MOXIE_LIQUIDITY_ID = "2rv5XN3LDQiuc9BXFzUri7ZLnS6K1ZqNJzp8Zj8TqMhy"; //SETTING DEFAULT SUBGRAPH URLS let MOXIE_PROTOCOL_SUBGRAPH_URL = "https://api.studio.thegraph.com/query/88457/moxie-protocol/version/latest"; let MOXIE_VESTING_SUBGRAPH_URL = "https://api.studio.thegraph.com/query/88457/moxie-vesting/version/latest"; let MOXIE_LIQUIDITY_POOL_SUBGRAPH_URL = "https://api.studio.thegraph.com/query/88457/moxie-liquidity/version/latest"; - if (MOXIE_API_KEY !== "" && MOXIE_PROTOCOL_ID !== "") { + if (MOXIE_API_KEY !== "" ) { MOXIE_PROTOCOL_SUBGRAPH_URL = `https://gateway.thegraph.com/api/${MOXIE_API_KEY}/subgraphs/id/${MOXIE_PROTOCOL_ID}`; - } - if (MOXIE_API_KEY !== "" && MOXIE_LIQUIDITY_ID !== "") { MOXIE_LIQUIDITY_POOL_SUBGRAPH_URL = `https://gateway.thegraph.com/api/${MOXIE_API_KEY}/subgraphs/id/${MOXIE_LIQUIDITY_ID}`; - } - if (MOXIE_API_KEY !== "" && MOXIE_VESTING_ID !== "") { MOXIE_VESTING_SUBGRAPH_URL = `https://gateway.thegraph.com/api/${MOXIE_API_KEY}/subgraphs/id/${MOXIE_VESTING_ID}`; }