Skip to content
Draft
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
64 changes: 54 additions & 10 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ldk-node"
version = "0.7.0-rc.18"
version = "0.7.0-rc.19"
authors = ["Elias Rohrer <dev@tnull.de>"]
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import PackageDescription

let tag = "v0.7.0-rc.18"
let checksum = "05903150276c3c31b2552b89d3781157ac1bbf55a10598655897abd9fe936b6c"
let tag = "v0.7.0-rc.19"
let checksum = "39cb32343f7a4f6c42f02d9e132971df36e7bc7618ad69fb390fdd8c3c223647"
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 @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
libraryVersion=0.7.0-rc.18
libraryVersion=0.7.0-rc.19
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,16 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue =
















Expand Down Expand Up @@ -1949,6 +1959,16 @@ internal interface UniffiLib : Library {
`headerProvider`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
): Pointer?
fun uniffi_ldk_node_fn_method_builder_set_address_type(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_builder_set_address_types_to_monitor(
`ptr`: Pointer?,
`addressTypesToMonitor`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_builder_set_announcement_addresses(
`ptr`: Pointer?,
`announcementAddresses`: RustBufferByValue,
Expand Down Expand Up @@ -2230,6 +2250,11 @@ internal interface UniffiLib : Library {
`addressStr`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Long
fun uniffi_ldk_node_fn_method_node_get_balance_for_address_type(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_node_get_transaction_details(
`ptr`: Pointer?,
`txid`: RustBufferByValue,
Expand All @@ -2243,6 +2268,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_node_list_monitored_address_types(
`ptr`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_node_list_payments(
`ptr`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
Expand Down Expand Up @@ -2500,6 +2529,11 @@ internal interface UniffiLib : Library {
`ptr`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_new_address_for_type(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_select_utxos_with_algorithm(
`ptr`: Pointer?,
`targetAmountSats`: Long,
Expand Down Expand Up @@ -3039,6 +3073,10 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_header_provider(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_address_type(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_address_types_to_monitor(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_announcement_addresses(
): Short
fun uniffi_ldk_node_checksum_method_builder_set_async_payments_role(
Expand Down Expand Up @@ -3127,12 +3165,16 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_node_get_address_balance(
): Short
fun uniffi_ldk_node_checksum_method_node_get_balance_for_address_type(
): Short
fun uniffi_ldk_node_checksum_method_node_get_transaction_details(
): Short
fun uniffi_ldk_node_checksum_method_node_list_balances(
): Short
fun uniffi_ldk_node_checksum_method_node_list_channels(
): Short
fun uniffi_ldk_node_checksum_method_node_list_monitored_address_types(
): Short
fun uniffi_ldk_node_checksum_method_node_list_payments(
): Short
fun uniffi_ldk_node_checksum_method_node_list_peers(
Expand Down Expand Up @@ -3223,6 +3265,8 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_new_address(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_type(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_select_utxos_with_algorithm(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_send_all_to_address(
Expand Down Expand Up @@ -3508,6 +3552,12 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_builder_build_with_vss_store_and_header_provider() != 9090.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_address_type() != 647.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_address_types_to_monitor() != 23561.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_builder_set_announcement_addresses() != 39271.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3640,6 +3690,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_node_get_address_balance() != 45284.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_get_balance_for_address_type() != 34906.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_get_transaction_details() != 65000.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand All @@ -3649,6 +3702,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_node_list_channels() != 7954.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_list_monitored_address_types() != 25084.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_list_payments() != 35002.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3784,6 +3840,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address() != 37251.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_new_address_for_type() != 9083.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_select_utxos_with_algorithm() != 14084.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -5641,6 +5700,30 @@ open class Builder: Disposable, BuilderInterface {
})
}

override fun `setAddressType`(`addressType`: AddressType) {
callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_address_type(
it,
FfiConverterTypeAddressType.lower(`addressType`),
uniffiRustCallStatus,
)
}
}
}

override fun `setAddressTypesToMonitor`(`addressTypesToMonitor`: List<AddressType>) {
callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_builder_set_address_types_to_monitor(
it,
FfiConverterSequenceTypeAddressType.lower(`addressTypesToMonitor`),
uniffiRustCallStatus,
)
}
}
}

@Throws(BuildException::class)
override fun `setAnnouncementAddresses`(`announcementAddresses`: List<SocketAddress>) {
callWithPointer {
Expand Down Expand Up @@ -6953,6 +7036,19 @@ open class Node: Disposable, NodeInterface {
})
}

@Throws(NodeException::class)
override fun `getBalanceForAddressType`(`addressType`: AddressType): AddressTypeBalance {
return FfiConverterTypeAddressTypeBalance.lift(callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_get_balance_for_address_type(
it,
FfiConverterTypeAddressType.lower(`addressType`),
uniffiRustCallStatus,
)
}
})
}

override fun `getTransactionDetails`(`txid`: Txid): TransactionDetails? {
return FfiConverterOptionalTypeTransactionDetails.lift(callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
Expand Down Expand Up @@ -6987,6 +7083,17 @@ open class Node: Disposable, NodeInterface {
})
}

override fun `listMonitoredAddressTypes`(): List<AddressType> {
return FfiConverterSequenceTypeAddressType.lift(callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_list_monitored_address_types(
it,
uniffiRustCallStatus,
)
}
})
}

override fun `listPayments`(): List<PaymentDetails> {
return FfiConverterSequenceTypePaymentDetails.lift(callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
Expand Down Expand Up @@ -7846,6 +7953,19 @@ open class OnchainPayment: Disposable, OnchainPaymentInterface {
})
}

@Throws(NodeException::class)
override fun `newAddressForType`(`addressType`: AddressType): Address {
return FfiConverterTypeAddress.lift(callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_new_address_for_type(
it,
FfiConverterTypeAddressType.lower(`addressType`),
uniffiRustCallStatus,
)
}
})
}

@Throws(NodeException::class)
override fun `selectUtxosWithAlgorithm`(`targetAmountSats`: kotlin.ULong, `feeRate`: FeeRate?, `algorithm`: CoinSelectionAlgorithm, `utxos`: List<SpendableUtxo>?): List<SpendableUtxo> {
return FfiConverterSequenceTypeSpendableUtxo.lift(callWithPointer {
Expand Down Expand Up @@ -8737,6 +8857,28 @@ object FfiConverterTypeVssHeaderProvider: FfiConverter<VssHeaderProvider, Pointe



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

override fun allocationSize(value: AddressTypeBalance) = (
FfiConverterULong.allocationSize(value.`totalSats`) +
FfiConverterULong.allocationSize(value.`spendableSats`)
)

override fun write(value: AddressTypeBalance, buf: ByteBuffer) {
FfiConverterULong.write(value.`totalSats`, buf)
FfiConverterULong.write(value.`spendableSats`, buf)
}
}




object FfiConverterTypeAnchorChannelsConfig: FfiConverterRustBuffer<AnchorChannelsConfig> {
override fun read(buf: ByteBuffer): AnchorChannelsConfig {
return AnchorChannelsConfig(
Expand Down Expand Up @@ -9086,6 +9228,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterOptionalTypeAnchorChannelsConfig.read(buf),
FfiConverterOptionalTypeRouteParametersConfig.read(buf),
FfiConverterBoolean.read(buf),
FfiConverterTypeAddressType.read(buf),
FfiConverterSequenceTypeAddressType.read(buf),
)
}

Expand All @@ -9099,7 +9243,9 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterULong.allocationSize(value.`probingLiquidityLimitMultiplier`) +
FfiConverterOptionalTypeAnchorChannelsConfig.allocationSize(value.`anchorChannelsConfig`) +
FfiConverterOptionalTypeRouteParametersConfig.allocationSize(value.`routeParameters`) +
FfiConverterBoolean.allocationSize(value.`includeUntrustedPendingInSpendable`)
FfiConverterBoolean.allocationSize(value.`includeUntrustedPendingInSpendable`) +
FfiConverterTypeAddressType.allocationSize(value.`addressType`) +
FfiConverterSequenceTypeAddressType.allocationSize(value.`addressTypesToMonitor`)
)

override fun write(value: Config, buf: ByteBuffer) {
Expand All @@ -9113,6 +9259,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterOptionalTypeAnchorChannelsConfig.write(value.`anchorChannelsConfig`, buf)
FfiConverterOptionalTypeRouteParametersConfig.write(value.`routeParameters`, buf)
FfiConverterBoolean.write(value.`includeUntrustedPendingInSpendable`, buf)
FfiConverterTypeAddressType.write(value.`addressType`, buf)
FfiConverterSequenceTypeAddressType.write(value.`addressTypesToMonitor`, buf)
}
}

Expand Down Expand Up @@ -9854,6 +10002,24 @@ object FfiConverterTypeTxOutput: FfiConverterRustBuffer<TxOutput> {



object FfiConverterTypeAddressType: FfiConverterRustBuffer<AddressType> {
override fun read(buf: ByteBuffer) = try {
AddressType.entries[buf.getInt() - 1]
} catch (e: IndexOutOfBoundsException) {
throw RuntimeException("invalid enum value, something is very wrong!!", e)
}

override fun allocationSize(value: AddressType) = 4UL

override fun write(value: AddressType, buf: ByteBuffer) {
buf.putInt(value.ordinal + 1)
}
}





object FfiConverterTypeAsyncPaymentsRole: FfiConverterRustBuffer<AsyncPaymentsRole> {
override fun read(buf: ByteBuffer) = try {
AsyncPaymentsRole.entries[buf.getInt() - 1]
Expand Down Expand Up @@ -13487,6 +13653,31 @@ object FfiConverterSequenceTypeTxOutput: FfiConverterRustBuffer<List<TxOutput>>



object FfiConverterSequenceTypeAddressType: FfiConverterRustBuffer<List<AddressType>> {
override fun read(buf: ByteBuffer): List<AddressType> {
val len = buf.getInt()
return List<AddressType>(len) {
FfiConverterTypeAddressType.read(buf)
}
}

override fun allocationSize(value: List<AddressType>): ULong {
val sizeForLength = 4UL
val sizeForItems = value.sumOf { FfiConverterTypeAddressType.allocationSize(it) }
return sizeForLength + sizeForItems
}

override fun write(value: List<AddressType>, buf: ByteBuffer) {
buf.putInt(value.size)
value.iterator().forEach {
FfiConverterTypeAddressType.write(it, buf)
}
}
}




object FfiConverterSequenceTypeLightningBalance: FfiConverterRustBuffer<List<LightningBalance>> {
override fun read(buf: ByteBuffer): List<LightningBalance> {
val len = buf.getInt()
Expand Down
Loading