Skip to content
Open
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
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.6"
version = "0.7.0-rc.8"
authors = ["Elias Rohrer <[email protected]>"]
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.6"
let checksum = "4ea23aedbf918a1c93539168f34e626cbe867c1d5e827b7b7fd0e84225970b91"
let tag = "v0.7.0-rc.8"
let checksum = "7ce9e6eb4335f40b5bb4e17e2eb94ab10e41845b41b635e47b7baca66a30b819"
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.6
libraryVersion=0.7.0-rc.8
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,12 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue =












Expand Down Expand Up @@ -2195,6 +2201,10 @@ internal interface UniffiLib : Library {
`persist`: Byte,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_node_current_sync_intervals(
`ptr`: Pointer?,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_node_disconnect(
`ptr`: Pointer?,
`nodeId`: RustBufferByValue,
Expand Down Expand Up @@ -2351,6 +2361,11 @@ internal interface UniffiLib : Library {
`channelConfig`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_node_update_sync_intervals(
`ptr`: Pointer?,
`intervals`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_node_verify_signature(
`ptr`: Pointer?,
`msg`: RustBufferByValue,
Expand Down Expand Up @@ -2657,6 +2672,9 @@ internal interface UniffiLib : Library {
`ptr`: Pointer?,
`request`: RustBufferByValue,
): Long
fun uniffi_ldk_node_fn_func_battery_saving_sync_intervals(
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_func_default_config(
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
Expand Down Expand Up @@ -2881,6 +2899,8 @@ internal interface UniffiLib : Library {
`handle`: Long,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_checksum_func_battery_saving_sync_intervals(
): Short
fun uniffi_ldk_node_checksum_func_default_config(
): Short
fun uniffi_ldk_node_checksum_func_derive_node_secret_from_mnemonic(
Expand Down Expand Up @@ -3095,6 +3115,8 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_node_connect(
): Short
fun uniffi_ldk_node_checksum_method_node_current_sync_intervals(
): Short
fun uniffi_ldk_node_checksum_method_node_disconnect(
): Short
fun uniffi_ldk_node_checksum_method_node_event_handled(
Expand Down Expand Up @@ -3159,6 +3181,8 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_node_update_channel_config(
): Short
fun uniffi_ldk_node_checksum_method_node_update_sync_intervals(
): Short
fun uniffi_ldk_node_checksum_method_node_verify_signature(
): Short
fun uniffi_ldk_node_checksum_method_node_wait_next_event(
Expand Down Expand Up @@ -3274,6 +3298,9 @@ private fun uniffiCheckContractApiVersion(lib: UniffiLib) {


private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_func_battery_saving_sync_intervals() != 25473.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_func_default_config() != 55381.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3595,6 +3622,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_node_connect() != 34120.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_current_sync_intervals() != 51918.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_disconnect() != 43538.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -3691,6 +3721,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_node_update_channel_config() != 37852.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_update_sync_intervals() != 42322.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_verify_signature() != 20486.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -6844,6 +6877,17 @@ open class Node: Disposable, NodeInterface {
}
}

override fun `currentSyncIntervals`(): RuntimeSyncIntervals {
return FfiConverterTypeRuntimeSyncIntervals.lift(callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_current_sync_intervals(
it,
uniffiRustCallStatus,
)
}
})
}

@Throws(NodeException::class)
override fun `disconnect`(`nodeId`: PublicKey) {
callWithPointer {
Expand Down Expand Up @@ -7246,6 +7290,19 @@ open class Node: Disposable, NodeInterface {
}
}

@Throws(NodeException::class)
override fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals) {
callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_update_sync_intervals(
it,
FfiConverterTypeRuntimeSyncIntervals.lower(`intervals`),
uniffiRustCallStatus,
)
}
}
}

override fun `verifySignature`(`msg`: List<kotlin.UByte>, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean {
return FfiConverterBoolean.lift(callWithPointer {
uniffiRustCall { uniffiRustCallStatus ->
Expand Down Expand Up @@ -9659,6 +9716,31 @@ object FfiConverterTypeRoutingFees: FfiConverterRustBuffer<RoutingFees> {



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

override fun allocationSize(value: RuntimeSyncIntervals) = (
FfiConverterULong.allocationSize(value.`onchainWalletSyncIntervalSecs`) +
FfiConverterULong.allocationSize(value.`lightningWalletSyncIntervalSecs`) +
FfiConverterULong.allocationSize(value.`feeRateCacheUpdateIntervalSecs`)
)

override fun write(value: RuntimeSyncIntervals, buf: ByteBuffer) {
FfiConverterULong.write(value.`onchainWalletSyncIntervalSecs`, buf)
FfiConverterULong.write(value.`lightningWalletSyncIntervalSecs`, buf)
FfiConverterULong.write(value.`feeRateCacheUpdateIntervalSecs`, buf)
}
}




object FfiConverterTypeSpendableUtxo: FfiConverterRustBuffer<SpendableUtxo> {
override fun read(buf: ByteBuffer): SpendableUtxo {
return SpendableUtxo(
Expand Down Expand Up @@ -11067,6 +11149,7 @@ object FfiConverterTypeNodeError : FfiConverterRustBuffer<NodeException> {
60 -> NodeException.NoSpendableOutputs(FfiConverterString.read(buf))
61 -> NodeException.CoinSelectionFailed(FfiConverterString.read(buf))
62 -> NodeException.InvalidMnemonic(FfiConverterString.read(buf))
63 -> NodeException.BackgroundSyncNotEnabled(FfiConverterString.read(buf))
else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
}
}
Expand Down Expand Up @@ -11325,6 +11408,10 @@ object FfiConverterTypeNodeError : FfiConverterRustBuffer<NodeException> {
buf.putInt(62)
Unit
}
is NodeException.BackgroundSyncNotEnabled -> {
buf.putInt(63)
Unit
}
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
}
}
Expand Down Expand Up @@ -13781,6 +13868,14 @@ typealias FfiConverterTypeUserChannelId = FfiConverterString



fun `batterySavingSyncIntervals`(): RuntimeSyncIntervals {
return FfiConverterTypeRuntimeSyncIntervals.lift(uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_battery_saving_sync_intervals(
uniffiRustCallStatus,
)
})
}

fun `defaultConfig`(): Config {
return FfiConverterTypeConfig.lift(uniffiRustCall { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_func_default_config(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ interface NodeInterface {
@Throws(NodeException::class)
fun `connect`(`nodeId`: PublicKey, `address`: SocketAddress, `persist`: kotlin.Boolean)

fun `currentSyncIntervals`(): RuntimeSyncIntervals

@Throws(NodeException::class)
fun `disconnect`(`nodeId`: PublicKey)

Expand Down Expand Up @@ -502,6 +504,9 @@ interface NodeInterface {
@Throws(NodeException::class)
fun `updateChannelConfig`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `channelConfig`: ChannelConfig)

@Throws(NodeException::class)
fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals)

fun `verifySignature`(`msg`: List<kotlin.UByte>, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean

fun `waitNextEvent`(): Event
Expand Down Expand Up @@ -1099,6 +1104,17 @@ data class RoutingFees (



@kotlinx.serialization.Serializable
data class RuntimeSyncIntervals (
val `onchainWalletSyncIntervalSecs`: kotlin.ULong,
val `lightningWalletSyncIntervalSecs`: kotlin.ULong,
val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong
) {
companion object
}



@kotlinx.serialization.Serializable
data class SpendableUtxo (
val `outpoint`: OutPoint,
Expand Down Expand Up @@ -1783,6 +1799,8 @@ sealed class NodeException(message: String): kotlin.Exception(message) {

class InvalidMnemonic(message: String) : NodeException(message)

class BackgroundSyncNotEnabled(message: String) : NodeException(message)

}


Expand Down
2 changes: 1 addition & 1 deletion bindings/kotlin/ldk-node-jvm/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536m
kotlin.code.style=official
libraryVersion=0.7.0-rc.6
libraryVersion=0.7.0-rc.8
11 changes: 11 additions & 0 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace ldk_node {
Mnemonic generate_entropy_mnemonic(WordCount? word_count);
Config default_config();
RuntimeSyncIntervals battery_saving_sync_intervals();
[Throws=NodeError]
sequence<u8> derive_node_secret_from_mnemonic(string mnemonic, string? passphrase);
};
Expand Down Expand Up @@ -29,6 +30,12 @@ dictionary BackgroundSyncConfig {
u64 fee_rate_cache_update_interval_secs;
};

dictionary RuntimeSyncIntervals {
u64 onchain_wallet_sync_interval_secs;
u64 lightning_wallet_sync_interval_secs;
u64 fee_rate_cache_update_interval_secs;
};

dictionary EsploraSyncConfig {
BackgroundSyncConfig? background_sync_config;
};
Expand Down Expand Up @@ -185,6 +192,9 @@ interface Node {
boolean verify_signature([ByRef]sequence<u8> msg, [ByRef]string sig, [ByRef]PublicKey pkey);
[Throws=NodeError]
bytes export_pathfinding_scores();
[Throws=NodeError]
void update_sync_intervals(RuntimeSyncIntervals intervals);
RuntimeSyncIntervals current_sync_intervals();
};

[Enum]
Expand Down Expand Up @@ -383,6 +393,7 @@ enum NodeError {
"NoSpendableOutputs",
"CoinSelectionFailed",
"InvalidMnemonic",
"BackgroundSyncNotEnabled",
};

dictionary NodeStatus {
Expand Down
Loading