-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb3config.js
More file actions
30 lines (24 loc) · 823 Bytes
/
web3config.js
File metadata and controls
30 lines (24 loc) · 823 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
// web3config.js
import React from 'react';
import { config, projectId, metadata } from '@/config';
import { createWeb3Modal } from '@web3modal/wagmi/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';
// Setup queryClient
const queryClient = new QueryClient();
if (!projectId) throw new Error('Project ID is not defined');
// Initialize Web3Modal
const web3Modal = createWeb3Modal({
metadata,
wagmiConfig: config,
projectId,
enableAnalytics: true, // Optional
});
export default function AppKitProvider({ children, initialState }) {
return (
<WagmiProvider config={config} initialState={initialState}>
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
</WagmiProvider>
);
}
export { web3Modal };