Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.7.0-rc.51 (Synonym Fork)
# 0.7.0-rc.52 (Synonym Fork)

## Bug Fixes

Expand Down Expand Up @@ -65,6 +65,7 @@

## Synonym Fork Additions

- Added configurable routing scorer parameters `scoring_fee_params` and `scoring_decay_params`
- Added `AddressInfo` (`index`, `address`, `keychain`) and `KeychainKind`.
- Added `OnchainPayment` methods `new_address_info`, `new_address_info_for_type`,
`address_info_for_type_at_index`, `address_infos_for_type`, and
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["bindings/uniffi-bindgen"]

[package]
name = "ldk-node"
version = "0.7.0-rc.51"
version = "0.7.0-rc.52"
authors = ["Elias Rohrer <dev@tnull.de>"]
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// swift-tools-version:5.5
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let tag = "v0.7.0-rc.51"
let checksum = "efeec8d0480f1400c6a4203232359f5b3c4c338a4ba13826538cac12b8fe1bac"
let tag = "v0.7.0-rc.52"
let checksum = "bfa1de808ed8b457f6c5aaf911b96806d995fd2a40c04b2b2e27aa75ab206098"
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion bindings/kotlin/ldk-node-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
group=com.synonym
version=0.7.0-rc.51
version=0.7.0-rc.52
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,10 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue =










Expand Down Expand Up @@ -2117,6 +2121,16 @@ internal interface UniffiLib : Library {
`url`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_builder_set_scoring_decay_params(
`ptr`: Pointer?,
`params`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_builder_set_scoring_fee_params(
`ptr`: Pointer?,
`params`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_builder_set_storage_dir_path(
`ptr`: Pointer?,
`storageDirPath`: RustBufferByValue,
Expand Down Expand Up @@ -3218,6 +3232,10 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_storage_dir_path(
): Short
fun uniffi_ldk_node_checksum_method_feerate_to_sat_per_kwu(
Expand Down Expand Up @@ -3745,6 +3763,12 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source() != 63501.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params() != 19869.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params() != 11588.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_storage_dir_path() != 59019.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -6164,6 +6188,30 @@ open class Builder: Disposable, BuilderInterface {
}
}

override fun `setScoringDecayParams`(`params`: ScoringDecayParameters) {
callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_scoring_decay_params(
it,
FfiConverterTypeScoringDecayParameters.lower(`params`),
uniffiRustCallStatus,
)
}
}
}

override fun `setScoringFeeParams`(`params`: ScoringFeeParameters) {
callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_scoring_fee_params(
it,
FfiConverterTypeScoringFeeParameters.lower(`params`),
uniffiRustCallStatus,
)
}
}
}

override fun `setStorageDirPath`(`storageDirPath`: kotlin.String) {
callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
Expand Down Expand Up @@ -9577,6 +9625,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterULong.read(buf),
FfiConverterOptionalTypeAnchorChannelsConfig.read(buf),
FfiConverterOptionalTypeRouteParametersConfig.read(buf),
FfiConverterOptionalTypeScoringFeeParameters.read(buf),
FfiConverterOptionalTypeScoringDecayParameters.read(buf),
FfiConverterBoolean.read(buf),
FfiConverterTypeAddressType.read(buf),
FfiConverterSequenceTypeAddressType.read(buf),
Expand All @@ -9593,6 +9643,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterULong.allocationSize(value.`probingLiquidityLimitMultiplier`) +
FfiConverterOptionalTypeAnchorChannelsConfig.allocationSize(value.`anchorChannelsConfig`) +
FfiConverterOptionalTypeRouteParametersConfig.allocationSize(value.`routeParameters`) +
FfiConverterOptionalTypeScoringFeeParameters.allocationSize(value.`scoringFeeParams`) +
FfiConverterOptionalTypeScoringDecayParameters.allocationSize(value.`scoringDecayParams`) +
FfiConverterBoolean.allocationSize(value.`includeUntrustedPendingInSpendable`) +
FfiConverterTypeAddressType.allocationSize(value.`addressType`) +
FfiConverterSequenceTypeAddressType.allocationSize(value.`addressTypesToMonitor`)
Expand All @@ -9608,6 +9660,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterULong.write(value.`probingLiquidityLimitMultiplier`, buf)
FfiConverterOptionalTypeAnchorChannelsConfig.write(value.`anchorChannelsConfig`, buf)
FfiConverterOptionalTypeRouteParametersConfig.write(value.`routeParameters`, buf)
FfiConverterOptionalTypeScoringFeeParameters.write(value.`scoringFeeParams`, buf)
FfiConverterOptionalTypeScoringDecayParameters.write(value.`scoringDecayParams`, buf)
FfiConverterBoolean.write(value.`includeUntrustedPendingInSpendable`, buf)
FfiConverterTypeAddressType.write(value.`addressType`, buf)
FfiConverterSequenceTypeAddressType.write(value.`addressTypesToMonitor`, buf)
Expand Down Expand Up @@ -10267,6 +10321,74 @@ object FfiConverterTypeRuntimeSyncIntervals: FfiConverterRustBuffer<RuntimeSyncI



object FfiConverterTypeScoringDecayParameters: FfiConverterRustBuffer<ScoringDecayParameters> {
override fun read(buf: ByteBuffer): ScoringDecayParameters {
return ScoringDecayParameters(
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
)
}

override fun allocationSize(value: ScoringDecayParameters) = (
FfiConverterULong.allocationSize(value.`historicalNoUpdatesHalfLifeSecs`) +
FfiConverterULong.allocationSize(value.`liquidityOffsetHalfLifeSecs`)
)

override fun write(value: ScoringDecayParameters, buf: ByteBuffer) {
FfiConverterULong.write(value.`historicalNoUpdatesHalfLifeSecs`, buf)
FfiConverterULong.write(value.`liquidityOffsetHalfLifeSecs`, buf)
}
}




object FfiConverterTypeScoringFeeParameters: FfiConverterRustBuffer<ScoringFeeParameters> {
override fun read(buf: ByteBuffer): ScoringFeeParameters {
return ScoringFeeParameters(
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterULong.read(buf),
FfiConverterBoolean.read(buf),
FfiConverterULong.read(buf),
)
}

override fun allocationSize(value: ScoringFeeParameters) = (
FfiConverterULong.allocationSize(value.`basePenaltyMsat`) +
FfiConverterULong.allocationSize(value.`basePenaltyAmountMultiplierMsat`) +
FfiConverterULong.allocationSize(value.`liquidityPenaltyMultiplierMsat`) +
FfiConverterULong.allocationSize(value.`liquidityPenaltyAmountMultiplierMsat`) +
FfiConverterULong.allocationSize(value.`historicalLiquidityPenaltyMultiplierMsat`) +
FfiConverterULong.allocationSize(value.`historicalLiquidityPenaltyAmountMultiplierMsat`) +
FfiConverterULong.allocationSize(value.`antiProbingPenaltyMsat`) +
FfiConverterULong.allocationSize(value.`consideredImpossiblePenaltyMsat`) +
FfiConverterBoolean.allocationSize(value.`linearSuccessProbability`) +
FfiConverterULong.allocationSize(value.`probingDiversityPenaltyMsat`)
)

override fun write(value: ScoringFeeParameters, buf: ByteBuffer) {
FfiConverterULong.write(value.`basePenaltyMsat`, buf)
FfiConverterULong.write(value.`basePenaltyAmountMultiplierMsat`, buf)
FfiConverterULong.write(value.`liquidityPenaltyMultiplierMsat`, buf)
FfiConverterULong.write(value.`liquidityPenaltyAmountMultiplierMsat`, buf)
FfiConverterULong.write(value.`historicalLiquidityPenaltyMultiplierMsat`, buf)
FfiConverterULong.write(value.`historicalLiquidityPenaltyAmountMultiplierMsat`, buf)
FfiConverterULong.write(value.`antiProbingPenaltyMsat`, buf)
FfiConverterULong.write(value.`consideredImpossiblePenaltyMsat`, buf)
FfiConverterBoolean.write(value.`linearSuccessProbability`, buf)
FfiConverterULong.write(value.`probingDiversityPenaltyMsat`, buf)
}
}




object FfiConverterTypeSpendableUtxo: FfiConverterRustBuffer<SpendableUtxo> {
override fun read(buf: ByteBuffer): SpendableUtxo {
return SpendableUtxo(
Expand Down Expand Up @@ -10931,11 +11053,13 @@ object FfiConverterTypeEvent : FfiConverterRustBuffer<Event>{
6 -> Event.ProbeSuccessful(
FfiConverterTypePaymentId.read(buf),
FfiConverterTypePaymentHash.read(buf),
FfiConverterOptionalULong.read(buf),
)
7 -> Event.ProbeFailed(
FfiConverterTypePaymentId.read(buf),
FfiConverterTypePaymentHash.read(buf),
FfiConverterOptionalULong.read(buf),
FfiConverterOptionalULong.read(buf),
)
8 -> Event.ChannelPending(
FfiConverterTypeChannelId.read(buf),
Expand Down Expand Up @@ -11074,6 +11198,7 @@ object FfiConverterTypeEvent : FfiConverterRustBuffer<Event>{
4UL
+ FfiConverterTypePaymentId.allocationSize(value.`paymentId`)
+ FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`)
+ FfiConverterOptionalULong.allocationSize(value.`routeFeeMsat`)
)
}
is Event.ProbeFailed -> {
Expand All @@ -11083,6 +11208,7 @@ object FfiConverterTypeEvent : FfiConverterRustBuffer<Event>{
+ FfiConverterTypePaymentId.allocationSize(value.`paymentId`)
+ FfiConverterTypePaymentHash.allocationSize(value.`paymentHash`)
+ FfiConverterOptionalULong.allocationSize(value.`shortChannelId`)
+ FfiConverterOptionalULong.allocationSize(value.`routeFeeMsat`)
)
}
is Event.ChannelPending -> {
Expand Down Expand Up @@ -11261,13 +11387,15 @@ object FfiConverterTypeEvent : FfiConverterRustBuffer<Event>{
buf.putInt(6)
FfiConverterTypePaymentId.write(value.`paymentId`, buf)
FfiConverterTypePaymentHash.write(value.`paymentHash`, buf)
FfiConverterOptionalULong.write(value.`routeFeeMsat`, buf)
Unit
}
is Event.ProbeFailed -> {
buf.putInt(7)
FfiConverterTypePaymentId.write(value.`paymentId`, buf)
FfiConverterTypePaymentHash.write(value.`paymentHash`, buf)
FfiConverterOptionalULong.write(value.`shortChannelId`, buf)
FfiConverterOptionalULong.write(value.`routeFeeMsat`, buf)
Unit
}
is Event.ChannelPending -> {
Expand Down Expand Up @@ -13168,6 +13296,64 @@ object FfiConverterOptionalTypeRouteParametersConfig: FfiConverterRustBuffer<Rou



object FfiConverterOptionalTypeScoringDecayParameters: FfiConverterRustBuffer<ScoringDecayParameters?> {
override fun read(buf: ByteBuffer): ScoringDecayParameters? {
if (buf.get().toInt() == 0) {
return null
}
return FfiConverterTypeScoringDecayParameters.read(buf)
}

override fun allocationSize(value: ScoringDecayParameters?): ULong {
if (value == null) {
return 1UL
} else {
return 1UL + FfiConverterTypeScoringDecayParameters.allocationSize(value)
}
}

override fun write(value: ScoringDecayParameters?, buf: ByteBuffer) {
if (value == null) {
buf.put(0)
} else {
buf.put(1)
FfiConverterTypeScoringDecayParameters.write(value, buf)
}
}
}




object FfiConverterOptionalTypeScoringFeeParameters: FfiConverterRustBuffer<ScoringFeeParameters?> {
override fun read(buf: ByteBuffer): ScoringFeeParameters? {
if (buf.get().toInt() == 0) {
return null
}
return FfiConverterTypeScoringFeeParameters.read(buf)
}

override fun allocationSize(value: ScoringFeeParameters?): ULong {
if (value == null) {
return 1UL
} else {
return 1UL + FfiConverterTypeScoringFeeParameters.allocationSize(value)
}
}

override fun write(value: ScoringFeeParameters?, buf: ByteBuffer) {
if (value == null) {
buf.put(0)
} else {
buf.put(1)
FfiConverterTypeScoringFeeParameters.write(value, buf)
}
}
}




object FfiConverterOptionalTypeTransactionDetails: FfiConverterRustBuffer<TransactionDetails?> {
override fun read(buf: ByteBuffer): TransactionDetails? {
if (buf.get().toInt() == 0) {
Expand Down
Loading
Loading