-
Notifications
You must be signed in to change notification settings - Fork 46
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
chore(web): migrate-to-reown #1866
base: dev
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces a comprehensive update to the web application's dependency management and wallet connection infrastructure. The changes primarily involve migrating from Web3Modal to AppKit, updating various dependencies across multiple packages, and refactoring wallet-related components to use the new Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
🪧 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 (
|
✅ Deploy Preview for kleros-v2-testnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-neo ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-university ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for kleros-v2-testnet-devtools ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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: 1
🧹 Nitpick comments (2)
web/src/pages/GetPnk/WalletProvider.tsx (2)
24-27
: Lazy initialization ofadapter.current
.
This is a neat pattern. Make sure to handle any potential concurrency issues if another part of the app needs to prime this adapter simultaneously.
45-46
: Nitpick: Clarify the overlay z-index.
Consider referencing a constants file for layering or theming to avoid “magic numbers.”
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (6)
web/package.json
(1 hunks)web/src/components/ConnectWallet/index.tsx
(2 hunks)web/src/consts/chains.ts
(1 hunks)web/src/consts/eip712-messages.ts
(2 hunks)web/src/context/Web3Provider.tsx
(3 hunks)web/src/pages/GetPnk/WalletProvider.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- web/src/consts/eip712-messages.ts
⏰ Context from checks skipped due to timeout of 90000ms (15)
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: contracts-testing
- GitHub Check: SonarCloud
- GitHub Check: Analyze (javascript)
🔇 Additional comments (19)
web/src/pages/GetPnk/WalletProvider.tsx (6)
5-7
: Imports from@reown/appkit
appear correct.
Nicely aligns with the new Reown-based architecture and replaces the old Wagmi imports.
10-10
: Confirm that this WagmiProvider is still needed.
Can you confirm whether the WagmiProvider from the original package is indeed essential, now that we are usingWagmiAdapter
?
22-22
: useRef for adapter is fine.
Using a ref to persist the adapter instance is a valid approach and helps preserve state across re-renders.
34-34
: Syncing wagmiConfig with connectors and chains.
Please ensure that the connectors array includes all necessary connectors for your use cases, especially if you plan to integrate more wallets.
36-41
:createAppKit
parameters look consistent with environment logic.
Check that the selected production network truly aligns with your QA environment. If this is “only testing,” consider making the environment toggles more explicit (e.g., staging vs production).
51-51
: WagmiProviderreconnectOnMount={false}
.
Be aware that users may have to manually reconnect each session. Confirm that this is the intended behavior.web/src/context/Web3Provider.tsx (6)
3-11
: Imports from@reown/appkit/networks
Good to see you migrating chain constants to the new library. Verify that all relevant chain data (explorers, block time, etc.) is present if your dApp depends on it.
12-14
: Including Wagmi’s fallback, http, and webSocket.
Retaining Wagmi utilities may be helpful for bridging. Confirm if the fallback approach is practical for all targeted networks.
76-76
: CastingALL_CHAINS
to[AppKitNetwork, ...AppKitNetwork[]]
Verify thatALL_CHAINS
is never empty at runtime to avoid type mismatch.
84-86
:wagmiAdapter
initialization
This is a clear approach to unify networks, projectId, and transports. Make sure each chain’s RPCs are stable under high load or fail gracefully.
97-114
:createAppKit
call
The addedfeatures
key and the commented-out items can be toggled anytime. Good for future expansions. Confirm you’re comfortable withallowUnsupportedChain: true
if your dApp must strictly limit supported networks.
118-118
: Wrapping children with<WagmiProvider>
.
Ensure you have tested the end-to-end re-render flows after this migration, especially if children rely on Wagmi context.web/src/consts/chains.ts (3)
1-2
: Switch toAppKitNetwork
andChain
fromviem
.
The new type references look correct for the Reown migration.
9-9
:SUPPORTED_CHAINS
recorded asAppKitNetwork
.
Ensure contracts or watchers referencing old Wagmi chain definitions are updated accordingly.
14-14
:QUERY_CHAINS
changed toAppKitNetwork
.
This aligns read-only flow with the new app kit approach. Check any offchain data queries for chain mismatch.web/src/components/ConnectWallet/index.tsx (2)
3-3
: LGTM! Import changes align with migration objective.The migration from Web3Modal to AppKit imports is correctly implemented.
38-39
: Verify AppKit API compatibility.The migration from Web3Modal to AppKit looks correct, but since this is marked as "Only testing", please verify:
- The
open
method signature matches between Web3Modal and AppKit- The state management behavior remains consistent
- No breaking changes in the modal behavior
✅ Verification successful
AppKit integration verified successfully
The migration from Web3Modal to AppKit is safe and compatible:
- Hook patterns and state management are identical
- Built on the same foundations (WalletConnect, viem)
- Using stable version (1.6.5) with proper wagmi adapter
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any other Web3Modal usages that might need migration rg -l "@web3modal" . # Search for AppKit usage patterns to ensure consistency rg "useAppKit|useAppKitState" . # Look for any migration guides or breaking changes rg -l "migration|breaking.+changes" .Length of output: 682
Script:
#!/bin/bash # Check Web3Modal implementation in web-devtools cat ./web-devtools/src/components/ConnectWallet/index.tsx # Check Web3Provider implementation cat ./web-devtools/src/context/Web3Provider.tsx # Look for AppKit documentation or type definitions fd "appkit.*d.ts|appkit.*md" .Length of output: 5110
Script:
#!/bin/bash # Check if AppKit is a published package and examine its details npm info @reown/appkit # Look for local AppKit implementation fd -g "*appkit*" . # Check package.json for AppKit dependency cat ./web/package.jsonLength of output: 6345
web/package.json (2)
82-82
: Verify stability of @bigmi/react.The package version (^0.1.0) indicates an early release. Since this is a testing phase:
- Verify package stability
- Check for breaking changes in future releases
- Consider pinning the version
90-91
: Verify LIFI dependency updates.The updates to LIFI packages (@lifi/wallet-management, @lifi/widget) should be reviewed:
- Check changelog for breaking changes
- Verify compatibility with new wallet adapters
✅ Verification successful
LIFI dependency updates are safe to proceed.
The updates to @lifi/widget (3.14.2) and @lifi/wallet-management (3.6.0) contain only bug fixes and non-breaking features that improve address handling, UI components, and wallet support. The changes are compatible with current usage in the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for LIFI-related issues gh api -X GET search/issues -f q="repo:kleros/kleros-v2 lifi" # Look for LIFI integration points rg "@lifi" .Length of output: 66992
Script:
#!/bin/bash # Check LIFI widget changelog curl -s https://raw.githubusercontent.com/lifinance/widget/main/CHANGELOG.md # Check LIFI wallet management changelog curl -s https://raw.githubusercontent.com/lifinance/widget/main/packages/wallet-management/CHANGELOG.md # Look for LIFI integration points to verify compatibility rg -A 5 "import.*@lifi" .Length of output: 78034
Script:
#!/bin/bash # Find LIFI widget usage ast-grep --pattern 'import { LiFiWidget } from "@lifi/widget"' # Find LIFI wallet management usage ast-grep --pattern 'import { $_ } from "@lifi/wallet-management"' # Look for LIFI configuration rg -A 5 "LiFiWidget" .Length of output: 923
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (3)
kleros-app/package.json
(1 hunks)web-devtools/package.json
(1 hunks)web/package.json
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- web/package.json
⏰ Context from checks skipped due to timeout of 90000ms (15)
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: SonarCloud
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
kleros-app/package.json (1)
64-64
: Verify wagmi version compatibility with @reown/appkit.Let's ensure the wagmi version is compatible with @reown/appkit requirements.
✅ Verification successful
wagmi v2.14.0 is compatible with @reown/appkit ✅
@reown/appkit uses viem 2.x, which is the same foundation that wagmi 2.x is built upon, ensuring compatibility between these packages.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check @reown/appkit's wagmi version requirements # Get @reown/appkit package.json curl -s "https://registry.npmjs.org/@reown/appkit/latest" | jq -r '.peerDependencies.wagmi'Length of output: 94
Script:
#!/bin/bash # Description: Check @reown/appkit package details # Get full package.json to examine all dependency fields curl -s "https://registry.npmjs.org/@reown/appkit/latest" | jq '{ name: .name, version: .version, dependencies, peerDependencies, devDependencies }'Length of output: 1090
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)
kleros-app/README.md (1)
30-30
: Fix syntax error in the example code.The example code has a syntax error in the return statement. The return statement should include parentheses.
- return + return ( <WagmiProvider config={config}> <QueryClientProvider client={queryClient}> <AtlasProvider config={{ uri: import.meta.env.REACT_APP_ATLAS_URI, product: Products.CourtV2, wagmiConfig: wagmiConfig }}> ... </AtlasProvider> </QueryClientProvider> </WagmiProvider> + )Also applies to: 35-36, 40-40
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
kleros-app/README.md
(1 hunks)kleros-app/src/lib/atlas/providers/AtlasProvider.tsx
(3 hunks)web/src/context/AtlasProvider.tsx
(1 hunks)
🧰 Additional context used
📓 Learnings (1)
web/src/context/AtlasProvider.tsx (1)
Learnt from: Harman-singh-waraich
PR: kleros/kleros-v2#1687
File: web/src/context/AtlasProvider.tsx:225-244
Timestamp: 2024-11-12T04:49:48.060Z
Learning: In `web/src/context/AtlasProvider.tsx`, the `atlasUri` variable comes from environment variables and does not change, so it does not need to be included in dependency arrays.
⏰ Context from checks skipped due to timeout of 90000ms (14)
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet-devtools
- GitHub Check: Header rules - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-testnet-devtools
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
web/src/context/AtlasProvider.tsx (2)
3-3
: LGTM: Import statement is correctly placed.The import of
useConfig
from wagmi is appropriately placed with other imports.
8-8
: LGTM: Proper usage of wagmi configuration.The
useConfig
hook is correctly used to obtain the wagmi configuration, and it's properly passed to the_AtlasProvider
component.Also applies to: 10-10
kleros-app/src/lib/atlas/providers/AtlasProvider.tsx (3)
5-5
: LGTM: Import statement includes necessary types.The import statement correctly includes the Config type from wagmi.
56-56
: LGTM: Interface properly extended.The AtlasConfig interface is correctly extended with the wagmiConfig property.
60-61
: LGTM: Consistent wagmi hook configuration.The wagmi hooks (useAccount, useChainId, useSignMessage) are consistently configured with the provided wagmiConfig.
Also applies to: 70-70
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
🔭 Outside diff range comments (1)
web-devtools/src/context/Web3Provider.tsx (1)
68-69
: Updatechains
type toAppKitNetwork[]
for compatibilityCurrently,
chains
is defined asALL_CHAINS as [Chain, ...Chain[]];
. Since AppKit expects networks to be of typeAppKitNetwork[]
, consider updating the type to ensure compatibility and prevent type errors.Apply this diff to update the type:
-const chains = ALL_CHAINS as [Chain, ...Chain[]]; +import { type AppKitNetwork } from "@reown/appkit"; + +const chains = ALL_CHAINS as [AppKitNetwork, ...AppKitNetwork[]];
🧹 Nitpick comments (1)
web-devtools/src/consts/chains.ts (1)
11-14
: Consider documenting the purpose of QUERY_CHAINS.The type migration looks good. However, it would be helpful to add a comment explaining why certain chains are included in
QUERY_CHAINS
vsSUPPORTED_CHAINS
.+// QUERY_CHAINS represents chains used for data querying purposes, +// while SUPPORTED_CHAINS represents chains where the application can be deployed export const QUERY_CHAINS: Record<number, AppKitNetwork> = {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (4)
web-devtools/package.json
(2 hunks)web-devtools/src/components/ConnectWallet/index.tsx
(2 hunks)web-devtools/src/consts/chains.ts
(1 hunks)web-devtools/src/context/Web3Provider.tsx
(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- web-devtools/package.json
⏰ Context from checks skipped due to timeout of 90000ms (16)
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet-devtools
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: SonarCloud
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
- GitHub Check: Mend Security Check
🔇 Additional comments (10)
web-devtools/src/components/ConnectWallet/index.tsx (3)
3-3
: LGTM! Import changes align with AppKit migration.The new imports from
@reown/appkit/react
correctly replace the Web3Modal imports as part of the migration to AppKit.
49-55
: LGTM! Component logic remains appropriately unchanged.The component correctly maintains its decision-making logic while integrating with AppKit through the
ConnectButton
component.
35-47
: Verify the AppKit view parameter.The migration to AppKit hooks looks good, but let's verify that "Connect" is a valid value for the
view
parameter in AppKit's documentation.✅ Verification successful
🌐 Web query:
What are the valid view values for @reown/appkit's open method?
💡 Result:
The valid view values for `@reown/appkit`'s `open` method include: - **Core wallet interactions**: - `Connect` (default when disconnected) - `Account` (default when connected) - `AllWallets` (wallet selection list) - `Networks` (network selection) - **Educational views**: - `WhatIsAWallet` - `WhatIsANetwork` - **Transaction features**: - `Swap` (on-ramp/crypto exchange interface) - `WalletSend` (asset transfer screen) - `OnRampProviders` These views enable granular control over modal content[1][4][7]. Developers can trigger specific flows programmatically using: ```javascript modal.open({ view: 'Swap' }) // Example for crypto swap interface ``` The views vary slightly between frameworks (React/Vue/React Native) but maintain consistent core options[2][5][7]. Some views like `Networks` allow pre-connection network selection[4][8]. Citations: - 1: https://github.com/reown-com/appkit/releases - 2: https://docs.reown.com/appkit/next/core/installation - 3: https://github.com/reown-com/reown-docs/blob/main/docs/appkit/upgrade/to-reown-appkit-ethers-web.mdx - 4: https://docs.reown.com/appkit/react-native/core/hooks - 5: https://docs.reown.com/appkit/react/core/installation - 6: https://developer.apple.com/documentation/appkit/nsview/previousvalidkeyview - 7: https://docs.reown.com/appkit/vue/core/composables - 8: https://docs.reown.com/appkit/upgrade/to-reown-appkit-web - 9: https://developer.apple.com/documentation/macos-release-notes/appkit-release-notes-for-macos-10_14 - 10: https://github.com/reown-com/reown-docs/blob/main/docs/appkit/upgrade/to-reown-appkit-web.mdx
The "Connect" view parameter is valid.
The web documentation confirms that "Connect" is among the valid values for theopen
method in@reown/appkit
(default when disconnected). The migration to AppKit hooks, including the use ofopen({ view: "Connect" })
, is correct.web-devtools/src/context/Web3Provider.tsx (5)
4-5
: Appropriate imports for AppKit migrationThe updated imports from
wagmi
and@reown/appkit/networks
are correctly included for the AppKit integration.
11-12
: Correctly importingcreateAppKit
andWagmiAdapter
The addition of
createAppKit
andWagmiAdapter
imports is necessary for the new AppKit-based implementation.
76-78
: EnsurewagmiAdapter
receives correct network typesAfter updating
chains
toAppKitNetwork[]
, thewagmiAdapter
will receive networks of the expected type, ensuring type compatibility.
89-92
: Verify network types increateAppKit
configurationEnsure that
networks
anddefaultNetwork
provided tocreateAppKit
are of the correctAppKitNetwork
types. This will align with AppKit's requirements and prevent potential runtime issues.
100-100
: Confirm correct configuration passed toWagmiProvider
Using
wagmiAdapter.wagmiConfig
inWagmiProvider
appears appropriate. Verify thatwagmiConfig
contains all necessary configurations for the provider to function correctly.web-devtools/src/consts/chains.ts (2)
7-9
: LGTM! Type migration looks good.The update to use
AppKitNetwork
type is consistent with the migration strategy while maintaining the same logical structure.
1-1
: LGTM! Verify @reown/appkit version.The migration from
viem/chains
to@reown/appkit/networks
aligns with the PR objectives.Let's verify the package version and its compatibility:
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Check the installed version of @reown/appkit jq '.dependencies["@reown/appkit"]' package.json # Check if there are any peer dependency conflicts npm ls @reown/appkitLength of output: 126
I'll run an additional script to search throughout the repository for any references or declarations of
@reown/appkit
to ensure that it’s properly listed as a dependency (or otherwise pulled in transitively).
🏁 Script executed:
#!/bin/bash echo "Searching for '@reown/appkit' in package.json..." rg '@reown/appkit' package.json echo "Searching for '@reown/appkit' in package-lock.json..." rg '@reown/appkit' package-lock.json || echo "package-lock.json not found." echo "Searching for '@reown/appkit' in yarn.lock..." rg '@reown/appkit' yarn.lock || echo "yarn.lock not found." echo "Searching for '@reown/appkit' in the entire repository (excluding node_modules)..." rg '@reown/appkit' --glob '!node_modules'Length of output: 7711
LGTM –
@reown/appkit
version verified.The search confirms that the dependency is declared with version
^1.6.5
(as seen in the relevantpackage.json
files and the lock file), and no peer dependency conflicts were detected. This supports the import change inweb-devtools/src/consts/chains.ts
.
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
🔭 Outside diff range comments (1)
web-devtools/src/context/Web3Provider.tsx (1)
68-69
: Update chain type casting for AppKit compatibility.The chain type casting should be updated to use AppKit types for better type safety.
-const chains = ALL_CHAINS as [Chain, ...Chain[]]; +import { type AppKitNetwork } from "@reown/appkit"; +const chains = ALL_CHAINS as [AppKitNetwork, ...AppKitNetwork[]];
🧹 Nitpick comments (1)
web-devtools/src/context/Web3Provider.tsx (1)
23-30
: Consider enhancing type safety for chain mapping.While the mapping is correct, we can improve type safety by using the network types from AppKit.
-const alchemyToViemChain: Record<number, string> = { +import { type AppKitNetwork } from "@reown/appkit"; +const alchemyToViemChain: Record<AppKitNetwork['id'], string> = { [arbitrumSepolia.id]: "arb-sepolia", [arbitrum.id]: "arb-mainnet", // ... rest of the mapping };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web-devtools/src/context/Web3Provider.tsx
(3 hunks)web-devtools/src/utils/getDisputeRequestParamsFromTxn.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
- GitHub Check: SonarCloud
🔇 Additional comments (5)
web-devtools/src/utils/getDisputeRequestParamsFromTxn.ts (2)
8-35
: LGTM! Function logic remains correct.The core functionality of extracting dispute request parameters from transactions is preserved, with proper error handling and type safety.
4-4
: LGTM! Correctly adapted to use wagmiAdapter.The changes align with the PR's objective of migrating to AppKit, properly updating the import and usage of the wagmi configuration.
Let's verify that the
wagmiAdapter
export exists in the Web3Provider:Also applies to: 10-10
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Description: Verify the wagmiAdapter export in Web3Provider ast-grep --pattern 'export const wagmiAdapter = $$$'Length of output: 377
Verified: The
wagmiAdapter
export exists and is correctly used.The shell script confirms the export in
web-devtools/src/context/Web3Provider.tsx
, matching the usage ingetDisputeRequestParamsFromTxn.ts
. This implementation aligns with the migration objectives.web-devtools/src/context/Web3Provider.tsx (3)
4-5
: LGTM! Clean migration of imports.The import changes correctly align with the migration from Web3Modal to AppKit while maintaining type safety.
Also applies to: 11-12
99-101
: LGTM! Clean provider implementation.The Web3Provider component correctly uses the wagmiAdapter configuration.
76-80
: Verify AppKit configuration across the application.The AppKit configuration looks correct, but ensure that all wallet-related components in the application are updated to use the new AppKit APIs.
Also applies to: 89-98
✅ Verification successful
🏁 Script executed:
#!/bin/bash # Search for any remaining Web3Modal usage that needs to be migrated rg -l "Web3Modal|@web3modal" --type ts --type tsxLength of output: 79
🏁 Script executed:
#!/bin/bash # Re-run search for any remaining Web3Modal usage with glob patterns to include TS and TSX files. rg -l "Web3Modal|@web3modal" --glob "*.ts" --glob "*.tsx"Length of output: 59
🏁 Script executed:
#!/bin/bash # Searching for references to WagmiAdapter to verify that the new AppKit API usage is consistent across the codebase. rg -l "WagmiAdapter" --glob "*.ts" --glob "*.tsx"Length of output: 164
AppKit configuration verification complete.
The new AppKit API usage with WagmiAdapter is consistently integrated in all relevant wallet provider components, and no residual references to Web3Modal were found.
- Confirmed usage in:
web-devtools/src/context/Web3Provider.tsx
web/src/context/Web3Provider.tsx
web/src/pages/GetPnk/WalletProvider.tsx
Code Climate has analyzed commit d594c19 and detected 0 issues on this pull request. View more on Code Climate. |
|
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 (2)
web/src/context/Web3Provider.tsx (2)
79-88
: Consider moving projectId validation before adapter setup.While the adapter configuration is correct, consider moving the projectId validation before line 84 to fail fast and prevent potential runtime errors.
+const projectId = import.meta.env.WALLETCONNECT_PROJECT_ID; +if (!projectId) { + throw new Error("WalletConnect project ID is not set in WALLETCONNECT_PROJECT_ID environment variable."); +} + const chains = ALL_CHAINS as [AppKitNetwork, ...AppKitNetwork[]]; const transports = getTransports(); -const projectId = import.meta.env.WALLETCONNECT_PROJECT_ID; -if (!projectId) { - throw new Error("WalletConnect project ID is not set in WALLETCONNECT_PROJECT_ID environment variable."); -} const wagmiAdapter = new WagmiAdapter({ networks: chains, projectId, transports, });
97-116
: Document feature flag configuration options.The commented feature flags indicate future toggle options. Consider adding a comment block explaining when and why these features might be enabled/disabled.
createAppKit({ adapters: [wagmiAdapter], networks: chains, defaultNetwork: isProduction ? arbitrum : arbitrumSepolia, projectId, allowUnsupportedChain: true, themeVariables: { "--w3m-color-mix": lightTheme.primaryPurple, "--w3m-color-mix-strength": 20, // overlay portal is at 9999 "--w3m-z-index": 10000, }, + /** + * Feature flags for AppKit configuration + * - email: Enable/disable email login + * - socials: Enable/disable social login options + * - onramp: Enable/disable fiat onramp + * - swap: Enable/disable token swap functionality + */ features: { // adding these here to toggle in futute if needed // email: false, // socials: false, // onramp:false, // swap: false }, });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (2)
web/package.json
(2 hunks)web/src/context/Web3Provider.tsx
(5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- web/package.json
⏰ Context from checks skipped due to timeout of 90000ms (16)
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet-devtools
- GitHub Check: Header rules - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-testnet-devtools
- GitHub Check: contracts-testing
- GitHub Check: SonarCloud
- GitHub Check: Analyze (javascript)
- GitHub Check: Mend Security Check
🔇 Additional comments (4)
web/src/context/Web3Provider.tsx (4)
3-15
: LGTM! Import statements align with AppKit migration.The updated imports correctly reflect the migration from Web3Modal to AppKit, including the necessary chain definitions and adapter components.
60-63
: Type safety improvement with AppKitNetwork.The transport configuration has been properly updated to use the more specific
AppKitNetwork
type instead of the genericChain
type, improving type safety.
117-119
: LGTM! Provider implementation correctly uses WagmiAdapter.The Web3Provider component correctly uses the wagmiAdapter.wagmiConfig with WagmiProvider.
12-13
: Verify AppKit package versions.Let's ensure we're using the latest stable versions of AppKit packages.
✅ Verification successful
🌐 Web query:
What is the latest version of @reown/appkit and @reown/appkit-adapter-wagmi?
💡 Result:
The latest version of **@reown/appkit** is **v4.2.3** or higher based on documentation updated on January 29, 2025[6][7]. For **@reown/appkit-adapter-wagmi**, the most recent version listed in official sources is **v1.6.5**, published to NPM on January 22, 2025[5][9]. Key details: - The AppKit core library received updates through February 2025 including WalletConnect package upgrades and new wallet button features[10] - The Wagmi adapter specifically shows active maintenance with its latest NPM release being v1.6.5[5] - Documentation recommends using `@tanstack/react-query` v5+ and `wagmi` v2+ when working with these versions[1][2] For production use, always verify compatibility between AppKit core and adapter versions through Reown's official migration guides[1][7]. Citations: - 1: https://docs.reown.com/appkit/upgrade/to-reown-appkit-web - 2: https://docs.reown.com/appkit/javascript/core/installation - 3: https://docs.reown.com/appkit/upgrade/to-reown-appkit-ethers-web - 4: https://docs.reown.com/appkit/upgrade/to-reown-appkit-solana-web - 5: https://www.npmjs.com/package/@reown/appkit-adapter-wagmi - 6: https://docs.reown.com/appkit/react/core/options - 7: https://docs.reown.com/appkit/upgrade/from-w3m-to-reown - 8: https://docs.reown.com/appkit/next/core/installation - 9: https://socket.dev/npm/package/@reown/appkit-adapter-wagmi/files - 10: https://github.com/reown-com/appkit/releases
Package Versions OK - Verify in package.json
- The latest version for @reown/appkit is v4.2.3 or higher.
- The latest version for @reown/appkit-adapter-wagmi is v1.6.5.
Please ensure that your package.json reflects these versions (or later) to maintain compatibility with the migration.
@@ -49,7 +49,8 @@ | |||
"typescript": "^5.6.3", | |||
"vite": "^5.4.11", | |||
"vite-plugin-dts": "^4.3.0", | |||
"vite-plugin-node-polyfills": "^0.22.0" | |||
"vite-plugin-node-polyfills": "^0.22.0", | |||
"wagmi": "^2.14.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.
wagmi doesn't need to be a devDep, it's already a dep
PR-Codex overview
This PR focuses on updating dependencies related to
wagmi
, integrating@reown/appkit
, and making various adjustments in the codebase to accommodate these changes, enhancing wallet connection functionalities and overall compatibility.Detailed summary
wagmi
version to^2.14.0
across multiple files.@reown/appkit
and@reown/appkit-adapter-wagmi
dependencies.AtlasProvider
to includewagmiConfig
.useWeb3Modal
withuseAppKit
in wallet connection components.AppKitNetwork
.Web3Provider
to utilize the newWagmiAdapter
.Summary by CodeRabbit
Dependencies
@lifi/wallet-management
and@lifi/widget
to newer versions.@bigmi/react
,@reown/appkit
,@reown/appkit-adapter-wagmi
,@solana/wallet-adapter-react
.@web3modal/wagmi
.wagmi
to version 2.14.10.Wallet Management
Configuration
AppKitNetwork
.