feat: Ledger account info sheet + rekeyed-account import [PERA-4235]#526
Merged
Conversation
…defer formatting to display)
… Extract workaround
…nfo-sheet integration assertions
Adds end-to-end integration coverage for the Ledger rekeyed-account import flow: indexer scan surfaces a rekeyed account, user selects it, handleContinue auto-includes the auth Ledger account, LedgerVerifyScreen verifies only the hardware account, import persists a WatchAccount with rekeyAddress and a HardwareWalletAccount, and deriveAccountLogicalType returns RekeyedAuth. Also exposes a real (empty) HardwareWalletRegistry in the platform-driver unit mock so integration tests can register a fake Ledger BLE transport provider to drive on-device verification.
…+ AccountAssetItemView Replace bespoke LedgerAccountInfoRows with canonical design-system components: - Account row now uses AccountDisplay (showChevron=false showAccountType) + CurrencyDisplay/PreferredCurrencyDisplay mirroring AccountWithBalance layout - Asset rows now use AccountAssetItemView for correct icon size and chip rendering - Rekey-address rows use AccountDisplay with synth WalletAccount objects - useLedgerAccountInfoContent item shapes updated to carry WalletAccount synth accounts, AssetWithAccountBalance for assets, and algoUsdPrice from preview - LedgerAccountInfoRows.tsx deleted; unit test spec and select-screen spec mock updated
…counts; import cleanup
- accounts: give useRekeyedAddressesQuery an explicit return type instead of leaking UseQueryResult; update consumer + specs - ledger: dedupe preview prefetch by network+address and cover scanned rekeyed addresses (no full-list re-prefetch on Find another) - ledger: drop dead `accounts` from useLedgerSelectAccountsScreen result; assert via the canonical selectableAccounts surface - ledger: compute real algoValue for info-sheet asset rows - accounts: replace anonymous authAddr cast in mappers with a named, documented type; remove the test `as any` it enabled - accounts: correct the useLedgerRekeyedScan caching JSDoc - test: rename 4 hook specs *.test.ts -> *.spec.ts; give the imported-account-row integration test a real assertion
QA reports the Ledger Connection sheet's Cancel button can fail to
close the sheet in some cases on the accounts-found flow. The wiring
itself was correct (resolve('cancel') is the close function), but the
inline arrow created a fresh onPress reference each render. Extract a
named, memoized handleClose so onPress is a stable bound function on
PWButton -> PWTouchableOpacity -> TouchableOpacity.
- i18n: replace hardcoded `Ledger #N` default title with
ledger.account_info.default_title and {{index}} interpolation
- accounts: thread `network` through fetchRekeyedAddresses so the
fetch is network-scoped by construction, matching the query keys
and the sibling fetchOnChainAccountInformation(algokit, ...) call
- ledger: stabilize useLedgerRekeyedScan memo with a primitive
resultsSig dep (useQueries returns a fresh array every render)
- accounts: 30s staleTime on the rekeyed-addresses queries so the
prefetch warm-up actually pays off across a Ledger import session
- ledger: clear prefetchedRef on network switch (each entry is
bound to a specific network, the prefix implied that intent)
- ledger: document the watch/hardware `id` asymmetry in handleAdd
to match the existing rekeyed-watch precedent
yasin-ce
approved these changes
May 20, 2026
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.
Description
Brings the native Ledger-import "account info" and "rekeyed account" capabilities to the RN app. Two cohesive, separately-specced sub-projects on this branch:
A — Ledger account info sheet
[checkbox][avatar][text][ⓘ], shown for already-imported accounts too).packages/accounts):useLedgerAccountPreviewcomposes existing on-chain/assets/prices/rekey queries;useRekeyedAddressesQuery; best-effortprefetchLedgerAccountPreview(hybrid prefetch on selection-screen mount). UI uses the existing request-based bottom-sheet system; money rendered via the canonicalCurrencyDisplay(Decimal in, formatted out).B — Rekeyed-account discovery & import
LedgerVerifydevice-verifies only the unique auth Ledger accounts — rekeyed addresses are never device-verified.HardwareWalletAccount, rekeyed →WatchAccount { rekeyAddress: <auth Ledger address> }, soderiveAccountLogicalTyperesolvesRekeyedAuthand the existing signing pipeline routes signing to the Ledger. No keystore/signing changes; reuses the established rekey/watch model.A typed
LedgerSelectableAccountdiscriminated union is threaded select → verify → import. One additive, backward-compatible change to A's info sheet (optional title override, used to show "Rekeyed account" for rekeyed rows). New i18n keys added.Related Issues
Checklist
Additional Notes
rekeyAddress); rekeyed addresses are never sent to on-device verification; no KMS/keystore/signing code changed; addresses validated viaisValidAlgorandAddressbefore persistence; auth auto-include is deduped.packages/accounts/src/hooks/useLedgerVerifyScreenimport builder anduseLedgerSelectAccountsScreenhandleContinue(auto-include) are the security-sensitive seams.