-
Notifications
You must be signed in to change notification settings - Fork 619
[Portal] Block native to thridweb guide #6977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8941294
Adding Migration Guide to portal
Joe-Thirdweb 6272112
adding sidebar routing.
Joe-Thirdweb cf0bf4e
fixing Migration Guide routing
Joe-Thirdweb 467817a
Update apps/portal/src/app/connect/wallet/web3-onboard/migration-guid…
saminacodes 75275a4
Adding Step, removing conclusion, turning into links.
Joe-Thirdweb 855c0ae
Updated with Samina notes.
Joe-Thirdweb 31b0bae
Merge branch 'BlockNative-to-thridweb' of https://github.com/thirdweb…
Joe-Thirdweb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
219 changes: 219 additions & 0 deletions
219
apps/portal/src/app/connect/wallet/web3-onboard/migration-guide/page.mdx
This file contains hidden or 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,219 @@ | ||
| # Migration Guide: Blocknative to thirdweb (2025) | ||
|
|
||
| ## Introduction | ||
|
|
||
| Learn how to migrate from Blocknative's Web3Onboard to thirdweb while maintaining the same wallet support. Following thirdweb's acquisition of Web3Onboard in January 2025, this migration will enable you to leverage thirdweb's enhanced features while ensuring a seamless transition for your users. | ||
|
|
||
| ## Benefits of Migration | ||
|
|
||
| - Over 500+ wallet connections | ||
| - Enhanced wallet connection experience | ||
| - Access to thirdweb's broader ecosystem of tools | ||
| - Ongoing support and updates from thirdweb | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - An existing project using Blocknative/Web3Onboard | ||
| - Basic familiarity with web3 development | ||
|
|
||
| ## Migration Steps | ||
|
|
||
| ### 1. Update Dependencies | ||
|
|
||
| First, remove the Blocknative packages and install the thirdweb packages: | ||
|
|
||
| ```bash | ||
| # Remove Blocknative packages | ||
| npm uninstall bnc-onboard @web3-onboard/core @web3-onboard/injected-wallets | ||
|
|
||
| # Install thirdweb unified package | ||
| npm install thirdweb | ||
|
|
||
| ``` | ||
|
|
||
| ### 2. Update Configuration (React) | ||
|
|
||
| Replace your Blocknative configuration with thirdweb's: | ||
|
|
||
| ### Before (with Blocknative): | ||
|
|
||
| ```jsx | ||
| import Onboard from '@web3-onboard/core'; | ||
| import injectedModule from '@web3-onboard/injected-wallets'; | ||
|
|
||
| const injected = injectedModule(); | ||
|
|
||
| const onboard = Onboard({ | ||
| wallets: [injected], | ||
| chains: [ | ||
| { | ||
| id: '0x1', | ||
| token: 'ETH', | ||
| label: 'Ethereum Mainnet', | ||
| rpcUrl: 'https://mainnet.infura.io/v3/your-key' | ||
| } | ||
| ] | ||
| }); | ||
|
|
||
| // Connect wallet | ||
| const wallets = await onboard.connectWallet(); | ||
|
|
||
| ``` | ||
|
|
||
| ### After (with thirdweb): | ||
|
|
||
| 1. Create your thirdweb project here. | ||
| 2. Wrap your application with the `<ThirdwebProvider/>` | ||
|
|
||
| ```jsx | ||
| import { ThirdwebProvider, ConnectButton } from "thirdweb/react"; | ||
| import { createThirdwebClient } from "thirdweb"; | ||
|
|
||
| const client = createThirdwebClient({ | ||
| clientId: "YOUR_CLIENT_ID", // Get one from thirdweb.com/dashboard | ||
| }); | ||
|
|
||
| function App() { | ||
| return ( | ||
| <ThirdwebProvider > | ||
| {/* Your app content */} | ||
| </ThirdwebProvider> | ||
| ); | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### 3. Custom Wallet Configuration | ||
|
|
||
| If you need to support specific wallets: | ||
|
|
||
| ```jsx | ||
| import { | ||
| ThirdwebProvider, | ||
| ConnectButton | ||
| } from "thirdweb/react"; | ||
| import { createWallet } from "thirdweb/wallets"; | ||
| import { createThirdwebClient } from "thirdweb"; | ||
|
|
||
| const client = createThirdwebClient({ | ||
| clientId: "YOUR_CLIENT_ID", // Get one from thirdweb.com/dashboard | ||
| }); | ||
|
|
||
| const wallets = [ | ||
| createWallet("io.metamask"), // Add your wallet in wallet list | ||
| // add other wallets... | ||
| ]; | ||
|
|
||
| function App() { | ||
| return ( | ||
| <ThirdwebProvider> | ||
| <ConnectButton | ||
| client={client} | ||
| wallets={wallets}/> | ||
| </ThirdwebProvider> | ||
| ); | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### 4. Update Wallet Connection Logic | ||
|
|
||
| Replace the wallet connection logic: | ||
|
|
||
| ### Before (with Blocknative): | ||
|
|
||
| ```jsx | ||
| const connectWallet = async () => { | ||
| const wallets = await onboard.connectWallet(); | ||
| if (wallets[0]) { | ||
| const provider = wallets[0].provider; | ||
| // Use the provider | ||
| } | ||
| }; | ||
|
|
||
| ``` | ||
|
|
||
| ### After (with thirdweb): | ||
|
|
||
| ```jsx | ||
| import { useActiveWallet, useDisconnect, useConnect } from "thirdweb/react"; | ||
|
|
||
| function WalletConnect() { | ||
| const wallet = useActiveWallet(); | ||
| const { connect } = useConnect(); | ||
| const { disconnect } = useDisconnect(); | ||
|
|
||
| if (wallet) { | ||
| return ( | ||
| <div> | ||
| <p>Connected: {wallet.address}</p> | ||
| <button onClick={() => disconnect()}>Disconnect</button> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| return <button | ||
| onClick={() => | ||
| connect(async () => { | ||
| // instantiate wallet | ||
| const wallet = createWallet("io.metamask"); | ||
| // connect wallet | ||
| await wallet.connect({ | ||
| client, | ||
| }); | ||
| // return the wallet | ||
| return wallet; | ||
| }) | ||
| } | ||
| > | ||
| Connect | ||
| </button>; | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### 5. Multi-chain Support | ||
|
|
||
| Configure multi-chain support with thirdweb: | ||
|
|
||
| ```jsx | ||
| import { ThirdwebProvider } from "thirdweb/react"; | ||
| import { createThirdwebClient } from "thirdweb"; | ||
| import { ethereum, polygon, optimism, arbitrum } from "thirdweb/chains"; | ||
|
|
||
| const client = createThirdwebClient({ | ||
| clientId: "YOUR_CLIENT_ID", | ||
| }); | ||
|
|
||
| function App() { | ||
| return ( | ||
| <ThirdwebProvider> | ||
| <ConnectButton client={client} chains={[ethereum, polygon, optimism, arbitrum]}/> | ||
| </ThirdwebProvider> | ||
| ); | ||
| } | ||
|
|
||
| ``` | ||
|
|
||
| ### Common Issues | ||
|
|
||
| - **Wallet not connecting**: Ensure you've properly configured the ThirdwebProvider | ||
| - **Missing wallets**: Check that you've added all wallet types to [supported wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets) | ||
| - **Chain not available**: Verify that the chain is properly configured and [supported by thridweb](https://thirdweb.com/chainlist) | ||
|
|
||
| ### Support Resources | ||
|
|
||
| - [thirdweb Documentation](https://portal.thirdweb.com/connect) | ||
|
|
||
| ## Next Steps | ||
|
|
||
| After successfully migrating, consider exploring additional thirdweb features: | ||
|
|
||
| - Smart wallets and account abstraction | ||
| - In-app wallets for easier onboarding | ||
| - Gas-less transactions | ||
| - Advanced wallet management | ||
|
|
||
| ## Conclusion | ||
|
|
||
| By following this guide, you've successfully migrated from Blocknative to thirdweb while maintaining the same wallet support. Your users will experience no disruption in service, and you can now take advantage of thirdweb's comprehensive web3 development platform. | ||
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.