Skip to content

Commit

Permalink
feat(explorer): external wallet connect (#3156)
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis authored Sep 10, 2024
1 parent 1391018 commit ee4bcc4
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/themes": "^3.0.5",
"@rainbow-me/rainbowkit": "^2.1.5",
"@tanstack/react-query": "^5.51.3",
"@tanstack/react-table": "^8.19.3",
"@wagmi/core": "^2.12.1",
Expand Down
16 changes: 10 additions & 6 deletions packages/explorer/src/app/(explorer)/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
"use client";

import { WagmiProvider } from "wagmi";
import { WagmiProvider, createConfig, http } from "wagmi";
import { injected, metaMask, safe } from "wagmi/connectors";
import { ReactNode } from "react";
import { RainbowKitProvider, darkTheme } from "@rainbow-me/rainbowkit";
import "@rainbow-me/rainbowkit/styles.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createConfig, http } from "@wagmi/core";
import { localhost } from "@wagmi/core/chains";
import { anvil } from "@wagmi/core/chains";
import { AppStoreProvider } from "../../store";

const queryClient = new QueryClient();

export const wagmiConfig = createConfig({
chains: [localhost],
chains: [anvil],
connectors: [
injected(),
metaMask({
Expand All @@ -22,15 +23,18 @@ export const wagmiConfig = createConfig({
safe(),
],
transports: {
[localhost.id]: http(),
[anvil.id]: http(),
},
ssr: true,
});

export function Providers({ children }: { children: ReactNode }) {
return (
<WagmiProvider config={wagmiConfig}>
<QueryClientProvider client={queryClient}>
<AppStoreProvider>{children}</AppStoreProvider>
<RainbowKitProvider theme={darkTheme()}>
<AppStoreProvider>{children}</AppStoreProvider>
</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
);
Expand Down
118 changes: 115 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ee4bcc4

Please sign in to comment.