Skip to content

Commit

Permalink
Fix Environment Variables Issue (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham authored Jul 26, 2023
1 parent 225f168 commit b1678c5
Show file tree
Hide file tree
Showing 19 changed files with 105 additions and 86 deletions.
31 changes: 31 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# For marketing sites
SENDINBLUE_API_KEY="<SENDINBLUE_API_KEY>"

PRIVACY_POLICY_PAGE_ID="<YOUR_PRIVACY_POLICY_PAGE_ID>"
Expand All @@ -10,3 +11,33 @@ NOTION_BLOG_INTEGRATION_POSTS_DATABASE_ID="<NOTION_BLOG_INTEGRATION_POSTS_DATABA
NOTION_BLOG_INTEGRATION_TOKEN="<NOTION_BLOG_INTEGRATION_TOKEN>"
NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID="<NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID>"
NOTION_API_KEY="<NOTION_API_KEY>"

# Faucet DApp
NEXT_PUBLIC_AMOUNT="20"
NEXT_PUBLIC_FAUCET_BACKEND_URL="http://127.0.0.1:8000"
NEXT_PUBLIC_TWITTER_CLIENT_ID="<YOUR_TWITTER_CLIENT_ID>"
TWITTER_CLIENT_SECRET="<YOUR_TWITTER_CLIENT_SECRET>"

# Bridge DApp
# Make sure all the env vars of bridge DApp prefixed with BRIDGE_DAPP
# because webpack will load and expose them to the browser
BRIDGE_DAPP_DOMAIN=http:localhost:3000

BRIDGE_DAPP_POLKADOT_TEST_ACCOUNT_ADDRESS="<YOUR_BRIDGE_DAPP_POLKADOT_TEST_ACCOUNT_ADDRESS>"

BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID="<BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID>"

# If you want to enable the local orbit integration,
# you need to set the local anchor addresses of the local orbit instance
BRIDGE_DAPP_LOCAL_ORBIT_ANCHOR_ADDRESS=""

# If you want to support Multicall3 contract for Orbit chains
BRIDGE_DAPP_LOCAL_ORBIT_MULTICALL3_ADDRESS=""
BRIDGE_DAPP_LOCAL_ATHENA_MULTICALL3_DEPLOYMENT_BLOCK=0
BRIDGE_DAPP_LOCAL_HERMES_MULTICALL3_DEPLOYMENT_BLOCK=0
BRIDGE_DAPP_LOCAL_DEMETER_MULTICALL3_DEPLOYMENT_BLOCK=0

BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS=""
BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=0
BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=0
BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=0
16 changes: 9 additions & 7 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@ jobs:
touch .env
echo PRIVACY_POLICY_PAGE_ID=${{ secrets.PRIVACY_POLICY_PAGE_ID }} >> .env
echo TERMS_AND_CONDITIONS_PAGE_ID=${{ secrets.TERMS_AND_CONDITIONS_PAGE_ID }} >> .env
echo NOTION_TOKEN_V2=${{ secrets.NOTION_TOKEN_V2 }} >> .env
echo NOTION_ACTIVE_USER=${{ secrets.NOTION_ACTIVE_USER }} >> .env
echo NOTION_BLOG_INTEGRATION_POSTS_DATABASE_ID=${{ secrets.NOTION_BLOG_INTEGRATION_POSTS_DATABASE_ID }} >> .env
echo NOTION_BLOG_INTEGRATION_TOKEN=${{ secrets.NOTION_BLOG_INTEGRATION_TOKEN }} >> .env
echo NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID=${{ secrets.NOTION_BLOG_INTEGRATION_VIDEOS_DATABASE_ID }} >> .env
echo NEXT_PUBLIC_FAUCET_BACKEND_URL=${{ secrets.NEXT_PUBLIC_FAUCET_BACKEND_URL }} >> .env
echo NEXT_PUBLIC_TWITTER_CLIENT_ID=${{ secrets.NEXT_PUBLIC_TWITTER_CLIENT_ID }} >> .env
echo TWITTER_CLIENT_SECRET=${{ secrets.TWITTER_CLIENT_SECRET }} >> .env
touch apps/bridge-dapp/.env
echo NX_BRIDGE_APP_DOMAIN=${{ secrets.NX_BRIDGE_APP_DOMAIN }} >> apps/bridge-dapp/.env
echo WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }} >> apps/bridge-dapp/.env
echo HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> apps/bridge-dapp/.env
echo ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo BRIDGE_DAPP_DOMAIN=${{ secrets.BRIDGE_DAPP_DOMAIN }} >> .env
echo BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID=${{ secrets.BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID }} >> .env
echo BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> .env
echo BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
- name: Install deps
run: yarn install
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/deploy-bridge-dapp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:

