Skip to content

Conversation

@ben-kaufman
Copy link
Contributor

Refactors channel liquidity calculations from native app to bitkit-core and improves the spending flow limits and UX.

recording1.mp4

@jvsena42 jvsena42 requested a review from Copilot December 5, 2025 09:53
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 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 calculateChannelLiquidityOptions and getDefaultLspBalance functions
  • 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

@ben-kaufman ben-kaufman requested a review from pwltr December 5, 2025 14:30
Copy link
Contributor

@pwltr pwltr left a 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

@pwltr pwltr merged commit d65a5b5 into master Dec 5, 2025
13 of 18 checks passed
@pwltr pwltr deleted the refactor/move-lsp-liquidity-calcs branch December 5, 2025 23:02
BitcoinErrorLog pushed a commit to BitcoinErrorLog/bitkit-ios that referenced this pull request Dec 15, 2025
* refactor: move LSP balance calculations to BitkitCore and improve transfer to spending flow

* Fix comments
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.

3 participants