-
Notifications
You must be signed in to change notification settings - Fork 20
/
wagmi.ts
70 lines (66 loc) · 1.68 KB
/
wagmi.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { getDefaultWallets } from "@rainbow-me/rainbowkit";
import {
sepolia,
optimism,
mainnet,
arbitrum,
polygon,
bsc,
base,
zora,
} from "@wagmi/chains";
import { configureChains, createConfig, WebSocketPublicClient } from "wagmi";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";
import { publicProvider } from "wagmi/providers/public";
import { baseSepolia } from "viem/chains";
import { blast } from "@/lib/chains/blast";
import { degen } from "@/lib/chains/degen";
import { sanko } from "@/lib/chains/sanko";
import { apechain } from "@/lib/chains/apechain";
// NOTE: On the providers, there are some issues with Sepolia currently and Wagmi.
// The setup below will work. Adding an Alchemy provider, for example, will break things
// Issue: https://github.com/wagmi-dev/wagmi/issues/2219#issuecomment-1520882923
const { chains, publicClient, webSocketPublicClient } = configureChains(
[
mainnet,
sepolia,
arbitrum,
optimism,
polygon,
base,
bsc,
sepolia,
baseSepolia,
blast,
zora,
degen,
sanko,
apechain,
],
[
publicProvider(),
jsonRpcProvider({
rpc: () => ({
http: process.env.NEXT_PUBLIC_SEPOLIA_API!,
webSocket: process.env.NEXT_PUBLIC_SEPOLIA_WEBSOCKET!,
}),
}),
jsonRpcProvider({
rpc: () => ({
http: process.env.NEXT_PUBLIC_QUICKNODE_API!,
}),
}),
]
);
const { connectors } = getDefaultWallets({
appName: "Gaslite Drop",
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_API_KEY as string,
chains,
});
export const client = createConfig({
autoConnect: false,
connectors,
webSocketPublicClient,
publicClient,
});
export { chains };