- name: create env file
run: |
touch apps/bridge-dapp/.env
echo NX_BRIDGE_APP_DOMAIN=${{ secrets.NX_BRIDGE_APP_DOMAIN }} >> apps/bridge-dapp/.env
echo WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }} >> apps/bridge-dapp/.env
echo HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> apps/bridge-dapp/.env
echo ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
touch .env
echo BRIDGE_DAPP_DOMAIN=${{ secrets.BRIDGE_DAPP_DOMAIN }} >> .env
echo BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID=${{ secrets.BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID }} >> .env
echo BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> .env
echo BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
- name: Build project
run: yarn build:bridge
Expand All @@ -56,7 +56,9 @@ jobs:
args: deploy context=deploy-preview site=$NETLIFY_BRIDGE_SITE_ID --dir=./dist/apps/bridge-dapp/

- name: Netlify Preview URL
uses: unsplash/[email protected]
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ jobs:
echo "NETLIFY_LOGS_URL=$LOGS_URL" >> $GITHUB_OUTPUT
- name: Netlify Preview URL
uses: unsplash/[email protected]
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSG: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy-hubble-stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
echo "NETLIFY_LOGS_URL=$LOGS_URL" >> $GITHUB_OUTPUT
- name: Netlify Preview URL
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-stats-dapp-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:
args: deploy context=deploy-preview site=$NETLIFY_SITE_ID --dir=./dist/apps/stats-dapp/

- name: Netlify Preview URL
uses: unsplash/[email protected]
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OUTPUT: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-tangle-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ jobs:
echo "NETLIFY_LOGS_URL=$LOGS_URL" >> $GITHUB_OUTPUT
- name: Netlify Preview URL
uses: unsplash/[email protected]
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSG: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-webbsite-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ jobs:
echo "NETLIFY_LOGS_URL=$LOGS_URL" >> $GITHUB_OUTPUT
- name: Netlify Preview URL
uses: unsplash/[email protected]
# Use master branch to fix issue with entrypoint.sh script
# https://github.com/unsplash/comment-on-pr/issues/51
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSG: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ jobs:
echo NEXT_PUBLIC_TWITTER_CLIENT_ID=${{ secrets.NEXT_PUBLIC_TWITTER_CLIENT_ID }} >> .env
echo TWITTER_CLIENT_SECRET=${{ secrets.TWITTER_CLIENT_SECRET }} >> .env
touch apps/bridge-dapp/.env
echo NX_BRIDGE_APP_DOMAIN=${{ secrets.NX_BRIDGE_APP_DOMAIN }} >> apps/bridge-dapp/.env
echo WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }} >> apps/bridge-dapp/.env
echo HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> apps/bridge-dapp/.env
echo ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
echo DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> apps/bridge-dapp/.env
touch .env
echo BRIDGE_DAPP_DOMAIN=${{ secrets.BRIDGE_DAPP_DOMAIN }} >> .env
echo BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID=${{ secrets.BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID }} >> .env
echo BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS=${{ secrets.BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS }} >> .env
echo BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
echo BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK=${{ secrets.BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK }} >> .env
- name: Install deps
run: yarn install
Expand Down
23 changes: 0 additions & 23 deletions apps/bridge-dapp/.env.example

This file was deleted.

2 changes: 1 addition & 1 deletion apps/bridge-dapp/scripts/localSubstrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const NATIVE_ASSET = 'tTNT';

const FUNGIBLE_ASSET = 'webbtTNT';

const TEST_ACCOUNT = process.env.POLKADOT_TEST_ACCOUNT_ADDRESS;
const TEST_ACCOUNT = process.env.BRIDGE_DAPP_POLKADOT_TEST_ACCOUNT_ADDRESS;

const AMOUNT = 1_000_000;

Expand Down
2 changes: 1 addition & 1 deletion apps/bridge-dapp/scripts/localTangle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const NATIVE_ASSET = 'tTNT';

const FUNGIBLE_ASSET = 'webbtTNT';

const TEST_ACCOUNT = process.env.POLKADOT_TEST_ACCOUNT_ADDRESS;
const TEST_ACCOUNT = process.env.BRIDGE_DAPP_POLKADOT_TEST_ACCOUNT_ADDRESS;

const AMOUNT = 1_000_000;

Expand Down
2 changes: 1 addition & 1 deletion apps/bridge-dapp/src/constants/signIn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const domain = process.env.NX_BRIDGE_APP_DOMAIN ?? 'localhost';
const domain = process.env.BRIDGE_DAPP_DOMAIN ?? 'localhost';

const origin = `http${domain === 'localhost' ? '' : 's'}://${domain}/login`;

Expand Down
16 changes: 7 additions & 9 deletions apps/bridge-dapp/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ function createWebpack(env, mode = 'production') {
]
: [];

const envPath = path.resolve(
workspaceRoot,
'apps',
process.env.NX_TASK_TARGET_PROJECT,
'.env'
);

const bridgeEnvVars =
require('dotenv').config({ path: envPath }).parsed || {};
// Load bridge dapp specific env vars by prefixing with BRIDGE_DAPP_
const bridgeEnvVars = Object.keys(process.env)
.filter((key) => key.startsWith('BRIDGE_DAPP_'))
.reduce((envVars, key) => {
envVars[key] = JSON.stringify(process.env[key]);
return envVars;
}, {});

return {
experiments: {
Expand Down
4 changes: 0 additions & 4 deletions apps/faucet/.env.local.example

This file was deleted.

4 changes: 2 additions & 2 deletions libs/dapp-config/src/anchors/anchor-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import {
} from '@webb-tools/sdk-core/typed-chain-id';
import { LOCALNET_CHAIN_IDS } from '../chains';

const localAnchorRecord = process.env.LOCAL_ORBIT_ANCHOR_ADDRESS
const localAnchorRecord = process.env.BRIDGE_DAPP_LOCAL_ORBIT_ANCHOR_ADDRESS
? LOCALNET_CHAIN_IDS.reduce<Record<number, Record<string, number>>>(
(acc, chainId) => {
const typedChainId = calculateTypedChainId(ChainType.EVM, chainId);
const anchorAddress: string = process.env
.LOCAL_ORBIT_ANCHOR_ADDRESS as string;
.BRIDGE_DAPP_LOCAL_ORBIT_ANCHOR_ADDRESS as string;

acc[typedChainId] = {
[anchorAddress]: 0,
Expand Down
29 changes: 15 additions & 14 deletions libs/dapp-config/src/chains/evm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,39 @@ import { DEFAULT_EVM_CURRENCY } from '../../currencies';
import { ChainConfig, WebbExtendedChain } from '../chain-config.interface';

const hostedOrbitMulticall3Address =
process.env.HOSTED_ORBIT_MULTLICALL3_ADDRESS;
process.env.BRIDGE_DAPP_HOSTED_ORBIT_MULTLICALL3_ADDRESS;

const athenaOrbitMulticall3DeploymentBlock = process.env
.ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_ATHENA_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

const hermesOrbitMulticall3DeploymentBlock = process.env
.HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_HERMES_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

const demeterOrbitMulticall3DeploymentBlock = process.env
.DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_DEMETER_ORBIT_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

const localOrbitMulticall3Address = process.env.LOCAL_ORBIT_MULTICALL3_ADDRESS;
const localOrbitMulticall3Address =
process.env.BRIDGE_DAPP_LOCAL_ORBIT_MULTICALL3_ADDRESS;

const localAthenaMulticall3DeploymentBlock = process.env
.LOCAL_ATHENA_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.LOCAL_ATHENA_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_LOCAL_ATHENA_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_LOCAL_ATHENA_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

const localHermesMulticall3DeploymentBlock = process.env
.LOCAL_HERMES_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.LOCAL_HERMES_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_LOCAL_HERMES_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_LOCAL_HERMES_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

const localDemeterMulticall3DeploymentBlock = process.env
.LOCAL_DEMETER_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.LOCAL_DEMETER_MULTICALL3_DEPLOYMENT_BLOCK)
.BRIDGE_DAPP_LOCAL_DEMETER_MULTICALL3_DEPLOYMENT_BLOCK
? parseInt(process.env.BRIDGE_DAPP_LOCAL_DEMETER_MULTICALL3_DEPLOYMENT_BLOCK)
: 0;

export const chainsConfig: Record<number, ChainConfig> = {
Expand Down
4 changes: 2 additions & 2 deletions libs/dapp-config/src/wagmi-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { chainsConfig } from './chains/evm';
import { SupportedConnector } from './wallets/wallet-config.interface';
import { walletsConfig } from './wallets/wallets-config';

if (!process.env['WALLET_CONNECT_PROJECT_ID']) {
throw new Error('Missing WALLET_CONNECT_PROJECT_ID');
if (!process.env['BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID']) {
throw new Error('Missing BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID');
}

const { publicClient, webSocketPublicClient } = configureChains(
Expand Down
8 changes: 5 additions & 3 deletions libs/dapp-config/src/wallets/wallets-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ const ANY_SUBSTRATE = [
PresetTypedChainId.Polkadot,
];

if (!process.env['WALLET_CONNECT_PROJECT_ID']) {
throw new Error('Missing WALLET_CONNECT_PROJECT_ID env variable.');
if (!process.env['BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID']) {
throw new Error(
'Missing BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID env variable.'
);
}

export const walletsConfig: Record<number, WalletConfig> = {
Expand Down Expand Up @@ -115,7 +117,7 @@ export const walletsConfig: Record<number, WalletConfig> = {
homeLink: 'https://walletconnect.com/',
connector: new WalletConnectConnector({
options: {
projectId: process.env['WALLET_CONNECT_PROJECT_ID'],
projectId: process.env['BRIDGE_DAPP_WALLET_CONNECT_PROJECT_ID'],
},
}),
},
Expand Down

0 comments on commit b1678c5

Please sign in to comment.