Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3242446
D9432.id31860.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9432.id31860.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 9:54 PM (12 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2492898
Default Alt Text
D9432.id31860.diff (2 KB)
Attached To
Mode
D9432: [landing] Reduce code duplication in landing/siwe.react.js
Attached
Detach File
Event Timeline
Log In to Comment