fix(#62,#69): consolidate walletStore with walletServiceManager and add network detection UI#499
Open
sheyman546 wants to merge 1 commit into
Conversation
…etServiceManager and add network detection UI - walletStore now derives all connection state (address, chainId, network, isConnected) from walletServiceManager via a listener subscription, making walletServiceManager the single source of truth (Smartdevs17#62) - Added setPreferredNetwork, detectNetworkMismatch, and networkMismatch state to walletStore for EVM network mismatch detection (Smartdevs17#69) - WalletConnectScreen: added network mismatch warning banner and a bottom-sheet network picker modal (FlatList of ALL_NETWORKS) so users can switch their preferred network without leaving the screen (Smartdevs17#69) - Updated integration.test.ts walletStore suite to match the new consolidated API: removed stale wallet/\@subtrackr_wallet references, added mock for walletService and networkService, added tests for syncWalletConnection, listener-driven sync, and network mismatch detection Closes Smartdevs17#62 Closes Smartdevs17#69
|
@sheyman546 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
1 similar comment
Owner
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes two related wallet issues in a single cohesive change.
#62 — Consolidate walletStore with walletService
walletStorenow derives all connection state (address,chainId,network,isConnected) fromwalletServiceManagervia a listener subscriptionwalletServiceManageris the single source of truth — no duplicate state, no stalewalletpropertysyncWalletConnectiondelegates towalletServiceManager.setConnection(), which triggers the listener and updates the store automatically#69 — Network detection and switching
preferredNetwork,networkMismatch,setPreferredNetwork, anddetectNetworkMismatchtowalletStorewalletServiceManagerlistener) and on explicitsetPreferredNetworkcallschainId)Tests
walletStoreintegration test suite to match the new consolidated APIwalletServiceandnetworkServiceso tests run without native/ethers dependenciessyncWalletConnection, listener-driven sync,detectNetworkMismatch(mismatch, match, Stellar no-op)Files changed
src/store/walletStore.ts— consolidated store with network detectionsrc/screens/WalletConnectScreen.tsx— mismatch banner + network picker modalsrc/store/__tests__/integration.test.ts— updated walletStore test suiteCloses #62
Closes #69