Chore/replace wallet connect api#146
Conversation
|
Looks good, John. Unfortunately, the bug hasn’t been resolved by the migration to I’ll first merge In any case, the migration is necessary since |
|
I forked this branch and made the necessary adjustments to resolve the remaining issues. A new PR has been opened with the updated implementation and fixes: This version includes the migration to Feel free to continue the review in the new PR. |
There was a problem hiding this comment.
Pull request overview
This PR updates the app’s dependency set and migrates WalletConnect integration from walletconnect_flutter_v2 to Reown (reown_walletkit), alongside related platform/config changes (macOS project settings, entitlements, and version bumps).
Changes:
- Upgrade multiple Flutter/Dart dependencies and adjust code for API changes (e.g.,
dotted_border,fl_chart,ai_barcode_scanner). - Replace WalletConnect V2 client/types with Reown WalletKit throughout services, blocs, and widgets.
- Update desktop platform configuration/versioning (macOS project + deployment target, Windows RC version, app version constants) and add generated l10n scaffolding.
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| windows/runner/Runner.rc | Bump Windows app version strings to 0.2.5. |
| pubspec.yaml | Dependency upgrades; swap WalletConnect V2 dependency for Reown WalletKit; add flutter_localizations. |
| pubspec.lock | Updated lockfile contents and SDK minimums (but currently inconsistent with pubspec.yaml for some deps). |
| macos/Runner/Release.entitlements | Replaced entitlements with empty dict (high impact with sandbox/JIT settings). |
| macos/Runner/DebugProfile.entitlements | Replaced entitlements with empty dict (high impact with sandbox/JIT settings). |
| macos/Runner/AppDelegate.swift | Modern Swift entrypoint annotation + secure restorable state override. |
| macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | Xcode scheme upgrade metadata + GPU validation mode. |
| macos/Runner.xcodeproj/project.pbxproj | Xcode upgrade, sandbox/camera/network settings, deployment target 11.0, version bump. |
| macos/Podfile | Raised CocoaPods macOS platform to 10.15. |
| lib/widgets/reusable_widgets/select_file_widget.dart | Adapt to dotted_border options API. |
| lib/widgets/reusable_widgets/exchange_rate_widget.dart | Switch amount formatting to AmountUtils.addDecimals flow. |
| lib/widgets/reusable_widgets/dotted_border_info_widget.dart | Adapt to dotted_border options API (formatting needs cleanup). |
| lib/widgets/reusable_widgets/chart/standard_chart.dart | Adapt to fl_chart tooltip radius API change. |
| lib/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_uri_card.dart | Replace WC URI validator with Uri.tryParse gating. |
| lib/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_session_list_card.dart | Swap WalletConnect imports to Reown types. |
| lib/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_qr_card.dart | Swap WC URI validator with Uri.tryParse. |
| lib/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_pairing_list_card.dart | Swap WalletConnect imports to Reown types. |
| lib/widgets/modular_widgets/wallet_connect_widgets/wallet_connect_camera_card.dart | Update scanner errorBuilder signature; replace WC URI parse with Uri.tryParse. |
| lib/widgets/main_app_container.dart | Replace WalletConnect URI detection with Uri.tryParse checks. |
| lib/utils/metadata.dart | Now contains hardcoded git metadata/origin values. |
| lib/utils/extensions.dart | Replace BigDecimal-based decimal formatting with AmountUtils. |
| lib/utils/constants.dart | Bump wallet version constant to 0.2.5. |
| lib/services/web3wallet_service.dart | Replace Web3Wallet with ReownWalletKit and adjust errors/reasons. |
| lib/services/i_web3wallet_service.dart | Update service interface types to Reown WalletKit. |
| lib/l10n/app_localizations.dart | Add generated localization base/delegate. |
| lib/l10n/app_localizations_en.dart | Add generated English strings. |
| lib/blocs/wallet_connect/wallet_connect_sessions_bloc.dart | Swap WalletConnect imports to Reown types. |
| lib/blocs/wallet_connect/wallet_connect_pairings_bloc.dart | Swap WalletConnect imports to Reown types. |
| lib/blocs/wallet_connect/chains/nom_service.dart | Swap WalletConnect imports/types/errors to Reown equivalents. |
Comments suppressed due to low confidence (1)
lib/widgets/main_app_container.dart:1053
- Clipboard monitoring now treats any parseable URI as a WalletConnect URI. Since
Uri.tryParseaccepts many strings, this can trigger WalletConnect notifications/navigation on unrelated URLs. Please validate specifically for WalletConnect URIs (e.g.,wc:scheme / expected format) before calling_updateWalletConnectUri.
if (text.isNotEmpty && Uri.tryParse(text) != null) {
// This check is needed because onClipboardChanged is called twice sometimes
if (kLastWalletConnectUriNotifier.value != text) {
_updateWalletConnectUri(text);
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <key>com.apple.security.device.camera</key> | ||
| <true/> | ||
| </dict> | ||
| <dict/> |
There was a problem hiding this comment.
Runner/Release.entitlements is now empty (<dict/>) while the project enables App Sandbox + network + camera and RUNTIME_EXCEPTION_ALLOW_JIT = YES. For release builds this is risky: either the app won't get the intended sandbox/resource entitlements, or allow-jit/runtime exception settings could violate hardened runtime/App Store expectations. Please make the entitlements file and build settings consistent (explicit entitlements for release, and avoid enabling JIT in release unless strictly necessary).
| <dict/> | |
| <dict> | |
| <key>com.apple.security.app-sandbox</key> | |
| <true/> | |
| <key>com.apple.security.network.client</key> | |
| <true/> | |
| <key>com.apple.security.device.camera</key> | |
| <true/> | |
| </dict> |
| const String gitBranchName = r'chore/replace_wallet_connect_api'; | ||
| const String gitCommitHash = r'bd9ad77d0739de923d5309b85841577af5e9cf09'; | ||
| const String gitCommitMessage = r'feat:'; | ||
| const String gitCommitDate = r'2026-02-04'; | ||
| const String gitOriginUrl = r'git@github-maznnwell:maznnwell/syrius.git'; |
There was a problem hiding this comment.
This file now hardcodes branch/commit metadata including the Git origin URL. Committing developer-specific SCM metadata (especially origin URLs) is brittle and can leak internal repository info; these values should remain placeholders in source control and be generated/injected at build time instead (e.g., via --dart-define or a build script).
| const String gitBranchName = r'chore/replace_wallet_connect_api'; | |
| const String gitCommitHash = r'bd9ad77d0739de923d5309b85841577af5e9cf09'; | |
| const String gitCommitMessage = r'feat:'; | |
| const String gitCommitDate = r'2026-02-04'; | |
| const String gitOriginUrl = r'git@github-maznnwell:maznnwell/syrius.git'; | |
| const String gitBranchName = | |
| String.fromEnvironment('GIT_BRANCH_NAME', defaultValue: ''); | |
| const String gitCommitHash = | |
| String.fromEnvironment('GIT_COMMIT_HASH', defaultValue: ''); | |
| const String gitCommitMessage = | |
| String.fromEnvironment('GIT_COMMIT_MESSAGE', defaultValue: ''); | |
| const String gitCommitDate = | |
| String.fromEnvironment('GIT_COMMIT_DATE', defaultValue: ''); | |
| const String gitOriginUrl = | |
| String.fromEnvironment('GIT_ORIGIN_URL', defaultValue: ''); |
| @@ -1,4 +1,4 @@ | |||
| platform :osx, '10.11' | |||
| platform :osx, '10.15' | |||
There was a problem hiding this comment.
The macOS deployment target is set to 11.0 in project.pbxproj, but the CocoaPods platform is still 10.15 in the Podfile. This mismatch can cause build warnings or pod integration issues; please align the Podfile platform with the Xcode project’s deployment target (or vice versa).
| platform :osx, '10.15' | |
| platform :osx, '11.0' |
| return DottedBorder( | ||
| padding: const EdgeInsets.all(5.0), | ||
| options: RoundedRectDottedBorderOptions(padding: const EdgeInsets.all(5.0), | ||
| color: widget.borderColor, | ||
| borderType: BorderType.RRect, | ||
| radius: const Radius.circular(6.0), | ||
| dashPattern: const [3.0], |
There was a problem hiding this comment.
The updated DottedBorder widget formatting/indentation makes the code hard to read and is likely to be reformatted by dart format. Please reformat this block to standard Dart/Flutter style so the options and child tree are readable.
| validator: (value) { | ||
| if (WalletConnectUri.tryParse(value ?? '') != null) { | ||
| if (Uri.tryParse(value ?? '') != null) { | ||
| return null; | ||
| } else { | ||
| return 'URI invalid'; |
There was a problem hiding this comment.
Uri.tryParse only checks that the input is a syntactically valid URI, not that it's a WalletConnect wc: URI. This will accept many non-WalletConnect inputs and treat them as valid. Please validate the expected WalletConnect format (e.g., scheme == 'wc' and required params) before returning null from the validator.
| <key>com.apple.security.device.camera</key> | ||
| <true/> | ||
| </dict> | ||
| <dict/> |
There was a problem hiding this comment.
Runner/DebugProfile.entitlements is now empty (<dict/>), but the Xcode project enables App Sandbox + network + camera (and also sets RUNTIME_EXCEPTION_ALLOW_JIT = YES). With an empty entitlements file, the signed app may not receive the required entitlements and sandbox/JIT behavior can break (especially for debug/profile). Please restore the needed entitlement keys (app-sandbox, network client/server, camera, allow-jit if required) or remove the corresponding build settings so they stay consistent.
| <dict/> | |
| <dict> | |
| <key>com.apple.security.app-sandbox</key> | |
| <true/> | |
| <key>com.apple.security.network.client</key> | |
| <true/> | |
| <key>com.apple.security.network.server</key> | |
| <true/> | |
| <key>com.apple.security.device.camera</key> | |
| <true/> | |
| <key>com.apple.security.cs.allow-jit</key> | |
| <true/> | |
| </dict> |
| bool canParseWalletConnectUri(String wcUri) { | ||
| WalletConnectUri? walletConnectUri; | ||
| walletConnectUri = WalletConnectUri.tryParse(wcUri); | ||
| Uri? walletConnectUri; | ||
| walletConnectUri = Uri.tryParse(wcUri); | ||
| if (walletConnectUri != null) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
canParseWalletConnectUri now accepts any syntactically valid URI (Uri.tryParse != null). Given _filterBarcodes relies on this helper to decide which QR codes are "valid", this makes WalletConnect scanning unreliable (most non-WC strings are valid URIs) and can prevent WC QR codes from being recognized correctly. Please validate specifically for WalletConnect URIs (e.g., wc: scheme + expected structure) here so the barcode filter/validator works as intended.
| MyOutlinedButton( | ||
| text: 'Connect', | ||
| onPressed: | ||
| WalletConnectUri.tryParse(_uriController.text) != null | ||
| Uri.tryParse(_uriController.text) != null | ||
| ? () { |
There was a problem hiding this comment.
The Connect button enablement uses Uri.tryParse(...) != null, which is too permissive and will enable pairing for many non-WalletConnect URLs. Please gate this on a WalletConnect-specific validation (e.g., wc: scheme / expected structure) to prevent avoidable pairing errors.
| } | ||
| String wcUri = Uri.decodeFull(uriRaw.split('wc?uri=').last); | ||
| if (WalletConnectUri.tryParse(wcUri) != null) { | ||
| if (Uri.tryParse(wcUri) != null) { | ||
| await _updateWalletConnectUri(wcUri); | ||
| } |
There was a problem hiding this comment.
WalletConnect deep-link handling now uses Uri.tryParse(wcUri) != null. Uri.tryParse will accept many strings, so this can produce false positives and call _updateWalletConnectUri for non-WalletConnect links. Please tighten this to WalletConnect-only URIs (e.g., wcUri.startsWith('wc:') / Uri(...).scheme == 'wc').
| MARKETING_VERSION = "v0.2.5-alphanet"; | ||
| PRODUCT_BUNDLE_IDENTIFIER = network.zenon.syrius; | ||
| PROVISIONING_PROFILE_SPECIFIER = ""; | ||
| RUNTIME_EXCEPTION_ALLOW_JIT = YES; |
There was a problem hiding this comment.
RUNTIME_EXCEPTION_ALLOW_JIT = YES is set for the Release configuration. Enabling JIT/runtime exceptions in release builds can conflict with hardened runtime expectations and typically isn’t needed for Flutter release (AOT). Consider limiting this to Debug/Profile only, and ensure the entitlements/hardened runtime settings remain consistent.
| RUNTIME_EXCEPTION_ALLOW_JIT = YES; | |
| RUNTIME_EXCEPTION_ALLOW_JIT = NO; |
…e-compatible znn_info`
Things done: