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
23 changes: 15 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.7.0-rc.54 (Synonym Fork)
# 0.7.0-rc.55 (Synonym Fork)

## Bug Fixes

Expand Down Expand Up @@ -65,16 +65,23 @@

## Synonym Fork Additions

- Added configurable Electrum batch size and stop gap for full scans of non-primary on-chain
wallets, while preserving the existing primary-wallet behavior and defaults.
- Added derived-account lifecycle parity with account-`0` wallets: configured accounts load on
build, registered accounts can be unloaded at runtime without deleting persisted BDK state, and
account-specific address metadata can be derived by index or range.
- Added derived on-chain wallet account support (`account_index >= 1`) from the node's master
seed:
- `export_onchain_wallet_account_xpub` / `add_onchain_wallet_account` (idempotent; validates
xpub; rejects account `0` and indexes above `MAX_ONCHAIN_WALLET_ACCOUNT_INDEX`);
- `export_onchain_wallet_account_xpub` / `add_onchain_wallet_account` /
`remove_onchain_wallet_account` (idempotent add; validates xpub; reserves account `0`);
`get_balance_for_onchain_wallet_account` / `list_onchain_wallet_accounts`;
`OnchainPayment::new_address_for_account` / `new_address_info_for_account` /
`reveal_receive_addresses_to_account`;
`OnchainWalletAccount`
- Registration is not persisted and not auto-loaded; re-add after each build. BDK data
remains persisted per account
`OnchainPayment::new_address_for_account` /
`new_address_info_for_account` / `address_info_for_account_at_index` /
`address_infos_for_account` / `reveal_receive_addresses_to_account`;
`OnchainWalletAccount` / `OnchainWalletAccountConfig`
- Runtime registration changes are not persisted. Configure registrations in
`Config::onchain_wallet_accounts` to load them on each build. BDK data remains persisted per
account after unload
- Derived accounts full-scan after registration, then use incremental sync. Apps issuing addresses
from an exported xpub reveal their highest issued index before syncing; descriptor origins use
the real account path; channel preflight requires an account-`0` SegWit builder before counting
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.54"
version = "0.7.0-rc.55"
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.54"
let checksum = "29e608bc67576cfe6e658939179d71105d6943c74f72e4e358e1f5ccc8a7b877"
let tag = "v0.7.0-rc.55"
let checksum = "098d48d602fe000f1a9dbc7e758a0fe7bd8720c12b0036c38edf38283edd55f3"
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.54
version=0.7.0-rc.55
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,12 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue =












