Page MenuHomePhabricator

D9432.id31860.diff
No OneTemporary

D9432.id31860.diff

diff --git a/landing/siwe.react.js b/landing/siwe.react.js
--- a/landing/siwe.react.js
+++ b/landing/siwe.react.js
@@ -5,16 +5,8 @@
RainbowKitProvider,
darkTheme,
useModalState,
- connectorsForWallets,
} from '@rainbow-me/rainbowkit';
import '@rainbow-me/rainbowkit/styles.css';
-import {
- injectedWallet,
- rainbowWallet,
- metaMaskWallet,
- walletConnectWallet,
- // eslint-disable-next-line import/extensions
-} from '@rainbow-me/rainbowkit/wallets';
import invariant from 'invariant';
import _merge from 'lodash/fp/merge.js';
import * as React from 'react';
@@ -29,32 +21,14 @@
} from 'lib/utils/siwe-utils.js';
import {
WagmiENSCacheProvider,
- configureWagmiChains,
- createWagmiClient,
+ wagmiClient,
+ wagmiChains,
} from 'lib/utils/wagmi-utils.js';
import { SIWEContext } from './siwe-context.js';
import css from './siwe.css';
import { useMonitorForWalletConnectModal } from './walletconnect-hooks.js';
-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 },
-]);
-
-const wagmiClient = createWagmiClient({ connectors, provider });
-
function postMessageToNativeWebView(message: SIWEWebViewMessage) {
window.ReactNativeWebView?.postMessage?.(JSON.stringify(message));
}
@@ -188,7 +162,11 @@
return (
<WagmiConfig client={wagmiClient}>
<WagmiENSCacheProvider>
- <RainbowKitProvider theme={theme} modalSize="compact" chains={chains}>
+ <RainbowKitProvider
+ theme={theme}
+ modalSize="compact"
+ chains={wagmiChains}
+ >
<SIWE />
</RainbowKitProvider>
</WagmiENSCacheProvider>
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
@@ -76,10 +76,4 @@
);
}
-export {
- configureWagmiChains,
- createWagmiClient,
- wagmiClient,
- wagmiChains,
- WagmiENSCacheProvider,
-};
+export { wagmiClient, wagmiChains, WagmiENSCacheProvider };

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 10:30 PM (18 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2581165
Default Alt Text
D9432.id31860.diff (2 KB)

Event Timeline