Skip to content

Commit f06e8f2

Browse files
authored
fix(explorer): wallets connect options (#3732)
1 parent 3ffa127 commit f06e8f2

4 files changed

Lines changed: 103 additions & 22 deletions

File tree

.changeset/gold-maps-talk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/explorer": patch
3+
---
4+
5+
Restore wallet connection options in the wallet connect modal.

packages/explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@radix-ui/react-slot": "^1.1.0",
5858
"@radix-ui/react-tooltip": "^1.1.6",
5959
"@radix-ui/themes": "^3.0.5",
60-
"@rainbow-me/rainbowkit": "^2.1.5",
60+
"@rainbow-me/rainbowkit": "^2.2.6",
6161
"@tanstack/react-query": "^5.51.3",
6262
"@tanstack/react-table": "^8.19.3",
6363
"class-variance-authority": "^0.7.0",

packages/explorer/src/app/(explorer)/[chainName]/worlds/[worldAddress]/Providers.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use client";
22

33
import { WagmiProvider, createConfig, fallback, http, webSocket } from "wagmi";
4-
import { injected, metaMask, safe } from "wagmi/connectors";
54
import { ReactNode, useMemo } from "react";
6-
import { RainbowKitProvider, darkTheme } from "@rainbow-me/rainbowkit";
5+
import { RainbowKitProvider, connectorsForWallets, darkTheme } from "@rainbow-me/rainbowkit";
76
import "@rainbow-me/rainbowkit/styles.css";
7+
import { injectedWallet, metaMaskWallet, safeWallet } from "@rainbow-me/rainbowkit/wallets";
88
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
99
import { getDefaultAnvilConnectors } from "../../../../../connectors/anvil";
1010
import { useChain } from "../../../hooks/useChain";
@@ -14,18 +14,20 @@ const queryClient = new QueryClient();
1414
export function Providers({ children }: { children: ReactNode }) {
1515
const chain = useChain();
1616
const wagmiConfig = useMemo(() => {
17+
const anvilConnectors = getDefaultAnvilConnectors(chain.id);
18+
const walletConnectors = connectorsForWallets(
19+
[
20+
{
21+
groupName: "Recommended",
22+
wallets: [injectedWallet, metaMaskWallet, safeWallet],
23+
},
24+
],
25+
{ appName: "Worlds Explorer", projectId: process.env.NEXT_PUBLIC_PROJECT_ID! },
26+
);
27+
1728
return createConfig({
1829
chains: [chain],
19-
connectors: [
20-
injected(),
21-
metaMask({
22-
dappMetadata: {
23-
name: "World Explorer",
24-
},
25-
}),
26-
safe(),
27-
...getDefaultAnvilConnectors(chain.id),
28-
],
30+
connectors: [...walletConnectors, ...anvilConnectors],
2931
transports: {
3032
[chain.id]: chain.rpcUrls.default.webSocket
3133
? fallback([webSocket(chain.rpcUrls.default.webSocket[0]), http(chain.rpcUrls.default.http[0])])

pnpm-lock.yaml

Lines changed: 83 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)