-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e4fe91
commit 435f4c4
Showing
2 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,37 @@ | ||
'use client' | ||
|
||
import React, { ReactNode } from 'react' | ||
|
||
|
||
import { createWeb3Modal } from '@web3modal/wagmi/react' | ||
|
||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
|
||
import { State, WagmiProvider } from 'wagmi' | ||
import { config } from './wagmi' | ||
|
||
import { config, projectId } from './wagmi' | ||
|
||
// Setup queryClient | ||
// Initialize React Query Client | ||
const queryClient = new QueryClient() | ||
|
||
const projectId = "c26b357532f63f7ba31efebac88d0eed"; | ||
|
||
if (!projectId) throw new Error('Wallet Connect Project ID is not defined') | ||
if (!projectId) { | ||
throw new Error('Wallet Connect Project ID is not defined') | ||
} | ||
|
||
// Create modal | ||
// Initialize Web3Modal | ||
createWeb3Modal({ | ||
wagmiConfig: config, | ||
projectId, | ||
enableAnalytics: true, // Optional - defaults to your Cloud configuration | ||
enableOnramp: true // Optional - false as default | ||
enableOnramp: true // Optional - false by default | ||
}) | ||
|
||
export default function AppKitProvider({ | ||
children, | ||
initialState | ||
}: { | ||
interface AppKitProviderProps { | ||
children: ReactNode | ||
initialState?: State | ||
}) { | ||
} | ||
|
||
export default function AppKitProvider({ children, initialState }: AppKitProviderProps) { | ||
return ( | ||
<WagmiProvider config={config} initialState={initialState}> | ||
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider> | ||
<QueryClientProvider client={queryClient}> | ||
{children} | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters