Skip to content

Commit 36af1f7

Browse files
ovitrifclaude
andcommitted
feat: add claimable_on_close_sats to ChannelDetails
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 <noreply@anthropic.com>
1 parent 9323921 commit 36af1f7

20 files changed

Lines changed: 213 additions & 74 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.7.0-rc.7 (Synonym Fork)
2+
3+
## Synonym Fork Additions
4+
- Added `claimable_on_close_sats` field to `ChannelDetails` struct. This field contains the
5+
amount (in satoshis) that would be claimable if the channel were force-closed now, computed
6+
from the channel monitor's `ClaimableOnChannelClose` balance. Returns `None` if no monitor
7+
exists yet (pre-funding). This replaces the workaround of approximating the claimable amount
8+
using `outbound_capacity_msat + counterparty_reserve`.
9+
110
# 0.7.0-rc.6 (Synonym Fork)
211

312
## Synonym Fork Additions

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ldk-node"
3-
version = "0.7.0-rc.6"
3+
version = "0.7.0-rc.7"
44
authors = ["Elias Rohrer <dev@tnull.de>"]
55
homepage = "https://lightningdevkit.org/"
66
license = "MIT OR Apache-2.0"

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let tag = "v0.7.0-rc.6"
7-
let checksum = "4ea23aedbf918a1c93539168f34e626cbe867c1d5e827b7b7fd0e84225970b91"
6+
let tag = "v0.7.0-rc.7"
7+
let checksum = "102ad31d567fdb176ba92ae4453ca67772383b95f4fa250951f1bdf4228da45e"
88
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
99

1010
let package = Package(

bindings/kotlin/ldk-node-android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
22
android.useAndroidX=true
33
android.enableJetifier=true
44
kotlin.code.style=official
5-
libraryVersion=0.7.0-rc.6
5+
libraryVersion=0.7.0-rc.7
Binary file not shown.
Binary file not shown.
Binary file not shown.

bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8873,6 +8873,7 @@ object FfiConverterTypeChannelDetails: FfiConverterRustBuffer<ChannelDetails> {
88738873
FfiConverterULong.read(buf),
88748874
FfiConverterOptionalULong.read(buf),
88758875
FfiConverterTypeChannelConfig.read(buf),
8876+
FfiConverterOptionalULong.read(buf),
88768877
)
88778878
}
88788879

@@ -8907,7 +8908,8 @@ object FfiConverterTypeChannelDetails: FfiConverterRustBuffer<ChannelDetails> {
89078908
FfiConverterOptionalUShort.allocationSize(value.`forceCloseSpendDelay`) +
89088909
FfiConverterULong.allocationSize(value.`inboundHtlcMinimumMsat`) +
89098910
FfiConverterOptionalULong.allocationSize(value.`inboundHtlcMaximumMsat`) +
8910-
FfiConverterTypeChannelConfig.allocationSize(value.`config`)
8911+
FfiConverterTypeChannelConfig.allocationSize(value.`config`) +
8912+
FfiConverterOptionalULong.allocationSize(value.`claimableOnCloseSats`)
89118913
)
89128914

89138915
override fun write(value: ChannelDetails, buf: ByteBuffer) {
@@ -8942,6 +8944,7 @@ object FfiConverterTypeChannelDetails: FfiConverterRustBuffer<ChannelDetails> {
89428944
FfiConverterULong.write(value.`inboundHtlcMinimumMsat`, buf)
89438945
FfiConverterOptionalULong.write(value.`inboundHtlcMaximumMsat`, buf)
89448946
FfiConverterTypeChannelConfig.write(value.`config`, buf)
8947+
FfiConverterOptionalULong.write(value.`claimableOnCloseSats`, buf)
89458948
}
89468949
}
89478950

bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,8 @@ data class ChannelDetails (
756756
val `forceCloseSpendDelay`: kotlin.UShort?,
757757
val `inboundHtlcMinimumMsat`: kotlin.ULong,
758758
val `inboundHtlcMaximumMsat`: kotlin.ULong?,
759-
val `config`: ChannelConfig
759+
val `config`: ChannelConfig,
760+
val `claimableOnCloseSats`: kotlin.ULong?
760761
) {
761762
companion object
762763
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536m
22
kotlin.code.style=official
3-
libraryVersion=0.7.0-rc.6
3+
libraryVersion=0.7.0-rc.7

0 commit comments

Comments
 (0)