Skip to content

Commit

Permalink
hardcoding the subgraph ids and refactoring (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hrishikesh-Thakkar authored Oct 15, 2024
1 parent e0c64b7 commit ea7dcd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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)
MOXIE_API_KEY= # API key for the moxie APIs (optional for other strategies)
12 changes: 4 additions & 8 deletions src/strategies/moxie/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}

Expand Down

0 comments on commit ea7dcd6

Please sign in to comment.