Skip to content

Commit

Permalink
fix env var
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler17 committed Jul 25, 2024
1 parent 5ffb117 commit 9ba5547
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ GASLESS_DISABLED=false
DASHBOARD_PASSWORD=
NEXT_PUBLIC_TENDERLY_RPC_KEY=
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
SUBGRAPH_API_KEY=

# this is used to determine which database to fetch data from
NEXT_PUBLIC_VERCEL_ENV=development
4 changes: 3 additions & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type SystemConfig = {
GASLESS_DISABLED: string;
TENDERLY_RPC_KEY: string;
USE_MOCK_WALLET: string;
SUBGRAPH_API_KEY: string;
};

export const config: SystemConfig = {
Expand Down Expand Up @@ -63,5 +64,6 @@ export const config: SystemConfig = {
GASLESS_BACKDOOR_SECRET: process.env.GASLESS_BACKDOOR_SECRET || '',
GASLESS_DISABLED: process.env.GASLESS_DISABLED || '',
TENDERLY_RPC_KEY: process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY || '',
USE_MOCK_WALLET: process.env.NEXT_PUBLIC_USE_MOCK_WALLET || ''
USE_MOCK_WALLET: process.env.NEXT_PUBLIC_USE_MOCK_WALLET || '',
SUBGRAPH_API_KEY: process.env.SUBGRAPH_API_KEY || ''
};
5 changes: 3 additions & 2 deletions modules/mkr/components/MkrLiquiditySidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Tokens } from 'modules/web3/constants/tokens';
import { SupportedNetworks } from 'modules/web3/constants/networks';
import { getContracts } from 'modules/web3/helpers/getContracts';
import { networkNameToChainId } from 'modules/web3/helpers/chain';
import { config } from 'lib/config';

const aaveLendingPoolCore = '0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3';
const aaveV2Amkr = '0xc713e5E149D5D0715DcD1c156a020976e7E56B88';
Expand All @@ -33,7 +34,7 @@ const sushiswapAddress = '0xba13afecda9beb75de5c56bbaf696b880a5a50dd';
const compoundCTokenAddress = '0x95b4eF2869eBD94BEb4eEE400a99824BF5DC325b';

async function getBalancerV1Mkr(mkrAddress: string) {
const resp = await fetch(`https://gateway-arbitrum.network.thegraph.com/api/${SUBGRAPH_API_KEY}/subgraphs/id/93yusydMYauh7cfe9jEfoGABmwnX4GffHd7in8KJi1XB`, {
const resp = await fetch(`https://gateway-arbitrum.network.thegraph.com/api/${config.SUBGRAPH_API_KEY}/subgraphs/id/93yusydMYauh7cfe9jEfoGABmwnX4GffHd7in8KJi1XB`, {
method: 'post',
body: JSON.stringify({
query: `
Expand All @@ -57,7 +58,7 @@ async function getBalancerV1Mkr(mkrAddress: string) {
}

async function getBalancerV2Mkr(mkrAddress: string) {
const resp = await fetch(`https://gateway-arbitrum.network.thegraph.com/api/${SUBGRAPH_API_KEY}/subgraphs/id/C4ayEZP2yTXRAB8vSaTrgN4m9anTe9Mdm2ViyiAuV9TV`, {
const resp = await fetch(`https://gateway-arbitrum.network.thegraph.com/api/${config.SUBGRAPH_API_KEY}/subgraphs/id/C4ayEZP2yTXRAB8vSaTrgN4m9anTe9Mdm2ViyiAuV9TV`, {
method: 'post',
body: JSON.stringify({
query: `
Expand Down

0 comments on commit 9ba5547

Please sign in to comment.