-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.wagmi.ts
52 lines (49 loc) · 1.31 KB
/
config.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
import { createConfig, http } from "wagmi";
import {
arbitrum,
arbitrumSepolia,
base,
baseSepolia,
mainnet,
optimism,
optimismSepolia,
sepolia,
} from "wagmi/chains";
import { walletConnect } from "wagmi/connectors";
const walletConnectProjectId =
process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID;
function transportUrl(prefix: string) {
return `https://${prefix}.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_API_KEY}`;
}
export const config = createConfig({
connectors: [
// metamask is loaded by default (if metamask is in browser at least). idk why
...(walletConnectProjectId
? [
walletConnect({
projectId: walletConnectProjectId,
}),
]
: []),
],
chains: [
sepolia,
arbitrumSepolia,
baseSepolia,
optimismSepolia,
// mainnet,
arbitrum,
base,
optimism,
],
transports: {
[mainnet.id]: http(transportUrl("mainnet")),
[sepolia.id]: http(transportUrl("sepolia")),
[optimism.id]: http(transportUrl("optimism")),
[optimismSepolia.id]: http(transportUrl("optimism-sepolia")),
[base.id]: http(transportUrl("base")),
[baseSepolia.id]: http(transportUrl("base-sepolia")),
[arbitrum.id]: http(transportUrl("arbitrum")),
[arbitrumSepolia.id]: http(transportUrl("arbitrum-sepolia")),
},
});