Expand Down Expand Up @@ -2432,6 +2438,12 @@ internal interface UniffiLib : Library {
`addressType`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_node_remove_onchain_wallet_account(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
`accountIndex`: Int,
uniffiCallStatus: UniffiRustCallStatus,
): Unit
fun uniffi_ldk_node_fn_method_node_remove_payment(
`ptr`: Pointer?,
`paymentId`: RustBufferByValue,
Expand Down Expand Up @@ -2612,13 +2624,30 @@ internal interface UniffiLib : Library {
`destinationAddress`: RustBufferByValue,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_address_info_for_account_at_index(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
`accountIndex`: Int,
`keychain`: RustBufferByValue,
`index`: Int,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_address_info_for_type_at_index(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
`keychain`: RustBufferByValue,
`index`: Int,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_account(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
`accountIndex`: Int,
`keychain`: RustBufferByValue,
`startIndex`: Int,
`count`: Int,
uniffiCallStatus: UniffiRustCallStatus,
): RustBufferByValue
fun uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_type(
`ptr`: Pointer?,
`addressType`: RustBufferByValue,
Expand Down Expand Up @@ -3388,6 +3417,8 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_node_remove_address_type_from_monitor(
): Short
fun uniffi_ldk_node_checksum_method_node_remove_onchain_wallet_account(
): Short
fun uniffi_ldk_node_checksum_method_node_remove_payment(
): Short
fun uniffi_ldk_node_checksum_method_node_set_primary_address_type(
Expand Down Expand Up @@ -3446,8 +3477,12 @@ internal interface UniffiLib : Library {
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_accelerate_by_cpfp(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_account_at_index(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_type_at_index(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_account(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_type(
): Short
fun uniffi_ldk_node_checksum_method_onchainpayment_bump_fee_by_rbf(
Expand Down Expand Up @@ -3983,6 +4018,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_node_remove_address_type_from_monitor() != 37081.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_remove_onchain_wallet_account() != 21186.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_node_remove_payment() != 47952.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -4070,9 +4108,15 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_accelerate_by_cpfp() != 31954.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_account_at_index() != 63246.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_info_for_type_at_index() != 42692.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_account() != 39321.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_ldk_node_checksum_method_onchainpayment_address_infos_for_type() != 3701.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -7661,6 +7705,20 @@ open class Node: Disposable, NodeInterface {
}
}

@Throws(NodeException::class)
override fun `removeOnchainWalletAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt) {
callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_node_remove_onchain_wallet_account(
it,
FfiConverterTypeAddressType.lower(`addressType`),
FfiConverterUInt.lower(`accountIndex`),
uniffiRustCallStatus,
)
}
}
}

@Throws(NodeException::class)
override fun `removePayment`(`paymentId`: PaymentId) {
callWithPointer {
Expand Down Expand Up @@ -8318,6 +8376,22 @@ open class OnchainPayment: Disposable, OnchainPaymentInterface {
})
}

@Throws(NodeException::class)
override fun `addressInfoForAccountAtIndex`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo {
return FfiConverterTypeAddressInfo.lift(callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_info_for_account_at_index(
it,
FfiConverterTypeAddressType.lower(`addressType`),
FfiConverterUInt.lower(`accountIndex`),
FfiConverterTypeKeychainKind.lower(`keychain`),
FfiConverterUInt.lower(`index`),
uniffiRustCallStatus,
)
}
})
}

@Throws(NodeException::class)
override fun `addressInfoForTypeAtIndex`(`addressType`: AddressType, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo {
return FfiConverterTypeAddressInfo.lift(callWithPointer {
Expand All @@ -8333,6 +8407,23 @@ open class OnchainPayment: Disposable, OnchainPaymentInterface {
})
}

@Throws(NodeException::class)
override fun `addressInfosForAccount`(`addressType`: AddressType, `accountIndex`: kotlin.UInt, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List<AddressInfo> {
return FfiConverterSequenceTypeAddressInfo.lift(callWithPointer {
uniffiRustCallWithError(NodeExceptionErrorHandler) { uniffiRustCallStatus ->
UniffiLib.INSTANCE.uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_account(
it,
FfiConverterTypeAddressType.lower(`addressType`),
FfiConverterUInt.lower(`accountIndex`),
FfiConverterTypeKeychainKind.lower(`keychain`),
FfiConverterUInt.lower(`startIndex`),
FfiConverterUInt.lower(`count`),
uniffiRustCallStatus,
)
}
})
}

@Throws(NodeException::class)
override fun `addressInfosForType`(`addressType`: AddressType, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List<AddressInfo> {
return FfiConverterSequenceTypeAddressInfo.lift(callWithPointer {
Expand Down Expand Up @@ -9818,6 +9909,7 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterBoolean.read(buf),
FfiConverterTypeAddressType.read(buf),
FfiConverterSequenceTypeAddressType.read(buf),
FfiConverterSequenceTypeOnchainWalletAccountConfig.read(buf),
)
}

Expand All @@ -9835,7 +9927,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterOptionalTypeScoringDecayParameters.allocationSize(value.`scoringDecayParams`) +
FfiConverterBoolean.allocationSize(value.`includeUntrustedPendingInSpendable`) +
FfiConverterTypeAddressType.allocationSize(value.`addressType`) +
FfiConverterSequenceTypeAddressType.allocationSize(value.`addressTypesToMonitor`)
FfiConverterSequenceTypeAddressType.allocationSize(value.`addressTypesToMonitor`) +
FfiConverterSequenceTypeOnchainWalletAccountConfig.allocationSize(value.`onchainWalletAccounts`)
)

override fun write(value: Config, buf: ByteBuffer) {
Expand All @@ -9853,6 +9946,7 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer<Config> {
FfiConverterBoolean.write(value.`includeUntrustedPendingInSpendable`, buf)
FfiConverterTypeAddressType.write(value.`addressType`, buf)
FfiConverterSequenceTypeAddressType.write(value.`addressTypesToMonitor`, buf)
FfiConverterSequenceTypeOnchainWalletAccountConfig.write(value.`onchainWalletAccounts`, buf)
}
}

Expand Down Expand Up @@ -9886,17 +9980,23 @@ object FfiConverterTypeElectrumSyncConfig: FfiConverterRustBuffer<ElectrumSyncCo
return ElectrumSyncConfig(
FfiConverterOptionalTypeBackgroundSyncConfig.read(buf),
FfiConverterULong.read(buf),
FfiConverterUInt.read(buf),
FfiConverterUInt.read(buf),
)
}

override fun allocationSize(value: ElectrumSyncConfig) = (
FfiConverterOptionalTypeBackgroundSyncConfig.allocationSize(value.`backgroundSyncConfig`) +
FfiConverterULong.allocationSize(value.`connectionTimeoutSecs`)
FfiConverterULong.allocationSize(value.`connectionTimeoutSecs`) +
FfiConverterUInt.allocationSize(value.`additionalWalletFullScanBatchSize`) +
FfiConverterUInt.allocationSize(value.`additionalWalletFullScanStopGap`)
)

override fun write(value: ElectrumSyncConfig, buf: ByteBuffer) {
FfiConverterOptionalTypeBackgroundSyncConfig.write(value.`backgroundSyncConfig`, buf)
FfiConverterULong.write(value.`connectionTimeoutSecs`, buf)
FfiConverterUInt.write(value.`additionalWalletFullScanBatchSize`, buf)
FfiConverterUInt.write(value.`additionalWalletFullScanStopGap`, buf)
}
}

Expand Down Expand Up @@ -10313,6 +10413,31 @@ object FfiConverterTypeOnchainWalletAccount: FfiConverterRustBuffer<OnchainWalle



object FfiConverterTypeOnchainWalletAccountConfig: FfiConverterRustBuffer<OnchainWalletAccountConfig> {
override fun read(buf: ByteBuffer): OnchainWalletAccountConfig {
return OnchainWalletAccountConfig(
FfiConverterTypeAddressType.read(buf),
FfiConverterUInt.read(buf),
FfiConverterString.read(buf),
)
}

override fun allocationSize(value: OnchainWalletAccountConfig) = (
FfiConverterTypeAddressType.allocationSize(value.`addressType`) +
FfiConverterUInt.allocationSize(value.`accountIndex`) +
FfiConverterString.allocationSize(value.`xpub`)
)

override fun write(value: OnchainWalletAccountConfig, buf: ByteBuffer) {
FfiConverterTypeAddressType.write(value.`addressType`, buf)
FfiConverterUInt.write(value.`accountIndex`, buf)
FfiConverterString.write(value.`xpub`, buf)
}
}




object FfiConverterTypeOutPoint: FfiConverterRustBuffer<OutPoint> {
override fun read(buf: ByteBuffer): OutPoint {
return OutPoint(
Expand Down Expand Up @@ -12097,7 +12222,8 @@ object FfiConverterTypeNodeError : FfiConverterRustBuffer<NodeException> {
64 -> NodeException.AddressTypeAlreadyMonitored(FfiConverterString.read(buf))
65 -> NodeException.AddressTypeIsPrimary(FfiConverterString.read(buf))
66 -> NodeException.AddressTypeNotMonitored(FfiConverterString.read(buf))
67 -> NodeException.InvalidSeedBytes(FfiConverterString.read(buf))
67 -> NodeException.OnchainWalletAccountNotRegistered(FfiConverterString.read(buf))
68 -> NodeException.InvalidSeedBytes(FfiConverterString.read(buf))
else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
}
}
Expand Down Expand Up @@ -12372,10 +12498,14 @@ object FfiConverterTypeNodeError : FfiConverterRustBuffer<NodeException> {
buf.putInt(66)
Unit
}
is NodeException.InvalidSeedBytes -> {
is NodeException.OnchainWalletAccountNotRegistered -> {
buf.putInt(67)
Unit
}
is NodeException.InvalidSeedBytes -> {
buf.putInt(68)
Unit
}
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
}
}
Expand Down Expand Up @@ -14406,6 +14536,31 @@ object FfiConverterSequenceTypeOnchainWalletAccount: FfiConverterRustBuffer<List



object FfiConverterSequenceTypeOnchainWalletAccountConfig: FfiConverterRustBuffer<List<OnchainWalletAccountConfig>> {
override fun read(buf: ByteBuffer): List<OnchainWalletAccountConfig> {
val len = buf.getInt()
return List<OnchainWalletAccountConfig>(len) {
FfiConverterTypeOnchainWalletAccountConfig.read(buf)
}
}

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

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




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