-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproviders.js
37 lines (30 loc) · 863 Bytes
/
providers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"use client";
import "@rainbow-me/rainbowkit/styles.css";
import { useEffect } from "react";
import { getDefaultWallets, RainbowKitProvider } from "@rainbow-me/rainbowkit";
import { configureChains, createClient, WagmiConfig } from "wagmi";
import { mainnet, goerli } from "wagmi/chains";
import { publicProvider } from "wagmi/providers/public";
const { chains, provider } = configureChains(
[mainnet, goerli],
[publicProvider()]
);
const { connectors } = getDefaultWallets({
appName: "next bug",
chains,
});
const wagmiClient = createClient({
autoConnect: true,
connectors,
provider,
});
export const Providers = ({ children }) => {
useEffect(() => {
console.log("NEXTjs");
}, []);
return (
<WagmiConfig client={wagmiClient}>
<RainbowKitProvider chains={chains}>{children}</RainbowKitProvider>
</WagmiConfig>
);
};