-
Notifications
You must be signed in to change notification settings - Fork 400
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/add-token-generator
- Loading branch information
Showing
18 changed files
with
246 additions
and
102 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use client'; | ||
|
||
import { useEffect, useState } from 'react'; | ||
import { useErrors } from 'apps/web/contexts/Errors'; | ||
|
||
export function DynamicCryptoProviders({ children }: { children: React.ReactNode }) { | ||
const [CryptoProvidersDynamic, setCryptoProvidersDynamic] = | ||
useState<React.ComponentType<{ children: React.ReactNode }>>(); | ||
const { logError } = useErrors(); | ||
|
||
useEffect(() => { | ||
import('apps/web/app/CryptoProviders') | ||
.then((mod) => { | ||
setCryptoProvidersDynamic(() => mod.default); | ||
}) | ||
.catch((error) => logError(error, 'Failed to load CryptoProviders')); | ||
}, [logError]); | ||
|
||
if (!CryptoProvidersDynamic) return null; | ||
|
||
return <CryptoProvidersDynamic>{children}</CryptoProvidersDynamic>; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use client'; | ||
|
||
import { AppConfig, OnchainKitProvider } from '@coinbase/onchainkit'; | ||
import { connectorsForWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; | ||
import { isDevelopment } from 'apps/web/src/constants'; | ||
import { createConfig, http, WagmiProvider } from 'wagmi'; | ||
import { base, baseSepolia, mainnet } from 'wagmi/chains'; | ||
import { | ||
coinbaseWallet, | ||
metaMaskWallet, | ||
phantomWallet, | ||
rainbowWallet, | ||
uniswapWallet, | ||
walletConnectWallet, | ||
} from '@rainbow-me/rainbowkit/wallets'; | ||
|
||
const connectors = connectorsForWallets( | ||
[ | ||
{ | ||
groupName: 'Recommended', | ||
wallets: [ | ||
coinbaseWallet, | ||
metaMaskWallet, | ||
uniswapWallet, | ||
rainbowWallet, | ||
phantomWallet, | ||
walletConnectWallet, | ||
], | ||
}, | ||
], | ||
{ | ||
projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID ?? 'dummy-id', | ||
walletConnectParameters: {}, | ||
appName: 'Base.org', | ||
appDescription: '', | ||
appUrl: 'https://www.base.org/', | ||
appIcon: '', | ||
}, | ||
); | ||
|
||
const config = createConfig({ | ||
connectors, | ||
chains: [base, baseSepolia, mainnet], | ||
transports: { | ||
[base.id]: http(), | ||
[baseSepolia.id]: http(), | ||
[mainnet.id]: http(), | ||
}, | ||
ssr: true, | ||
}); | ||
const queryClient = new QueryClient(); | ||
|
||
type CryptoProvidersProps = { | ||
children: React.ReactNode; | ||
}; | ||
|
||
const onchainKitConfig: AppConfig = { | ||
appearance: { | ||
mode: 'light', | ||
}, | ||
}; | ||
|
||
export default function CryptoProviders({ children }: CryptoProvidersProps) { | ||
return ( | ||
<WagmiProvider config={config}> | ||
<QueryClientProvider client={queryClient}> | ||
<OnchainKitProvider | ||
chain={isDevelopment ? baseSepolia : base} | ||
apiKey={process.env.NEXT_PUBLIC_ONCHAINKIT_API_KEY} | ||
config={onchainKitConfig} | ||
> | ||
<RainbowKitProvider modalSize="compact">{children}</RainbowKitProvider> | ||
</OnchainKitProvider> | ||
</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
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
Binary file added
BIN
+2.75 KB
apps/web/src/components/Basenames/RegistrationLearnMoreModal/images/devcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.