Page MenuHomePhabricator

D8349.id28202.diff
No OneTemporary

D8349.id28202.diff

diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -37,19 +37,22 @@
import css from './siwe.css';
import { useMonitorForWalletConnectModal } from './walletconnect-hooks.js';
-const projectId = process.env.COMM_WALLETCONNECT_KEY;
const { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);
+
+const wallets = [injectedWallet({ chains })];
+const projectId = process.env.COMM_WALLETCONNECT_KEY;
+if (projectId) {
+ wallets.push(
+ rainbowWallet({ chains, projectId }),
+ metaMaskWallet({ chains, projectId }),
+ walletConnectWallet({ chains, projectId }),
+ );
+}
+
const connectors = connectorsForWallets([
- {
- groupName: 'Recommended',
- wallets: [
- injectedWallet({ chains }),
- rainbowWallet({ chains, projectId }),
- metaMaskWallet({ chains, projectId }),
- walletConnectWallet({ chains, projectId }),
- ],
- },
+ { groupName: 'Recommended', wallets },
]);
+
const wagmiClient = createWagmiClient({ connectors, provider });
function postMessageToNativeWebView(message: SIWEWebViewMessage) {
diff --git a/lib/utils/wagmi-utils.js b/lib/utils/wagmi-utils.js
--- a/lib/utils/wagmi-utils.js
+++ b/lib/utils/wagmi-utils.js
@@ -46,19 +46,22 @@
});
}
-const projectId = process.env.COMM_WALLETCONNECT_KEY;
const { chains, provider } = configureWagmiChains(process.env.COMM_ALCHEMY_KEY);
+
+const wallets = [injectedWallet({ chains })];
+const projectId = process.env.COMM_WALLETCONNECT_KEY;
+if (projectId) {
+ wallets.push(
+ rainbowWallet({ chains, projectId }),
+ metaMaskWallet({ chains, projectId }),
+ walletConnectWallet({ chains, projectId }),
+ );
+}
+
const connectors = connectorsForWallets([
- {
- groupName: 'Recommended',
- wallets: [
- injectedWallet({ chains }),
- rainbowWallet({ chains, projectId }),
- metaMaskWallet({ chains, projectId }),
- walletConnectWallet({ chains, projectId }),
- ],
- },
+ { groupName: 'Recommended', wallets },
]);
+
const wagmiClient: mixed = createWagmiClient({ connectors, provider });
const wagmiChains: mixed = chains;

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 12:42 PM (20 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574421
Default Alt Text
D8349.id28202.diff (2 KB)

Event Timeline