-
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.
Merge pull request #1 from surajhub255/main
feat : added magic link
- Loading branch information
Showing
8 changed files
with
9,094 additions
and
6,659 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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,11 +1,9 @@ | ||
'use client' | ||
|
||
import { ConnectButton } from '@rainbow-me/rainbowkit' | ||
|
||
export const ConnectWallet = () => { | ||
return ( | ||
<> | ||
<ConnectButton /> | ||
<w3m-button/> | ||
</> | ||
) | ||
} |
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,38 +1,41 @@ | ||
'use client' | ||
|
||
import React, { ReactNode } from 'react' | ||
import { projectId, rainbowconfig } from './wagmi' | ||
|
||
|
||
import { createWeb3Modal } from '@web3modal/wagmi/react' | ||
|
||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
|
||
import { State, WagmiProvider } from 'wagmi' | ||
import { RainbowKitProvider } from '@rainbow-me/rainbowkit' | ||
import { config } from './wagmi' | ||
|
||
|
||
// Setup queryClient | ||
const queryClient = new QueryClient() | ||
|
||
if (!projectId) throw new Error('Project ID is not defined') | ||
const projectId = "c26b357532f63f7ba31efebac88d0eed"; | ||
|
||
if (!projectId) throw new Error('Wallet Connect Project ID is not defined') | ||
|
||
// // Create modal | ||
// createWeb3Modal({ | ||
// wagmiConfig: config, | ||
// projectId, | ||
// enableAnalytics: true, // Optional - defaults to your Cloud configuration | ||
// enableOnramp: true, // Optional - false as default | ||
// }) | ||
// Create modal | ||
createWeb3Modal({ | ||
wagmiConfig: config, | ||
projectId, | ||
enableAnalytics: true, // Optional - defaults to your Cloud configuration | ||
enableOnramp: true // Optional - false as default | ||
}) | ||
|
||
export default function Web3ModalProvider({ | ||
children, | ||
initialState, | ||
children, | ||
initialState | ||
}: { | ||
children: ReactNode | ||
initialState?: State | ||
children: ReactNode | ||
initialState?: State | ||
}) { | ||
return ( | ||
<WagmiProvider config={rainbowconfig} initialState={initialState}> | ||
<QueryClientProvider client={queryClient}> | ||
<RainbowKitProvider>{children}</RainbowKitProvider> | ||
</QueryClientProvider> | ||
</WagmiProvider> | ||
) | ||
} | ||
return ( | ||
<WagmiProvider config={config} initialState={initialState}> | ||
<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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,35 @@ | ||
'use client' | ||
import { getDefaultConfig, connectorsForWallets } from '@rainbow-me/rainbowkit' | ||
import { cookieStorage, createStorage, createConfig, http } from 'wagmi' | ||
import { createClient } from 'viem' | ||
import { baseSepolia, polygonZkEvmCardona } from 'wagmi/chains' | ||
import { | ||
rainbowWallet, | ||
walletConnectWallet, | ||
} from '@rainbow-me/rainbowkit/wallets' | ||
import { coinbaseWallet } from '@rainbow-me/rainbowkit/wallets' | ||
"use client"; | ||
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config' | ||
|
||
// Enable Coinbase Smart Wallet for testing | ||
coinbaseWallet.preference = 'smartWalletOnly' | ||
import { cookieStorage, createStorage } from 'wagmi' | ||
import { baseSepolia } from 'wagmi/chains' | ||
|
||
// Get projectId from https://cloud.walletconnect.com | ||
export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID | ||
export const projectId = 'c26b357532f63f7ba31efebac88d0eed' | ||
|
||
if (!projectId) throw new Error('Project ID is not defined') | ||
|
||
const connectors = connectorsForWallets( | ||
[ | ||
{ | ||
groupName: 'Recommended', | ||
wallets: [rainbowWallet, coinbaseWallet, walletConnectWallet], | ||
}, | ||
], | ||
{ | ||
appName: 'Myriadflow WebXR', | ||
projectId: projectId, | ||
} | ||
) | ||
const metadata = { | ||
name: 'Web3Modal', | ||
description: 'Web3Modal Example', | ||
url: 'https://web3modal.com', | ||
icons: ['https://avatars.githubusercontent.com/u/37784886'], | ||
} | ||
|
||
export const rainbowconfig = createConfig({ | ||
connectors, | ||
chains: [baseSepolia, polygonZkEvmCardona], | ||
ssr: false, // If your dApp uses server side rendering (SSR) | ||
client({ chain }) { | ||
return createClient({ chain, transport: http() }) | ||
}, | ||
// storage: createStorage({ | ||
// storage: cookieStorage, | ||
// }), | ||
}) | ||
// Create wagmiConfig | ||
const chains = [baseSepolia] as const | ||
export const config = defaultWagmiConfig({ | ||
chains, | ||
projectId, | ||
metadata, | ||
auth: { | ||
email: true, | ||
socials: ["github", "google", "x", "discord", "apple"], | ||
showWallets: true, // default to true | ||
walletFeatures: true | ||
}, | ||
ssr: true, | ||
storage: createStorage({ | ||
storage: cookieStorage | ||
}) | ||
}); |
Oops, something went wrong.