-
Notifications
You must be signed in to change notification settings - Fork 1
Sweep funds from unsupported address types #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
BiometricAuthutility - 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 |
|
LGTM, just have this question Please, close the solved comments Will approve it after testing |
|
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 |
|
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 🤷♂️ |
|
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.
After stopping and reopening it is back to normal. |
|
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. |
|
I think I see the issue, but since it's unrelated to the changes here I'll make the fix in a separate PR. |
There was a problem hiding this 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
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