Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardcoding the subgraph ids and refactoring #1610

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading