Skip to content
Closed
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
3 changes: 3 additions & 0 deletions apps/dcellar-web-ui/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# For local development, copy this file to .env.local and update the values as needed.
# WalletConnect Cloud project ID for this environment. Set it before running the Next.js build.
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=

NEXT_PUBLIC_ENV=development

NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,26 @@ import { GREENFIELD_CHAIN_ID } from '@/base/env';
import { metaMask, trustWallet, walletConnect } from '@totejs/walletkit/wallets';
import * as Sentry from '@sentry/nextjs';
import { reportEvent } from '@/utils/gtag';
import * as process from 'process';
import { ReactNode } from 'react';
import { customTheme } from '@/base/theme/wallet';
import { DCLink } from '@/components/common/DCLink';

const walletConnectProjectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID?.trim() ?? '';

if (typeof window !== 'undefined' && !walletConnectProjectId) {
// eslint-disable-next-line no-console
console.warn(
'WalletConnect is disabled. Set NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID before building dcellar-web-ui.',
);
}

const config = createConfig(
getDefaultConfig({
chains: [bscChain, greenFieldChain],
appName: 'Connect a Wallet',
autoConnect: true,
/* WC 2.0 requires a project ID (get one here: https://cloud.walletconnect.com/sign-in) */
walletConnectProjectId: '89848e3205cafe0bf76c91aa1aaa71d0',
connectors: [trustWallet(), metaMask(), walletConnect()],
walletConnectProjectId,
connectors: [trustWallet(), metaMask(), ...(walletConnectProjectId ? [walletConnect()] : [])],
}),
);

Expand Down
Loading