-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: move LSP balance calculations to BitkitCore #265
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
…nsfer to spending flow
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 refactors channel liquidity calculations by migrating core business logic from Swift to bitkit-core, consolidating balance calculations and improving UX with better loading states and form validation.
Key Changes:
- Migrated LSP balance calculations to bitkit-core's
calculateChannelLiquidityOptionsandgetDefaultLspBalancefunctions - Improved SpendingAmount view with proper loading indicators and disabled state validation
- Enhanced SpendingAdvancedView with task cancellation and proper async handling
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Bitkit/Views/Transfer/SpendingAmount.swift |
Refactored max transfer amount calculation to use new bitkit-core functions, added loading states and validation |
Bitkit/Views/Transfer/SpendingAdvancedView.swift |
Added loading state, improved async task cancellation, and removed unused wallet dependency |
Bitkit/ViewModels/TransferViewModel.swift |
Replaced manual calculation logic with bitkit-core's calculateChannelLiquidityOptions function |
Bitkit/ViewModels/BlocktankViewModel.swift |
Migrated LSP balance calculation to use bitkit-core's getDefaultLspBalance function |
Bitkit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved |
Updated bitkit-core package revision |
pwltr
left a comment
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.
LGTM, integration tests failing because of backend issue
* refactor: move LSP balance calculations to BitkitCore and improve transfer to spending flow * Fix comments
Refactors channel liquidity calculations from native app to bitkit-core and improves the spending flow limits and UX.
recording1.mp4