Skip to content

Commit 8941294

Browse files
committed
Adding Migration Guide to portal
1 parent 62c179d commit 8941294

File tree

2 files changed

+219
-0
lines changed
  • apps/portal/src/app/connect/wallet/web3-onboard

2 files changed

+219
-0
lines changed
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
# Migration Guide: Blocknative to thirdweb (2025)
2+
3+
## Introduction
4+
5+
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.
6+
7+
## Benefits of Migration
8+
9+
- Over 500+ wallet connections
10+
- Enhanced wallet connection experience
11+
- Access to thirdweb's broader ecosystem of tools
12+
- Ongoing support and updates from thirdweb
13+
14+
## Prerequisites
15+
16+
- An existing project using Blocknative/Web3Onboard
17+
- Basic familiarity with web3 development
18+
19+
## Migration Steps
20+
21+
### 1. Update Dependencies
22+
23+
First, remove the Blocknative packages and install the thirdweb packages:
24+
25+
```bash
26+
# Remove Blocknative packages
27+
npm uninstall bnc-onboard @web3-onboard/core @web3-onboard/injected-wallets
28+
29+
# Install thirdweb unified package
30+
npm install thirdweb
31+
32+
```
33+
34+
### 2. Update Configuration (React)
35+
36+
Replace your Blocknative configuration with thirdweb's:
37+
38+
### Before (with Blocknative):
39+
40+
```jsx
41+
import Onboard from '@web3-onboard/core';
42+
import injectedModule from '@web3-onboard/injected-wallets';
43+
44+
const injected = injectedModule();
45+
46+
const onboard = Onboard({
47+
wallets: [injected],
48+
chains: [
49+
{
50+
id: '0x1',
51+
token: 'ETH',
52+
label: 'Ethereum Mainnet',
53+
rpcUrl: 'https://mainnet.infura.io/v3/your-key'
54+
}
55+
]
56+
});
57+
58+
// Connect wallet
59+
const wallets = await onboard.connectWallet();
60+
61+
```
62+
63+
### After (with thirdweb):
64+
65+
1. Create your thirdweb project here.
66+
2. Wrap your application with the `<ThirdwebProvider/>`
67+
68+
```jsx
69+
import { ThirdwebProvider, ConnectButton } from "thirdweb/react";
70+
import { createThirdwebClient } from "thirdweb";
71+
72+
const client = createThirdwebClient({
73+
clientId: "YOUR_CLIENT_ID", // Get one from thirdweb.com/dashboard
74+
});
75+
76+
function App() {
77+
return (
78+
<ThirdwebProvider >
79+
{/* Your app content */}
80+
</ThirdwebProvider>
81+
);
82+
}
83+
84+
```
85+
86+
### 3. Custom Wallet Configuration
87+
88+
If you need to support specific wallets:
89+
90+
```jsx
91+
import {
92+
ThirdwebProvider,
93+
ConnectButton
94+
} from "thirdweb/react";
95+
import { createWallet } from "thirdweb/wallets";
96+
import { createThirdwebClient } from "thirdweb";
97+
98+
const client = createThirdwebClient({
99+
clientId: "YOUR_CLIENT_ID", // Get one from thirdweb.com/dashboard
100+
});
101+
102+
const wallets = [
103+
createWallet("io.metamask"), // Add your wallet in wallet list
104+
// add other wallets...
105+
];
106+
107+
function App() {
108+
return (
109+
<ThirdwebProvider>
110+
<ConnectButton
111+
client={client}
112+
wallets={wallets}/>
113+
</ThirdwebProvider>
114+
);
115+
}
116+
117+
```
118+
119+
### 4. Update Wallet Connection Logic
120+
121+
Replace the wallet connection logic:
122+
123+
### Before (with Blocknative):
124+
125+
```jsx
126+
const connectWallet = async () => {
127+
const wallets = await onboard.connectWallet();
128+
if (wallets[0]) {
129+
const provider = wallets[0].provider;
130+
// Use the provider
131+
}
132+
};
133+
134+
```
135+
136+
### After (with thirdweb):
137+
138+
```jsx
139+
import { useActiveWallet, useDisconnect, useConnect } from "thirdweb/react";
140+
141+
function WalletConnect() {
142+
const wallet = useActiveWallet();
143+
const { connect } = useConnect();
144+
const { disconnect } = useDisconnect();
145+
146+
if (wallet) {
147+
return (
148+
<div>
149+
<p>Connected: {wallet.address}</p>
150+
<button onClick={() => disconnect()}>Disconnect</button>
151+
</div>
152+
);
153+
}
154+
155+
return <button
156+
onClick={() =>
157+
connect(async () => {
158+
// instantiate wallet
159+
const wallet = createWallet("io.metamask");
160+
// connect wallet
161+
await wallet.connect({
162+
client,
163+
});
164+
// return the wallet
165+
return wallet;
166+
})
167+
}
168+
>
169+
Connect
170+
</button>;
171+
}
172+
173+
```
174+
175+
### 5. Multi-chain Support
176+
177+
Configure multi-chain support with thirdweb:
178+
179+
```jsx
180+
import { ThirdwebProvider } from "thirdweb/react";
181+
import { createThirdwebClient } from "thirdweb";
182+
import { ethereum, polygon, optimism, arbitrum } from "thirdweb/chains";
183+
184+
const client = createThirdwebClient({
185+
clientId: "YOUR_CLIENT_ID",
186+
});
187+
188+
function App() {
189+
return (
190+
<ThirdwebProvider>
191+
<ConnectButton client={client} chains={[ethereum, polygon, optimism, arbitrum]}/>
192+
</ThirdwebProvider>
193+
);
194+
}
195+
196+
```
197+
198+
### Common Issues
199+
200+
- **Wallet not connecting**: Ensure you've properly configured the ThirdwebProvider
201+
- **Missing wallets**: Check that you've added all wallet types to [supported wallets](https://portal.thirdweb.com/typescript/v5/supported-wallets)
202+
- **Chain not available**: Verify that the chain is properly configured and [supported by thridweb](https://thirdweb.com/chainlist)
203+
204+
### Support Resources
205+
206+
- [thirdweb Documentation](https://portal.thirdweb.com/connect)
207+
208+
## Next Steps
209+
210+
After successfully migrating, consider exploring additional thirdweb features:
211+
212+
- Smart wallets and account abstraction
213+
- In-app wallets for easier onboarding
214+
- Gas-less transactions
215+
- Advanced wallet management
216+
217+
## Conclusion
218+
219+
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.

0 commit comments

Comments
 (0)