-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathWeb3Provider.tsx
More file actions
36 lines (31 loc) · 980 Bytes
/
Web3Provider.tsx
File metadata and controls
36 lines (31 loc) · 980 Bytes
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
import type { FC, PropsWithChildren } from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { WagmiProvider } from 'wagmi'
import '@/src/lib/wallets/portoInit'
import { ConnectWalletButton, WalletProvider, config } from '@/src/lib/wallets/connectkit.config'
const queryClient = new QueryClient()
export { ConnectWalletButton }
/**
* Provider component for web3 functionality
*
* Sets up the necessary providers for blockchain interactions:
* - WagmiProvider for blockchain connectivity
* - QueryClientProvider for data fetching
* - WalletProvider for wallet connection
*
* @example
* ```tsx
* <Web3Provider>
* <App />
* </Web3Provider>
* ```
*/
export const Web3Provider: FC<PropsWithChildren> = ({ children }) => {
return (
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<WalletProvider>{children}</WalletProvider>
</QueryClientProvider>
</WagmiProvider>
)
}