-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathweb3modal.config.tsx
More file actions
56 lines (45 loc) · 1.36 KB
/
web3modal.config.tsx
File metadata and controls
56 lines (45 loc) · 1.36 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
/**
* Uncomment to use dAppBooster with web3Modal
* version used: 4.2.1
*/
import type { DetailedHTMLProps, FC, HTMLAttributes, PropsWithChildren } from 'react'
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi'
import { createAppKit } from '@reown/appkit/react'
import { env } from '@/src/env'
import { chains } from '@/src/lib/networks.config'
import type { Chain } from 'viem'
export const WalletProvider: FC<PropsWithChildren> = ({ children }) => children
declare global {
namespace JSX {
interface IntrinsicElements {
'w3m-button': DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>
}
}
}
export const ConnectWalletButton = ({ label = 'Connect' }: { label?: string }) => (
<appkit-button label={label} />
)
// Required API Keys
const projectId = env.PUBLIC_WALLETCONNECT_PROJECT_ID
const metadata = {
// Required App Info
name: env.PUBLIC_APP_NAME,
description: env.PUBLIC_APP_DESCRIPTION ?? '',
url: env.PUBLIC_APP_URL ?? '',
icons: [env.PUBLIC_APP_LOGO ?? ''],
}
// TODO avoid readonly types mismatch
const wagmiAdapter = new WagmiAdapter({
networks: chains as unknown as Chain[],
projectId,
})
createAppKit({
adapters: [wagmiAdapter],
networks: chains as unknown as [Chain, ...Chain[]],
metadata: metadata,
projectId,
features: {
analytics: true,
},
})
export const config = wagmiAdapter.wagmiConfig