Skip to content

Conversation

@ben-kaufman
Copy link
Contributor

This PR adds an advanced setting option to find and sweep funds in unsupported address types (legacy, nested segwit, and taproot). On migration / restore from RN app it will run automatically in the background and if funds detected will show the user a sheet suggesting to sweep the funds.

The PR also updates the migration loading screen UI to match the Figma design.

Simulator.Screen.Recording.-.iPhone.16.-.2026-01-07.at.20.29.15.mp4

@jvsena42 jvsena42 requested a review from Copilot January 8, 2026 14:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements functionality to sweep funds from unsupported Bitcoin address types (Legacy, Nested SegWit, and Taproot) into the wallet's native SegWit addresses. After migration or restoration from the RN app, the feature automatically checks for funds in these address types and prompts the user to sweep them if detected. Additionally, the PR refactors biometric authentication into a reusable utility and updates the migration loading screen UI to match the Figma design.

Key changes:

  • New sweep funds feature with multi-step UI flow (check → confirm → broadcast)
  • Refactored biometric authentication from duplicate code into shared BiometricAuth utility
  • Updated migration loading screen with improved visual design and layout

Reviewed changes

Copilot reviewed 20 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
SendConfirmationView.swift Refactored to use centralized BiometricAuth utility, removing duplicate authentication code
LnurlPayConfirm.swift Refactored to use centralized BiometricAuth utility, removing duplicate authentication code
SweepSuccessView.swift New view displaying sweep completion with confetti animation and transaction details
SweepSettingsView.swift New view for checking and displaying sweepable balances from unsupported address types
SweepPromptSheet.swift New sheet prompting users to sweep detected funds after migration
SweepFeeRateView.swift New view for selecting transaction fee rate for sweep operations
SweepFeeCustomView.swift New view for entering custom fee rates for sweep transactions
SweepConfirmView.swift New view for confirming and broadcasting sweep transactions with PIN/biometric auth
AdvancedSettingsView.swift Added navigation link to sweep funds feature in advanced settings
SweepViewModel.swift New view model managing sweep state, balance checking, transaction preparation and broadcasting
SheetViewModel.swift Added sweep prompt sheet configuration support
NavigationViewModel.swift Added sweep-related navigation routes
AppViewModel.swift Removed redundant migration success toast message
BiometricAuth.swift New centralized utility for biometric authentication with Face ID/Touch ID
MigrationsService.swift Changed isRestoringFromRNRemoteBackup to @published for reactive updates
Localizable.strings Added localization strings for sweep feature and migration screen
MainNavView.swift Added sweep view destinations and injected SweepViewModel into navigation
magnifying-glass-illustration.imageset Added new illustration asset for sweep loading state
AppScene.swift Integrated sweep funds check after migration/restore and updated migration loading UI
Package.resolved Updated bitkit-core dependency to support sweep functionality

@jvsena42
Copy link
Member

jvsena42 commented Jan 9, 2026

LGTM, just have this question

Please, close the solved comments

Will approve it after testing

@piotr-iohk
Copy link
Collaborator

It looks like after sweep the balance is not updated until one manually swipes to refresh (it can be observed on the main recording in PR summary). Also after migration with sweep and then sending funds to the migrated wallet I cannot see the "Received" notification pop-up and again the balance is updated on swipe to refresh.

Screen.Recording.2026-01-12.at.16.31.15-1.mov

@ben-kaufman
Copy link
Contributor Author

It seems to be happening sometimes and then work after stopping and reopening the app. I don't think it's related to this PR though but a separate issue to check.

@piotr-iohk
Copy link
Collaborator

It seems to be happening sometimes and then work after stopping and reopening the app. I don't think it's related to this PR though but a separate issue to check.

Could be, although in my case, happens every time when doing migration with sweep 🤷‍♂️

@ben-kaufman
Copy link
Contributor Author

Does it happen consistently also on the restore case or only in the migration case?
Also does it still happen if you stop and reopen the app after migration then try the sweep from settings?

@piotr-iohk
Copy link
Collaborator

Does it happen consistently also on the restore case or only in the migration case?

It seems that only on migration case. And, indeed, it does not seem to be related to sweep. Observed on migration without sweep too now.

Also does it still happen if you stop and reopen the app after migration then try the sweep from settings?

After stopping and reopening it is back to normal.

@ben-kaufman
Copy link
Contributor Author

ben-kaufman commented Jan 12, 2026

Ok so likely related to migration, we can have a new issue for that and work on it separately of this PR. I'll work on it now, but if there's nothing else we can merge this PR.

@ben-kaufman
Copy link
Contributor Author

I think I see the issue, but since it's unrelated to the changes here I'll make the fix in a separate PR.

Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested

  • Taproot ✅
  • P2SH ✅
  • Balance updated after mining one block ✅
  • After swiping -> advanced -> sweep fund -> no funds found ✅
Simulator.Screen.Recording.-.iPhone.16.-.2026-01-12.at.13.59.00.mp4

No tested:

  • Restore
  • Custom fee

@jvsena42 jvsena42 merged commit 3bf72ec into master Jan 12, 2026
9 checks passed
@jvsena42 jvsena42 deleted the feat/sweep-funds branch January 12, 2026 17:03
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.

4 participants