Skip to content

CP-13334: Refactor Ledger device info storage with Zustand store#3572

Closed
Copilot wants to merge 1 commit intocp-13334from
copilot/sub-pr-3571
Closed

CP-13334: Refactor Ledger device info storage with Zustand store#3572
Copilot wants to merge 1 commit intocp-13334from
copilot/sub-pr-3571

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Description

Ticket: CP-13334

Replaces BiometricsSDK-based Ledger device info retrieval with a persisted Zustand store for better performance and cleaner architecture. This enables reusing AppConnectionScreen for both onboarding and adding accounts.

Key Changes

  • New Zustand store (packages/core-mobile/app/new/features/ledger/store.ts)

    • Persists Ledger device info (device ID, name, derivation path) mapped by wallet ID
    • Replaces async BiometricsSDK lookups with synchronous store access
    • Auto-syncs on wallet creation, update, and deletion
  • Removed hooks

    • useObserveLedgerState - Eliminated app polling from WalletCard (no longer gates "Add Account")
    • useLedgerDeviceInfo - Replaced with useLedgerWalletMap().getLedgerInfoByWalletId()
  • Unified AppConnectionScreen

    • Now handles both onboarding (AppConnectionOnboardingScreen) and adding accounts (AppConnectionAddAccountScreen)
    • Both screens pass device info and completion handlers to shared base screen
  • Simplified LedgerSetupContext

    • Focuses only on setup flow state (device connection, derivation path, wallet creation status)
    • Device info now managed separately in store

Migration

Store automatically persists to MMKV. Existing wallets will populate the store on next device connection.

Screenshots/Videos

Include relevant screenshots or screen recordings of iOS and Android.

Testing

Dev Testing (if applicable)

  1. Onboarding flow
    • Create new Ledger wallet → verify device info persists across app restarts
  2. Add account flow
    • Add account to existing Ledger wallet → verify reuses stored device info
    • Test with device disconnected → verify shows loading state
  3. Wallet deletion
    • Delete Ledger wallet → verify store entry removed
  4. Transaction signing
    • Sign transaction → verify retrieves correct device from store

QA Testing (if applicable)

  • Verify Ledger onboarding and account addition flows work identically
  • Confirm device reconnection prompts appear when device info missing
  • Test wallet deletion clears associated device data

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have included screenshots / videos of android and ios
  • I have added testing steps
  • I have added/updated necessary unit tests
  • I have updated the documentation

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Author

Copilot AI commented Feb 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • chromedriver.storage.googleapis.com
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node install-npm.js (dns block)
  • https://api.github.com/repos/yarnpkg/yarn/releases
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /tmp/xfs-e8f06284/.yarn/releases/yarn-1.22.19.cjs set version classic --only-if-needed (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Reuse app connection screen for add ledger account CP-13334: Refactor Ledger device info storage with Zustand store Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants