-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-7005] fix: migrate web3Modal to reown-appkit #576
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces a comprehensive migration from Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (5)
src/config/wagmi.config.tsx (1)
28-43
: Check domain allowance and initial shim settings
The domain list for the 'safe' connector and the shimDisconnect usage for injected wallets look correct. Be mindful of additional domains you may need to support if your product domain or partner domains change.src/components/Cashout/Components/Initial.view.tsx (1)
74-74
: Connect wallet in handleConnectWallet
Calling open() can fail or reject if the user closes the modal or there’s an initialization error. You might want to capture that scenario to provide user feedback.- const handleConnectWallet = async () => { - open() - } + const handleConnectWallet = async () => { + try { + await open() + } catch (error) { + console.log("Wallet connection canceled or failed.", error) + } + }src/components/Request/Pay/Views/Initial.view.tsx (1)
73-73
: Open method usage
Similar to other components, consider adding some form of error handling around open() or a loading state to ensure a graceful fallback.Want help implementing a “try/catch” pattern or a user-facing error message if the user closes the wallet modal unexpectedly?
src/components/Create/Link/Input.view.tsx (2)
Line range hint
74-76
: Consider enhancing error handling for wallet connectionThe
handleConnectWallet
function could benefit from try-catch error handling to provide better user feedback for wallet connection failures.const handleConnectWallet = async () => { - open() + try { + await open() + } catch (error) { + setErrorState({ + showError: true, + errorMessage: 'Failed to connect wallet. Please try again.', + }) + } }
Line range hint
1-324
: Consider breaking down the component for better maintainabilityThe
CreateLinkInputView
component is quite large and handles multiple responsibilities. Consider breaking it down into smaller, more focused components:
- TokenInputSection
- WalletConnectionSection
- TransactionPreparationSection
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
package.json
(3 hunks)src/components/Cashout/Components/Initial.view.tsx
(2 hunks)src/components/Claim/Link/Initial.view.tsx
(2 hunks)src/components/Create/Link/Input.view.tsx
(2 hunks)src/components/Global/Header/index.tsx
(5 hunks)src/components/Global/TokenSelector/TokenSelector.tsx
(2 hunks)src/components/Profile/Components/SkeletonPage.tsx
(2 hunks)src/components/Refund/index.tsx
(1 hunks)src/components/Request/Pay/Views/Initial.view.tsx
(2 hunks)src/config/wagmi.config.tsx
(1 hunks)
🧰 Additional context used
📓 Learnings (1)
src/components/Request/Pay/Views/Initial.view.tsx (1)
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#422
File: src/components/Request/Pay/Views/Initial.view.tsx:76-78
Timestamp: 2024-11-12T09:39:20.720Z
Learning: In `src/components/Request/Pay/Views/Initial.view.tsx`, both `txFee` and `utils.formatTokenAmount(estimatedGasCost, 3)` return strings, ensuring consistent return types for `calculatedFee`.
🔇 Additional comments (26)
src/config/wagmi.config.tsx (5)
4-5
: Switching from Web3Modal to AppKit
Great job replacing the imports from "@Web3Modal" with "@reown/appkit". This step sets the foundation for your new wallet infrastructure.
45-50
: SSR usage with WagmiAdapter
You've enabled SSR (server-side rendering) here. Ensure that the rest of your components also handle SSR properly (e.g., checking window references).
[approve]
72-87
: Review repeated createAppKit block
Double check if you truly need to call createAppKit again here. If you need distinct configurations, consider clarifying them; otherwise, consolidate into one call.
91-91
: WagmiProvider usage
Using wagmiAdapter.wagmiConfig directly is a clean approach. Good job migrating from a custom config to the WagmiAdapter.
25-26
: Verify transport creation for each chain
You're creating transports with "http(chain.rpcUrls.default.http[0])". Confirm that each chain's first HTTP endpoint is guaranteed to be valid and secure.
✅ Verification successful
Let me search for the chain definitions to verify the RPC URLs configuration.
Let me check the chain definitions and RPC URL configurations in more detail.
Chain transport configuration appears secure
The chain configurations are well-defined and use secure sources:
- Custom chains (Milkomeda, Base, Taiko, zkSync) use official RPC endpoints
- Other chains are imported from the official wagmi/chains package which maintains a vetted list of RPC endpoints
- All chains have both public and default RPC URLs properly configured
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Searching for all chain definitions to confirm they have default http endpoints
rg 'chains.*rpcUrls.*default' -A 5
Length of output: 439
Script:
#!/bin/bash
# Search for chain constants or configurations
rg -g '!*.test.*' -g '!*.spec.*' "const.*chains.*=" -A 10
# Also search for chain imports to understand where they might be defined
rg -g '!*.test.*' -g '!*.spec.*' "import.*chain" -B 2 -A 2
Length of output: 5996
Script:
#!/bin/bash
# Check the custom chain definitions
rg -g '!*.test.*' -g '!*.spec.*' "const.*milkomeda.*=" -A 15
# Check the wagmi chains import usage
cat src/constants/chains.consts.ts
Length of output: 4910
src/components/Global/TokenSelector/TokenSelector.tsx (1)
16-16
: Migration to useAppKit
Properly replacing the useWeb3Modal import with useAppKit is consistent with the rest of the PR. Good work!
src/components/Cashout/Components/Initial.view.tsx (1)
7-7
: useAppKit import
The shift to "useAppKit" lines up with your new approach. The hook is used consistently throughout the component.
src/components/Request/Pay/Views/Initial.view.tsx (1)
3-3
: useAppKit import
Smooth transition from useWeb3Modal to useAppKit. This ensures consistent wallet management across the app.
src/components/Claim/Link/Initial.view.tsx (2)
7-7
: Successfully migrated to useAppKit.
This aligns perfectly with the PR objective of transitioning away from web3Modal. No issues detected.
87-87
: Double-check the “open” method usage.
Ensure any relevant errors are caught or handled when invoking the wallet modal.
package.json (7)
31-32
: Added @reown/appkit dependencies.
These packages are crucial for the new wallet integration; everything looks consistent with the PR objective.
36-36
: Upgraded @tanstack/react-query to 5.8.4.
Confirm that the new version remains compatible with existing query logic and testing.
39-39
: Downgraded @wagmi/core to 2.14.3.
Please verify whether any features from 2.14.6 are used. If not, this should be safe.
66-67
: Adjusted “viem” and “wagmi” versions.
Ensure there are no compatibility issues with the rest of the wagmi ecosystem.
70-71
: Added testing library dependencies.
Jest DOM and type definitions look good; confirm that they’re fully integrated into your test suite.
80-81
: Introduced Jest & jest-environment-jsdom.
These additions align well with front-end testing practices.
88-89
: Updated ts-jest & TypeScript versions.
Please confirm proper compatibility with the existing codebase and ensure type definitions remain accurate.
src/components/Refund/index.tsx (2)
13-13
: Migration to useAppKit.
Replacing web3Modal import is consistent with the overall wallet integration approach.
19-19
: Check for additional error handling with “open.”
The call to “open()” appears correct; consider adding try/catch if additional fallback is needed.
src/components/Global/Header/index.tsx (5)
9-10
: Replaced web3Modal import with useAppKit.
This is aligned with the new wallet strategy in the PR. No issues found.
225-225
: Renamed open to walletModal.
A consistent, readable naming convention that matches the new library usage.
262-262
: Wallet modal invocation.
Looks clear. Confirm whether you need to handle errors if the modal fails to open.
278-278
: Imported useAppKit again for the SocialLinks.
Ensures consistent usage across all components in the Header.
289-289
: Triggering walletModal in SocialLinks.
Good job consolidating this approach. Confirm error states or fallback UI if the user cancels.
src/components/Profile/Components/SkeletonPage.tsx (1)
4-4
: LGTM: Wallet connection migration looks good
The migration from web3Modal to reown-appkit has been implemented correctly, maintaining the existing functionality while updating the wallet connection mechanism.
Also applies to: 31-31
src/components/Create/Link/Input.view.tsx (1)
6-6
: LGTM: Wallet connection migration implemented correctly
The migration from web3Modal to reown-appkit has been implemented properly, maintaining the existing functionality.
Also applies to: 72-72
createAppKit({ | ||
adapters: [wagmiAdapter], | ||
networks: consts.chains, | ||
metadata, | ||
projectId, | ||
enableAnalytics: true, // Optional - defaults to your Cloud configuration | ||
features: { | ||
analytics: true, | ||
email: false, | ||
socials: false, | ||
onramp: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Potential duplication in createAppKit calls
You initialize createAppKit at lines 55-65 and again at lines 72-87. If the intention is to override or reinit after certain logic, confirm it’s necessary, as repeated initialization might cause confusion or re-initialization overhead.
- createAppKit({
- adapters: [wagmiAdapter],
- ...
- })
-
+// Consider removing the duplicate call if not strictly needed.
Committable suggestion skipped: line range outside the PR's diff.
} = useContext(context.tokenSelectorContext) | ||
const { isConnected } = useAccount() | ||
const { open } = useWeb3Modal() | ||
const { open } = useAppKit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Add error handling for wallet connection
The open()
call in TokenSelector.tsx lacks error handling. While most usages of open()
in the codebase are direct calls, there is a precedent in Request/Pay/Views/Initial.view.tsx
that uses .finally()
. Consider adding error handling using .catch()
to handle potential wallet connection failures gracefully and provide feedback to users.
Example locations needing attention:
src/components/Global/TokenSelector/TokenSelector.tsx:189
- Add.catch()
handler for theopen()
call
🔗 Analysis chain
Open wallet flow
Using “open()” to trigger the wallet connection from reown-appkit is straightforward. Ensure appropriate error handling or fallback in case the wallet configuration fails.
Let me gather more information about error handling around these open()
calls.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Checking if 'open()' calls are handled with try/catch or appropriate error boundaries
rg 'open\(' -A 5
Length of output: 10560
Script:
#!/bin/bash
# Check for try-catch blocks or error handling around open() calls
ast-grep --pattern 'try {
$$$
open()
$$$
}'
# Also check for .catch() or .finally() usage with open()
rg 'open\(\).*\.(catch|finally)'
Length of output: 167
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/components/Global/GeneralRecipientInput/index.tsx (1)
66-66
: Consider consolidating address validation logicThe address validation change matches the one in
AddressInput
, but both components maintain separate validation logic. Consider extracting this into a shared utility function to ensure consistent validation across the application.Example implementation:
// src/utils/validation.ts export const validateEthereumAddress = (address: string): boolean => { return isAddress(address); };This would help maintain consistency as the codebase migrates to reown-appkit and reduce duplication.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/Global/AddressInput/index.tsx
(1 hunks)src/components/Global/GeneralRecipientInput/index.tsx
(1 hunks)
🔇 Additional comments (2)
src/components/Global/AddressInput/index.tsx (1)
21-21
: Verify the impact of stricter address validation
Removing { strict: false }
from isAddress
makes the validation more stringent. This could potentially affect existing valid addresses that previously passed validation.
Let's verify the impact:
✅ Verification successful
Let me analyze the impact of stricter address validation by checking how isAddress
is used in the codebase.
Removing { strict: false }
from isAddress
is safe
The stricter address validation is safe to implement because:
- All addresses found in the codebase are properly formatted EIP-55 compliant addresses
- The
isAddress
function is used consistently across components (AddressInput, AddressLink, GeneralRecipientInput) without any special options - The addresses used in constants and utils are all valid checksummed addresses that will pass strict validation
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for existing address patterns in the codebase that might be affected by stricter validation
rg -l '[0-9a-fA-F]{40}' | while read -r file; do
echo "=== $file ==="
rg -A 1 '[0-9a-fA-F]{40}' "$file"
done
Length of output: 8432
Script:
#!/bin/bash
# Search for all usages of isAddress function
rg -A 2 "isAddress\("
# Also check for any test cases or validation patterns
ast-grep --pattern 'isAddress($_)'
Length of output: 1402
src/components/Global/GeneralRecipientInput/index.tsx (1)
Line range hint 37-68
: Verify ENS resolution compatibility with reown-appkit
The ENS resolution logic is intertwined with address validation. Since we're migrating to reown-appkit, we should verify that the ENS resolution process is compatible with the new setup.
Let's check for any potential conflicts:
name: 'Peanut Protocol', | ||
description: 'Peanut protocol - send crypto with links', | ||
url: 'https://peanut.to', // origin must match your domain & subdomain | ||
url: process.env.NEXT_PUBLIC_BASE_URL || 'https://peanut.to', // origin must match your domain & subdomain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥🔥🔥🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but right now the image is not building, check errors by doing a pnpm build
This is the error I'm getting:
./src/config/wagmi.config.tsx:50:5
Type error: Type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._txfnpea6k26ediztrzq6synpsa/node_modules/@wagmi/core/dist/types/connectors/createConnector").CreateConnectorFn[]' is not assignable to type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._ejk5cqydnu66zcolkw7v3fb5z4/node_modules/@wagmi/core/dist/types/connectors/createConnector").CreateConnectorFn[]'.
Type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._txfnpea6k26ediztrzq6synpsa/node_modules/@wagmi/core/dist/types/connectors/createConnector").CreateConnectorFn' is not assignable to type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._ejk5cqydnu66zcolkw7v3fb5z4/node_modules/@wagmi/core/dist/types/connectors/createConnector").CreateConnectorFn'.
Types of parameters 'config' and 'config' are incompatible.
Type '{ chains: readonly [import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/viem/_types/types/chain").Chain, ...import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/[email protected][email protected]_typescri...' is not assignable to type '{ chains: readonly [import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]/node_modules/viem/_types/types/chain").Chain, ...import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/[email protected][email protected]_typescri...'. Two different types with this name exist, but they are unrelated.
Types of property 'transports' are incompatible.
Type 'Record<number, import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._ejk5cqydnu66zcolkw7v3fb5z4/node_modules/@wagmi/core/dist/types/createConfig").Transport> | undefined' is not assignable to type 'Record<number, import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._txfnpea6k26ediztrzq6synpsa/node_modules/@wagmi/core/dist/types/createConfig").Transport> | undefined'.
Type 'Record<number, import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._ejk5cqydnu66zcolkw7v3fb5z4/node_modules/@wagmi/core/dist/types/createConfig").Transport>' is not assignable to type 'Record<number, import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._txfnpea6k26ediztrzq6synpsa/node_modules/@wagmi/core/dist/types/createConfig").Transport>'.
'number' index signatures are incompatible.
Type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._ejk5cqydnu66zcolkw7v3fb5z4/node_modules/@wagmi/core/dist/types/createConfig").Transport' is not assignable to type 'import("/home/juan/Programming/peanut/peanut-ui/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected]_typescript@5._txfnpea6k26ediztrzq6synpsa/node_modules/@wagmi/core/dist/types/createConfig").Transport'.
Types of parameters 'params' and 'params' are incompatible.
Type '{ chain?: Chain | undefined; pollingInterval?: number | undefined; retryCount?: number | undefined; timeout?: number | undefined; } & { connectors?: StoreApi<Connector<CreateConnectorFn>[]> | undefined; }' is not assignable to type '{ chain?: Chain | undefined; pollingInterval?: number | undefined; retryCount?: number | undefined; timeout?: number | undefined; } & { connectors?: StoreApi<Connector[]> | undefined; }'.
Type '{ chain?: Chain | undefined; pollingInterval?: number | undefined; retryCount?: number | undefined; timeout?: number | undefined; } & { connectors?: StoreApi<Connector<CreateConnectorFn>[]> | undefined; }' is not assignable to type '{ connectors?: StoreApi<Connector[]> | undefined; }'.
Types of property 'connectors' are incompatible.
Type 'StoreApi<Connector<CreateConnectorFn>[]> | undefined' is not assignable to type 'StoreApi<Connector[]> | undefined'.
Type 'StoreApi<Connector<CreateConnectorFn>[]>' is not assignable to type 'StoreApi<Connector[]>'.
The types returned by 'getState()' are incompatible between these types.
Type 'Connector<CreateConnectorFn>[]' is not assignable to type 'Connector[]'.
Type 'Connector<CreateConnectorFn>' is not assignable to type 'Connector'.
Type 'Connector<CreateConnectorFn>' is not assignable to type '{ [x: string]: unknown; readonly icon?: string | undefined; readonly id: string; readonly name: string; readonly rdns?: string | undefined; readonly supportsSimulation?: boolean | undefined; ... 14 more ...; onMessage?: ((message: ProviderMessage) => void) | undefined; }'.
Types of property 'rdns' are incompatible.
Type 'string | readonly string[] | undefined' is not assignable to type 'string | undefined'.
Type 'readonly string[]' is not assignable to type 'string'.
48 | projectId,
49 | transports,
> 50 | connectors,
| ^
51 | ssr: true,
52 | })
53 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/config/wagmi.config.tsx (1)
20-20
: Consider environment-specific fallback URLThe hardcoded fallback URL 'https://peanut.to' might not be suitable for all environments (development, staging, etc.).
- url: process.env.NEXT_PUBLIC_BASE_URL || 'https://peanut.to', + url: process.env.NEXT_PUBLIC_BASE_URL || process.env.NEXT_PUBLIC_FALLBACK_URL || 'https://peanut.to',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.json
(4 hunks)src/config/wagmi.config.tsx
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
🔇 Additional comments (4)
src/config/wagmi.config.tsx (4)
4-6
: LGTM: Imports correctly updated for reown-appkit migration
The imports have been appropriately updated to replace web3modal with reown-appkit and its wagmi adapter.
45-52
: Verify SSR configuration impact
The WagmiAdapter is configured with ssr: true
. Please ensure this aligns with your server-side rendering requirements and test the application in both SSR and client-side contexts.
55-65
: Remove duplicate AppKit initialization
The createAppKit initialization appears to be duplicated in the codebase.
74-74
: LGTM: Provider configuration updated correctly
The WagmiProvider has been properly updated to use the new wagmiAdapter configuration.
✅ Verification successful
LGTM: Single WagmiProvider instance correctly updated
The verification confirms that there is only one instance of WagmiProvider in the codebase, located in src/config/wagmi.config.tsx
. The configuration update is properly contained to this single location, and no other instances require attention.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any other WagmiProvider configurations that might need updating
rg "WagmiProvider" --type typescript --type javascript -B 2 -A 2
Length of output: 99
Script:
#!/bin/bash
# Search for WagmiProvider usage with proper file extensions
rg "WagmiProvider" -t tsx -t jsx -t js -B 2 -A 2
Length of output: 76
Script:
#!/bin/bash
# Find all TypeScript/JavaScript files that might contain WagmiProvider
fd -e tsx -e jsx -e js -e ts | xargs grep -l "WagmiProvider" || true
Length of output: 88
Script:
#!/bin/bash
# Use ast-grep to find WagmiProvider component usage
ast-grep --pattern '<WagmiProvider $$$>$$$</WagmiProvider>'
Length of output: 324
// 3. Create transports for each chain | ||
const transports = Object.fromEntries(consts.chains.map((chain) => [chain.id, http(chain.rpcUrls.default.http[0])])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling for RPC URL configuration
Consider adding validation and error handling for RPC URLs to prevent runtime issues with invalid configurations.
-const transports = Object.fromEntries(consts.chains.map((chain) => [chain.id, http(chain.rpcUrls.default.http[0])]))
+const transports = Object.fromEntries(
+ consts.chains.map((chain) => {
+ const rpcUrl = chain.rpcUrls.default.http[0]
+ if (!rpcUrl) {
+ throw new Error(`No RPC URL configured for chain ${chain.id}`)
+ }
+ return [chain.id, http(rpcUrl)]
+ })
+)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// 3. Create transports for each chain | |
const transports = Object.fromEntries(consts.chains.map((chain) => [chain.id, http(chain.rpcUrls.default.http[0])])) | |
// 3. Create transports for each chain | |
const transports = Object.fromEntries( | |
consts.chains.map((chain) => { | |
const rpcUrl = chain.rpcUrls.default.http[0] | |
if (!rpcUrl) { | |
throw new Error(`No RPC URL configured for chain ${chain.id}`) | |
} | |
return [chain.id, http(rpcUrl)] | |
}) | |
) |
Migration from Web3Modal to Reown AppKit
reown-appkit
for wallet connection handlingWagmiAdapter
useWeb3Modal
to useuseAppKit
hook fromreown-appkit
Summary by CodeRabbit
Release Notes
New Features
@reown/appkit
.Bug Fixes
Chores