-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwagmi.config.ts
34 lines (30 loc) · 939 Bytes
/
wagmi.config.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
import { createPublicClient } from "viem";
import { createWalletClient } from "viem";
import { createConfig, http, cookieStorage, createStorage } from "wagmi";
import { lineaSepolia, linea, mainnet } from "wagmi/chains";
import { metaMask } from "wagmi/connectors";
export const publicClient = createPublicClient({
chain: lineaSepolia,
transport: http(),
});
const rpcUrl = `https://linea-sepolia.infura.io/v3/${process.env.INFURA_PROJECT_ID}`;
export const walletClient = createWalletClient({
chain: lineaSepolia,
transport: http(rpcUrl),
account: process.env.PRIVATE_KEY as `0x${string}`,
});
export function getConfig() {
return createConfig({
chains: [lineaSepolia, linea, mainnet],
connectors: [metaMask()],
ssr: true,
storage: createStorage({
storage: cookieStorage,
}),
transports: {
[lineaSepolia.id]: http(),
[linea.id]: http(),
[mainnet.id]: http(),
},
});
}