-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconnection.ts
More file actions
87 lines (75 loc) · 2.15 KB
/
Copy pathconnection.ts
File metadata and controls
87 lines (75 loc) · 2.15 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { createAppKit } from "@reown/appkit/react"
import { EthersAdapter } from "@reown/appkit-adapter-ethers"
import { baseSepolia, type AppKitNetwork } from "@reown/appkit/networks"
const projectId = process.env.NEXT_PUBLIC_APPKIT_PROJECT_ID ?? ""
if (!projectId) {
console.warn("NEXT_PUBLIC_APPKIT_PROJECT_ID missing")
}
const networks = [baseSepolia] as [AppKitNetwork, ...AppKitNetwork[]]
const metadata = {
name: "Yield_Save",
description: "Yield Save",
url: "https://ys-frontend-one.vercel.app",
icons: ["https://avatars.mywebsite.com/"],
}
export const appkit = createAppKit({
adapters: [new EthersAdapter()],
networks,
metadata,
projectId,
allowUnsupportedChain: false,
allWallets: "SHOW",
defaultNetwork: baseSepolia,
enableEIP6963: true,
features: {
analytics: true,
allWallets: true,
email: false,
socials: [],
},
})
// import { createAppKit } from "@reown/appkit/react";
// import { EthersAdapter } from "@reown/appkit-adapter-ethers";
// import {
// baseSepolia,
// type AppKitNetwork,
// } from "@reown/appkit/networks";
// const projectId = process.env.NEXT_PUBLIC_APPKIT_PROJECT_ID || "default_project_id";
// if (!projectId) {
// throw new Error(
// "Missing NEXT_PUBLIC_APPKIT_PROJECT_ID. Set it in your .env file.",
// );
// }
// export const BaseSepolia: AppKitNetwork = {
// ...baseSepolia,
// id: 84532,
// chainNamespace: "eip155",
// caipNetworkId: "eip155:84532",
// };
// // 2. Set the networks
// const networks: [AppKitNetwork, ...AppKitNetwork[]] = [BaseSepolia];
// // 3. Create a metadata object - optional
// const metadata = {
// name: "Yield_Save",
// description: "Yield Save",
// url: "https://mywebsite.com",
// icons: ["https://avatars.mywebsite.com/"],
// };
// // 4. Create a AppKit instance
// export const appkit = createAppKit({
// adapters: [new EthersAdapter()],
// networks,
// metadata,
// projectId,
// allowUnsupportedChain: false,
// allWallets: "SHOW",
// defaultNetwork: BaseSepolia,
// enableEIP6963: true,
// features: {
// analytics: true,
// allWallets: true,
// email: false,
// socials: [],
// },
// });
// appkit.switchNetwork(baseSepolia);