Skip to content

Commit

Permalink
configure sepolia chain #32
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelPepe committed May 15, 2023
1 parent 601a864 commit 8e58eea
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,40 @@ import type { AppProps } from 'next/app';

import '@rainbow-me/rainbowkit/styles.css';
import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { configureChains, createClient, WagmiConfig } from 'wagmi';
import { polygon } from 'wagmi/chains';
import { alchemyProvider } from 'wagmi/providers/alchemy';

import { Layout } from '@/components';
import { DiamondContextProvider } from '@/contexts';
import {
WagmiConfig,
createConfig,
configureChains,
mainnet,
Chain,
} from 'wagmi';
import { publicProvider } from 'wagmi/providers/public';
import { sepolia } from '@/chains/sepolia';

const { chains, provider, webSocketProvider } = configureChains(
[polygon],
[alchemyProvider({ apiKey: process.env.NEXT_PUBLIC_ALCHEMY_API_KEY! })]
const { chains, publicClient, webSocketPublicClient } = configureChains(
[sepolia],
[publicProvider()]
);

const { connectors } = getDefaultWallets({
appName: 'Diamond blueprinter',
chains,
});

const wagmiClient = createClient({
const config = createConfig({
autoConnect: true,
publicClient,
webSocketPublicClient,
connectors,
provider,
webSocketProvider,
});

export default function App({ Component, pageProps }: AppProps) {
return (
<DiamondContextProvider>
<WagmiConfig client={wagmiClient}>
<WagmiConfig config={config}>
<RainbowKitProvider chains={chains}>
<Layout>
<Component {...pageProps} />
Expand Down

0 comments on commit 8e58eea

Please sign in to comment.