Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32981203
D9433.1768320892.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D9433.1768320892.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
@@ -20,7 +20,7 @@
createSIWEMessage,
} from 'lib/utils/siwe-utils.js';
import {
- WagmiENSCacheProvider,
+ AlchemyENSCacheProvider,
wagmiClient,
wagmiChains,
} from 'lib/utils/wagmi-utils.js';
@@ -161,7 +161,7 @@
}, []);
return (
<WagmiConfig client={wagmiClient}>
- <WagmiENSCacheProvider>
+ <AlchemyENSCacheProvider>
<RainbowKitProvider
theme={theme}
modalSize="compact"
@@ -169,7 +169,7 @@
>
<SIWE />
</RainbowKitProvider>
- </WagmiENSCacheProvider>
+ </AlchemyENSCacheProvider>
</WagmiConfig>
);
}
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
@@ -8,8 +8,9 @@
walletConnectWallet,
// eslint-disable-next-line import/extensions
} from '@rainbow-me/rainbowkit/wallets';
+import { ethers } from 'ethers';
import * as React from 'react';
-import { configureChains, createClient, useProvider } from 'wagmi';
+import { configureChains, createClient } from 'wagmi';
// eslint-disable-next-line import/extensions
import { mainnet } from 'wagmi/chains';
// eslint-disable-next-line import/extensions
@@ -65,15 +66,21 @@
const wagmiClient: mixed = createWagmiClient({ connectors, provider });
const wagmiChains: mixed = chains;
+const ethersAlchemyProvider = new ethers.providers.AlchemyProvider(
+ 'mainnet',
+ process.env.COMM_ALCHEMY_KEY,
+);
+
type Props = {
+children: React.Node,
};
-function WagmiENSCacheProvider(props: Props): React.Node {
+function AlchemyENSCacheProvider(props: Props): React.Node {
const { children } = props;
- const wagmiProvider = useProvider();
return (
- <ENSCacheProvider provider={wagmiProvider}>{children}</ENSCacheProvider>
+ <ENSCacheProvider provider={ethersAlchemyProvider}>
+ {children}
+ </ENSCacheProvider>
);
}
-export { wagmiClient, wagmiChains, WagmiENSCacheProvider };
+export { wagmiClient, wagmiChains, AlchemyENSCacheProvider };
diff --git a/web/app.react.js b/web/app.react.js
--- a/web/app.react.js
+++ b/web/app.react.js
@@ -30,7 +30,7 @@
import type { Dispatch } from 'lib/types/redux-types.js';
import { registerConfig } from 'lib/utils/config.js';
import { infoFromURL } from 'lib/utils/url-utils.js';
-import { WagmiENSCacheProvider, wagmiClient } from 'lib/utils/wagmi-utils.js';
+import { AlchemyENSCacheProvider, wagmiClient } from 'lib/utils/wagmi-utils.js';
import QrCodeLogin from './account/qr-code-login.react.js';
import WebEditThreadAvatarProvider from './avatars/web-edit-thread-avatar-provider.react.js';
@@ -191,7 +191,7 @@
<TooltipProvider>
<MenuProvider>
<WagmiConfig client={wagmiClient}>
- <WagmiENSCacheProvider>
+ <AlchemyENSCacheProvider>
<MessageSearchStateProvider>
<FocusHandler />
<VisibilityHandler />
@@ -202,7 +202,7 @@
<InviteLinksRefresher />
{content}
</MessageSearchStateProvider>
- </WagmiENSCacheProvider>
+ </AlchemyENSCacheProvider>
</WagmiConfig>
</MenuProvider>
</TooltipProvider>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 13, 4:14 PM (10 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5928406
Default Alt Text
D9433.1768320892.diff (3 KB)
Attached To
Mode
D9433: [lib] Stop using Ethers.js client from Wagmi
Attached
Detach File
Event Timeline
Log In to Comment