From 8eb38ef80f86840e5b1047753acb1ecc4832afa6 Mon Sep 17 00:00:00 2001 From: devinxl <94832688+devinxl@users.noreply.github.com> Date: Thu, 3 Dec 2026 11:17:42 +0800 Subject: [PATCH] Read the WalletConnect project ID from the build environment --- apps/dcellar-web-ui/.env.example | 3 +++ .../WalletConnectContext/components/WalletConnectProvider.tsx | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/dcellar-web-ui/.env.example b/apps/dcellar-web-ui/.env.example index b64183e4..9e1c8f40 100644 --- a/apps/dcellar-web-ui/.env.example +++ b/apps/dcellar-web-ui/.env.example @@ -63,3 +63,6 @@ NEXT_PUBLIC_APOLLO_MAINNET_SP_RECOMMEND_META=https://sp-recommendation-engine.no # NEXT_PUBLIC_APOLLO_GLOBAL_NOTIFICATION='' # NEXT_PUBLIC_APOLLO_GLOBAL_NOTIFICATION_ETA='' # # ------ Mainnet development end --------- + +# WalletConnect project ID used by the frontend build +NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID= diff --git a/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx b/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx index 81b6840b..697c2548 100644 --- a/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx +++ b/apps/dcellar-web-ui/src/context/WalletConnectContext/components/WalletConnectProvider.tsx @@ -8,7 +8,6 @@ import { WalletKitOptions, WalletKitProvider, getDefaultConfig } from '@node-rea import '@node-real/walletkit/styles.css'; import { metaMask, trustWallet, walletConnect } from '@node-real/walletkit/wallets'; import * as Sentry from '@sentry/nextjs'; -import * as process from 'process'; import { ReactNode } from 'react'; import { WagmiConfig, createConfig } from 'wagmi'; import * as flatted from 'flatted'; @@ -19,7 +18,7 @@ const config = createConfig( autoConnect: true, appName: 'Connect a Wallet', /* WC 2.0 requires a project ID (get one here: https://cloud.walletconnect.com/sign-in) */ - walletConnectProjectId: '89848e3205cafe0bf76c91aa1aaa71d0', + walletConnectProjectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!, chains: [bscChain, greenFieldChain], connectors: [ // trustWallet(),