Skip to content

Conversation

@ovitrif
Copy link

@ovitrif ovitrif commented Jan 16, 2026

Summary

  • Added claimable_on_close_sats field to ChannelDetails struct
  • Field is computed from the channel monitor's ClaimableOnChannelClose balance
  • Returns None if no monitor exists yet (pre-funding)
  • Replaces the workaround of approximating claimable amount using outbound_capacity + counterparty_reserve

Changes

  • src/types.rs: Added field and from_ldk_with_balance() conversion method
  • src/lib.rs: Updated list_channels() to compute balances from monitors
  • bindings/ldk_node.udl: Added field to bindings
  • Bumped version to v0.7.0-rc.7
  • Regenerated all bindings (Swift, Kotlin JVM, Kotlin Android, Python)

Test plan

  • cargo build - Compiles successfully
  • cargo clippy - No warnings related to changes
  • Verify xcframework checksum matches Package.swift
  • Manual test in Android/iOS: After opening a channel, verify claimable_on_close_sats matches list_balances() ClaimableOnChannelClose.amount_satoshis

Usage

bitkit-android can replace:

val amountOnClose = outboundCapacitySat + counterpartyReserve

With:

val amountOnClose = channelDetails.claimableOnCloseSats ?: 0u

Release

ovitrif and others added 3 commits January 16, 2026 16:54
Add claimable_on_close_sats field to ChannelDetails struct, computed from
the channel monitor's ClaimableOnChannelClose balance. This replaces the
workaround of approximating claimable amount using outbound_capacity + reserve.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@ovitrif ovitrif self-assigned this Jan 16, 2026
@ovitrif ovitrif added the enhancement New feature or request label Jan 16, 2026
- Move imports to top of file (LdkBalance, HashMap, ChannelId)
- Replace unwrap() with if let Some() for safer access
- Change "force-closed" to "closed" in doc comment
- Simplify from_ldk_with_balance to avoid code duplication
- Add import rule to AGENTS.md

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants