diff --git a/.gitignore b/.gitignore index fe9c51cb2..0b47d57dc 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ swift.swiftdoc .claude *.local.* .ai +.vscode diff --git a/CHANGELOG.md b/CHANGELOG.md index f3cb198a5..b98bdc7dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,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 diff --git a/Package.swift b/Package.swift index 2f1b598db..24186af04 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let tag = "v0.7.0-rc.46" -let checksum = "06558c2834c186d3da188389ef197942e948ac4f6f3261746e3594420ab0ee23" +let checksum = "42ff47cbbac0f971451c31470ae2a2f0e7f33c383f58a1b3237b6bc1f7a52659" let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip" let package = Package( diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so index e4280dd39..3839c968c 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/arm64-v8a/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so index e6bccf105..26cddf55e 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/armeabi-v7a/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so index 07feb9dc6..d215ef91d 100755 Binary files a/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so and b/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs/x86_64/libldk_node.so differ diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt b/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt index 29e01ae29..133900e36 100644 --- a/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt +++ b/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.android.kt @@ -1527,6 +1527,10 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue = + + + + @@ -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, @@ -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( @@ -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") } @@ -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 -> @@ -9577,6 +9625,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { FfiConverterULong.read(buf), FfiConverterOptionalTypeAnchorChannelsConfig.read(buf), FfiConverterOptionalTypeRouteParametersConfig.read(buf), + FfiConverterOptionalTypeScoringFeeParameters.read(buf), + FfiConverterOptionalTypeScoringDecayParameters.read(buf), FfiConverterBoolean.read(buf), FfiConverterTypeAddressType.read(buf), FfiConverterSequenceTypeAddressType.read(buf), @@ -9593,6 +9643,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { 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`) @@ -9608,6 +9660,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { 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) @@ -10267,6 +10321,74 @@ object FfiConverterTypeRuntimeSyncIntervals: FfiConverterRustBuffer { + 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 { + 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 { override fun read(buf: ByteBuffer): SpendableUtxo { return SpendableUtxo( @@ -13168,6 +13290,64 @@ object FfiConverterOptionalTypeRouteParametersConfig: FfiConverterRustBuffer { + 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 { + 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 { override fun read(buf: ByteBuffer): TransactionDetails? { if (buf.get().toInt() == 0) { diff --git a/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt b/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt index 21e71fdd6..a6bf869af 100644 --- a/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt +++ b/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt @@ -104,39 +104,39 @@ object NoPointer interface Bolt11InvoiceInterface { - + fun `amountMilliSatoshis`(): kotlin.ULong? - + fun `currency`(): Currency - + fun `expiryTimeSeconds`(): kotlin.ULong - + fun `fallbackAddresses`(): List
- + fun `invoiceDescription`(): Bolt11InvoiceDescription - + fun `isExpired`(): kotlin.Boolean - + fun `minFinalCltvExpiryDelta`(): kotlin.ULong - + fun `network`(): Network - + fun `paymentHash`(): PaymentHash - + fun `paymentSecret`(): PaymentSecret - + fun `recoverPayeePubKey`(): PublicKey - + fun `routeHints`(): List> - + fun `secondsSinceEpoch`(): kotlin.ULong - + fun `secondsUntilExpiry`(): kotlin.ULong - + fun `signableHash`(): List - + fun `wouldExpire`(`atTimeSeconds`: kotlin.ULong): kotlin.Boolean - + companion object } @@ -144,55 +144,55 @@ interface Bolt11InvoiceInterface { interface Bolt11PaymentInterface { - + @Throws(NodeException::class) fun `claimForHash`(`paymentHash`: PaymentHash, `claimableAmountMsat`: kotlin.ULong, `preimage`: PaymentPreimage) - + @Throws(NodeException::class) fun `estimateRoutingFees`(`invoice`: Bolt11Invoice): kotlin.ULong - + @Throws(NodeException::class) fun `estimateRoutingFeesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong): kotlin.ULong - + @Throws(NodeException::class) fun `failForHash`(`paymentHash`: PaymentHash) - + @Throws(NodeException::class) fun `receive`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmount`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountViaJitChannel`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountViaJitChannelForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveViaJitChannel`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveViaJitChannelForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `send`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendProbes`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): List - + @Throws(NodeException::class) fun `sendProbesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): List - + @Throws(NodeException::class) fun `sendUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): PaymentId - + companion object } @@ -200,47 +200,47 @@ interface Bolt11PaymentInterface { interface Bolt12InvoiceInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amount`(): OfferAmount? - + fun `amountMsats`(): kotlin.ULong - + fun `chain`(): List - + fun `createdAt`(): kotlin.ULong - + fun `encode`(): List - + fun `fallbackAddresses`(): List
- + fun `invoiceDescription`(): kotlin.String? - + fun `isExpired`(): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `issuerSigningPubkey`(): PublicKey? - + fun `metadata`(): List? - + fun `offerChains`(): List>? - + fun `payerNote`(): kotlin.String? - + fun `payerSigningPubkey`(): PublicKey - + fun `paymentHash`(): PaymentHash - + fun `quantity`(): kotlin.ULong? - + fun `relativeExpiry`(): kotlin.ULong - + fun `signableHash`(): List - + fun `signingPubkey`(): PublicKey - + companion object } @@ -248,34 +248,34 @@ interface Bolt12InvoiceInterface { interface Bolt12PaymentInterface { - + @Throws(NodeException::class) fun `blindedPathsForAsyncRecipient`(`recipientId`: kotlin.ByteArray): kotlin.ByteArray - + @Throws(NodeException::class) fun `initiateRefund`(`amountMsat`: kotlin.ULong, `expirySecs`: kotlin.UInt, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): Refund - + @Throws(NodeException::class) fun `receive`(`amountMsat`: kotlin.ULong, `description`: kotlin.String, `expirySecs`: kotlin.UInt?, `quantity`: kotlin.ULong?): Offer - + @Throws(NodeException::class) fun `receiveAsync`(): Offer - + @Throws(NodeException::class) fun `receiveVariableAmount`(`description`: kotlin.String, `expirySecs`: kotlin.UInt?): Offer - + @Throws(NodeException::class) fun `requestRefundPayment`(`refund`: Refund): Bolt12Invoice - + @Throws(NodeException::class) fun `send`(`offer`: Offer, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendUsingAmount`(`offer`: Offer, `amountMsat`: kotlin.ULong, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `setPathsToStaticInvoiceServer`(`paths`: kotlin.ByteArray) - + companion object } @@ -283,77 +283,81 @@ interface Bolt12PaymentInterface { interface BuilderInterface { - + @Throws(BuildException::class) fun `build`(): Node - + @Throws(BuildException::class) fun `buildWithFsStore`(): Node - + @Throws(BuildException::class) fun `buildWithVssStore`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `lnurlAuthServerUrl`: kotlin.String, `fixedHeaders`: Map): Node - + @Throws(BuildException::class) fun `buildWithVssStoreAndFixedHeaders`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `fixedHeaders`: Map): Node - + @Throws(BuildException::class) fun `buildWithVssStoreAndHeaderProvider`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `headerProvider`: VssHeaderProvider): Node - + fun `setAcceptStaleChannelMonitors`(`accept`: kotlin.Boolean) - + fun `setAddressType`(`addressType`: AddressType) - + fun `setAddressTypesToMonitor`(`addressTypesToMonitor`: List) - + @Throws(BuildException::class) fun `setAnnouncementAddresses`(`announcementAddresses`: List) - + @Throws(BuildException::class) fun `setAsyncPaymentsRole`(`role`: AsyncPaymentsRole?) - + fun `setChainSourceBitcoindRest`(`restHost`: kotlin.String, `restPort`: kotlin.UShort, `rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - + fun `setChainSourceBitcoindRpc`(`rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - + fun `setChainSourceElectrum`(`serverUrl`: kotlin.String, `config`: ElectrumSyncConfig?) - + fun `setChainSourceEsplora`(`serverUrl`: kotlin.String, `config`: EsploraSyncConfig?) - + fun `setChannelDataMigration`(`migration`: ChannelDataMigration) - + fun `setCustomLogger`(`logWriter`: LogWriter) - + fun `setEntropyBip39Mnemonic`(`mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + @Throws(BuildException::class) fun `setEntropySeedBytes`(`seedBytes`: List) - + fun `setEntropySeedPath`(`seedPath`: kotlin.String) - + fun `setFilesystemLogger`(`logFilePath`: kotlin.String?, `maxLogLevel`: LogLevel?) - + fun `setGossipSourceP2p`() - + fun `setGossipSourceRgs`(`rgsServerUrl`: kotlin.String) - + fun `setLiquiditySourceLsps1`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - + fun `setLiquiditySourceLsps2`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - + @Throws(BuildException::class) fun `setListeningAddresses`(`listeningAddresses`: List) - + fun `setLogFacadeLogger`() - + fun `setNetwork`(`network`: Network) - + @Throws(BuildException::class) fun `setNodeAlias`(`nodeAlias`: kotlin.String) - + fun `setPathfindingScoresSource`(`url`: kotlin.String) - + + fun `setScoringDecayParams`(`params`: ScoringDecayParameters) + + fun `setScoringFeeParams`(`params`: ScoringFeeParameters) + fun `setStorageDirPath`(`storageDirPath`: kotlin.String) - + companion object } @@ -361,13 +365,13 @@ interface BuilderInterface { interface FeeRateInterface { - + fun `toSatPerKwu`(): kotlin.ULong - + fun `toSatPerVbCeil`(): kotlin.ULong - + fun `toSatPerVbFloor`(): kotlin.ULong - + companion object } @@ -375,13 +379,13 @@ interface FeeRateInterface { interface Lsps1LiquidityInterface { - + @Throws(NodeException::class) fun `checkOrderStatus`(`orderId`: Lsps1OrderId): Lsps1OrderStatus - + @Throws(NodeException::class) fun `requestChannel`(`lspBalanceSat`: kotlin.ULong, `clientBalanceSat`: kotlin.ULong, `channelExpiryBlocks`: kotlin.UInt, `announceChannel`: kotlin.Boolean): Lsps1OrderStatus - + companion object } @@ -389,9 +393,9 @@ interface Lsps1LiquidityInterface { interface LogWriter { - + fun `log`(`record`: LogRecord) - + companion object } @@ -399,15 +403,15 @@ interface LogWriter { interface NetworkGraphInterface { - + fun `channel`(`shortChannelId`: kotlin.ULong): ChannelInfo? - + fun `listChannels`(): List - + fun `listNodes`(): List - + fun `node`(`nodeId`: NodeId): NodeInfo? - + companion object } @@ -415,128 +419,128 @@ interface NetworkGraphInterface { interface NodeInterface { - + @Throws(NodeException::class) fun `addAddressTypeToMonitor`(`addressType`: AddressType, `seedBytes`: List) - + @Throws(NodeException::class) fun `addAddressTypeToMonitorWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + fun `announcementAddresses`(): List? - + fun `bolt11Payment`(): Bolt11Payment - + fun `bolt12Payment`(): Bolt12Payment - + @Throws(NodeException::class) fun `closeChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey) - + fun `config`(): Config - + @Throws(NodeException::class) fun `connect`(`nodeId`: PublicKey, `address`: SocketAddress, `persist`: kotlin.Boolean) - + fun `currentSyncIntervals`(): RuntimeSyncIntervals - + @Throws(NodeException::class) fun `disconnect`(`nodeId`: PublicKey) - + @Throws(NodeException::class) fun `eventHandled`() - + @Throws(NodeException::class) fun `exportPathfindingScores`(): kotlin.ByteArray - + @Throws(NodeException::class) fun `forceCloseChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `reason`: kotlin.String?) - + @Throws(NodeException::class) fun `getAddressBalance`(`addressStr`: kotlin.String): kotlin.ULong - + @Throws(NodeException::class) fun `getBalanceForAddressType`(`addressType`: AddressType): AddressTypeBalance - + fun `getTransactionDetails`(`txid`: Txid): TransactionDetails? - + fun `listBalances`(): BalanceDetails - + fun `listChannels`(): List - + fun `listMonitoredAddressTypes`(): List - + fun `listPayments`(): List - + fun `listPeers`(): List - + fun `listeningAddresses`(): List? - + fun `lsps1Liquidity`(): Lsps1Liquidity - + fun `networkGraph`(): NetworkGraph - + fun `nextEvent`(): Event? - + suspend fun `nextEventAsync`(): Event - + fun `nodeAlias`(): NodeAlias? - + fun `nodeId`(): PublicKey - + fun `onchainPayment`(): OnchainPayment - + @Throws(NodeException::class) fun `openAnnouncedChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - + @Throws(NodeException::class) fun `openChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - + fun `payment`(`paymentId`: PaymentId): PaymentDetails? - + @Throws(NodeException::class) fun `removeAddressTypeFromMonitor`(`addressType`: AddressType) - + @Throws(NodeException::class) fun `removePayment`(`paymentId`: PaymentId) - + @Throws(NodeException::class) fun `setPrimaryAddressType`(`addressType`: AddressType, `seedBytes`: List) - + @Throws(NodeException::class) fun `setPrimaryAddressTypeWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + fun `signMessage`(`msg`: List): kotlin.String - + @Throws(NodeException::class) fun `spliceIn`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `spliceAmountSats`: kotlin.ULong) - + @Throws(NodeException::class) fun `spliceOut`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `address`: Address, `spliceAmountSats`: kotlin.ULong) - + fun `spontaneousPayment`(): SpontaneousPayment - + @Throws(NodeException::class) fun `start`() - + fun `status`(): NodeStatus - + @Throws(NodeException::class) fun `stop`() - + @Throws(NodeException::class) fun `syncWallets`() - + fun `unifiedQrPayment`(): UnifiedQrPayment - + @Throws(NodeException::class) fun `updateChannelConfig`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `channelConfig`: ChannelConfig) - + @Throws(NodeException::class) fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals) - + fun `verifySignature`(`msg`: List, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean - + fun `waitNextEvent`(): Event - + companion object } @@ -544,31 +548,31 @@ interface NodeInterface { interface OfferInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amount`(): OfferAmount? - + fun `chains`(): List - + fun `expectsQuantity`(): kotlin.Boolean - + fun `id`(): OfferId - + fun `isExpired`(): kotlin.Boolean - + fun `isValidQuantity`(`quantity`: kotlin.ULong): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `issuerSigningPubkey`(): PublicKey? - + fun `metadata`(): List? - + fun `offerDescription`(): kotlin.String? - + fun `supportsChain`(`chain`: Network): kotlin.Boolean - + companion object } @@ -576,55 +580,55 @@ interface OfferInterface { interface OnchainPaymentInterface { - + @Throws(NodeException::class) fun `accelerateByCpfp`(`txid`: Txid, `feeRate`: FeeRate?, `destinationAddress`: Address?): Txid - + @Throws(NodeException::class) fun `addressInfoForTypeAtIndex`(`addressType`: AddressType, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo - + @Throws(NodeException::class) fun `addressInfosForType`(`addressType`: AddressType, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List - + @Throws(NodeException::class) fun `bumpFeeByRbf`(`txid`: Txid, `feeRate`: FeeRate): Txid - + @Throws(NodeException::class) fun `calculateCpfpFeeRate`(`parentTxid`: Txid, `urgent`: kotlin.Boolean): FeeRate - + @Throws(NodeException::class) fun `calculateSendAllFee`(`address`: Address, `retainReserves`: kotlin.Boolean, `feeRate`: FeeRate?): kotlin.ULong - + @Throws(NodeException::class) fun `calculateTotalFee`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): kotlin.ULong - + @Throws(NodeException::class) fun `listSpendableOutputs`(): List - + @Throws(NodeException::class) fun `newAddress`(): Address - + @Throws(NodeException::class) fun `newAddressForType`(`addressType`: AddressType): Address - + @Throws(NodeException::class) fun `newAddressInfo`(): AddressInfo - + @Throws(NodeException::class) fun `newAddressInfoForType`(`addressType`: AddressType): AddressInfo - + @Throws(NodeException::class) fun `revealReceiveAddressesTo`(`addressType`: AddressType, `index`: kotlin.UInt) - + @Throws(NodeException::class) fun `selectUtxosWithAlgorithm`(`targetAmountSats`: kotlin.ULong, `feeRate`: FeeRate?, `algorithm`: CoinSelectionAlgorithm, `utxos`: List?): List - + @Throws(NodeException::class) fun `sendAllToAddress`(`address`: Address, `retainReserve`: kotlin.Boolean, `feeRate`: FeeRate?): Txid - + @Throws(NodeException::class) fun `sendToAddress`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): Txid - + companion object } @@ -632,27 +636,27 @@ interface OnchainPaymentInterface { interface RefundInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amountMsats`(): kotlin.ULong - + fun `chain`(): Network? - + fun `isExpired`(): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `payerMetadata`(): List - + fun `payerNote`(): kotlin.String? - + fun `payerSigningPubkey`(): PublicKey - + fun `quantity`(): kotlin.ULong? - + fun `refundDescription`(): kotlin.String - + companion object } @@ -660,22 +664,22 @@ interface RefundInterface { interface SpontaneousPaymentInterface { - + @Throws(NodeException::class) fun `send`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendProbes`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey): List - + @Throws(NodeException::class) fun `sendWithCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?, `customTlvs`: List): PaymentId - + @Throws(NodeException::class) fun `sendWithPreimage`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendWithPreimageAndCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `customTlvs`: List, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - + companion object } @@ -683,13 +687,13 @@ interface SpontaneousPaymentInterface { interface UnifiedQrPaymentInterface { - + @Throws(NodeException::class) fun `receive`(`amountSats`: kotlin.ULong, `message`: kotlin.String, `expirySec`: kotlin.UInt): kotlin.String - + @Throws(NodeException::class) fun `send`(`uriStr`: kotlin.String, `routeParameters`: RouteParametersConfig?): QrPaymentResult - + companion object } @@ -697,10 +701,10 @@ interface UnifiedQrPaymentInterface { interface VssHeaderProviderInterface { - + @Throws(VssHeaderProviderException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun `getHeaders`(`request`: List): Map - + companion object } @@ -709,8 +713,8 @@ interface VssHeaderProviderInterface { @kotlinx.serialization.Serializable data class AddressInfo ( - val `index`: kotlin.UInt, - val `address`: Address, + val `index`: kotlin.UInt, + val `address`: Address, val `keychain`: KeychainKind ) { companion object @@ -720,7 +724,7 @@ data class AddressInfo ( @kotlinx.serialization.Serializable data class AddressTypeBalance ( - val `totalSats`: kotlin.ULong, + val `totalSats`: kotlin.ULong, val `spendableSats`: kotlin.ULong ) { companion object @@ -730,7 +734,7 @@ data class AddressTypeBalance ( @kotlinx.serialization.Serializable data class AnchorChannelsConfig ( - val `trustedPeersNoReserve`: List, + val `trustedPeersNoReserve`: List, val `perChannelReserveSats`: kotlin.ULong ) { companion object @@ -740,8 +744,8 @@ data class AnchorChannelsConfig ( @kotlinx.serialization.Serializable data class BackgroundSyncConfig ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, + val `onchainWalletSyncIntervalSecs`: kotlin.ULong, + val `lightningWalletSyncIntervalSecs`: kotlin.ULong, val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong ) { companion object @@ -751,11 +755,11 @@ data class BackgroundSyncConfig ( @kotlinx.serialization.Serializable data class BalanceDetails ( - val `totalOnchainBalanceSats`: kotlin.ULong, - val `spendableOnchainBalanceSats`: kotlin.ULong, - val `totalAnchorChannelsReserveSats`: kotlin.ULong, - val `totalLightningBalanceSats`: kotlin.ULong, - val `lightningBalances`: List, + val `totalOnchainBalanceSats`: kotlin.ULong, + val `spendableOnchainBalanceSats`: kotlin.ULong, + val `totalAnchorChannelsReserveSats`: kotlin.ULong, + val `totalLightningBalanceSats`: kotlin.ULong, + val `lightningBalances`: List, val `pendingBalancesFromChannelClosures`: List ) { companion object @@ -765,7 +769,7 @@ data class BalanceDetails ( @kotlinx.serialization.Serializable data class BestBlock ( - val `blockHash`: BlockHash, + val `blockHash`: BlockHash, val `height`: kotlin.UInt ) { companion object @@ -775,11 +779,11 @@ data class BestBlock ( @kotlinx.serialization.Serializable data class ChannelConfig ( - val `forwardingFeeProportionalMillionths`: kotlin.UInt, - val `forwardingFeeBaseMsat`: kotlin.UInt, - val `cltvExpiryDelta`: kotlin.UShort, - val `maxDustHtlcExposure`: MaxDustHtlcExposure, - val `forceCloseAvoidanceMaxFeeSatoshis`: kotlin.ULong, + val `forwardingFeeProportionalMillionths`: kotlin.UInt, + val `forwardingFeeBaseMsat`: kotlin.UInt, + val `cltvExpiryDelta`: kotlin.UShort, + val `maxDustHtlcExposure`: MaxDustHtlcExposure, + val `forceCloseAvoidanceMaxFeeSatoshis`: kotlin.ULong, val `acceptUnderpayingHtlcs`: kotlin.Boolean ) { companion object @@ -789,7 +793,7 @@ data class ChannelConfig ( @kotlinx.serialization.Serializable data class ChannelDataMigration ( - val `channelManager`: List?, + val `channelManager`: List?, val `channelMonitors`: List> ) { companion object @@ -799,37 +803,37 @@ data class ChannelDataMigration ( @kotlinx.serialization.Serializable data class ChannelDetails ( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `fundingTxo`: OutPoint?, - val `shortChannelId`: kotlin.ULong?, - val `outboundScidAlias`: kotlin.ULong?, - val `inboundScidAlias`: kotlin.ULong?, - val `channelValueSats`: kotlin.ULong, - val `unspendablePunishmentReserve`: kotlin.ULong?, - val `userChannelId`: UserChannelId, - val `feerateSatPer1000Weight`: kotlin.UInt, - val `outboundCapacityMsat`: kotlin.ULong, - val `inboundCapacityMsat`: kotlin.ULong, - val `confirmationsRequired`: kotlin.UInt?, - val `confirmations`: kotlin.UInt?, - val `isOutbound`: kotlin.Boolean, - val `isChannelReady`: kotlin.Boolean, - val `isUsable`: kotlin.Boolean, - val `isAnnounced`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort?, - val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, - val `counterpartyOutboundHtlcMinimumMsat`: kotlin.ULong?, - val `counterpartyOutboundHtlcMaximumMsat`: kotlin.ULong?, - val `counterpartyForwardingInfoFeeBaseMsat`: kotlin.UInt?, - val `counterpartyForwardingInfoFeeProportionalMillionths`: kotlin.UInt?, - val `counterpartyForwardingInfoCltvExpiryDelta`: kotlin.UShort?, - val `nextOutboundHtlcLimitMsat`: kotlin.ULong, - val `nextOutboundHtlcMinimumMsat`: kotlin.ULong, - val `forceCloseSpendDelay`: kotlin.UShort?, - val `inboundHtlcMinimumMsat`: kotlin.ULong, - val `inboundHtlcMaximumMsat`: kotlin.ULong?, - val `config`: ChannelConfig, + val `channelId`: ChannelId, + val `counterpartyNodeId`: PublicKey, + val `fundingTxo`: OutPoint?, + val `shortChannelId`: kotlin.ULong?, + val `outboundScidAlias`: kotlin.ULong?, + val `inboundScidAlias`: kotlin.ULong?, + val `channelValueSats`: kotlin.ULong, + val `unspendablePunishmentReserve`: kotlin.ULong?, + val `userChannelId`: UserChannelId, + val `feerateSatPer1000Weight`: kotlin.UInt, + val `outboundCapacityMsat`: kotlin.ULong, + val `inboundCapacityMsat`: kotlin.ULong, + val `confirmationsRequired`: kotlin.UInt?, + val `confirmations`: kotlin.UInt?, + val `isOutbound`: kotlin.Boolean, + val `isChannelReady`: kotlin.Boolean, + val `isUsable`: kotlin.Boolean, + val `isAnnounced`: kotlin.Boolean, + val `cltvExpiryDelta`: kotlin.UShort?, + val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, + val `counterpartyOutboundHtlcMinimumMsat`: kotlin.ULong?, + val `counterpartyOutboundHtlcMaximumMsat`: kotlin.ULong?, + val `counterpartyForwardingInfoFeeBaseMsat`: kotlin.UInt?, + val `counterpartyForwardingInfoFeeProportionalMillionths`: kotlin.UInt?, + val `counterpartyForwardingInfoCltvExpiryDelta`: kotlin.UShort?, + val `nextOutboundHtlcLimitMsat`: kotlin.ULong, + val `nextOutboundHtlcMinimumMsat`: kotlin.ULong, + val `forceCloseSpendDelay`: kotlin.UShort?, + val `inboundHtlcMinimumMsat`: kotlin.ULong, + val `inboundHtlcMaximumMsat`: kotlin.ULong?, + val `config`: ChannelConfig, val `claimableOnCloseSats`: kotlin.ULong? ) { companion object @@ -839,10 +843,10 @@ data class ChannelDetails ( @kotlinx.serialization.Serializable data class ChannelInfo ( - val `nodeOne`: NodeId, - val `oneToTwo`: ChannelUpdateInfo?, - val `nodeTwo`: NodeId, - val `twoToOne`: ChannelUpdateInfo?, + val `nodeOne`: NodeId, + val `oneToTwo`: ChannelUpdateInfo?, + val `nodeTwo`: NodeId, + val `twoToOne`: ChannelUpdateInfo?, val `capacitySats`: kotlin.ULong? ) { companion object @@ -852,11 +856,11 @@ data class ChannelInfo ( @kotlinx.serialization.Serializable data class ChannelUpdateInfo ( - val `lastUpdate`: kotlin.UInt, - val `enabled`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong, - val `htlcMaximumMsat`: kotlin.ULong, + val `lastUpdate`: kotlin.UInt, + val `enabled`: kotlin.Boolean, + val `cltvExpiryDelta`: kotlin.UShort, + val `htlcMinimumMsat`: kotlin.ULong, + val `htlcMaximumMsat`: kotlin.ULong, val `fees`: RoutingFees ) { companion object @@ -866,17 +870,19 @@ data class ChannelUpdateInfo ( @kotlinx.serialization.Serializable data class Config ( - val `storageDirPath`: kotlin.String, - val `network`: Network, - val `listeningAddresses`: List?, - val `announcementAddresses`: List?, - val `nodeAlias`: NodeAlias?, - val `trustedPeers0conf`: List, - val `probingLiquidityLimitMultiplier`: kotlin.ULong, - val `anchorChannelsConfig`: AnchorChannelsConfig?, - val `routeParameters`: RouteParametersConfig?, - val `includeUntrustedPendingInSpendable`: kotlin.Boolean, - val `addressType`: AddressType, + val `storageDirPath`: kotlin.String, + val `network`: Network, + val `listeningAddresses`: List?, + val `announcementAddresses`: List?, + val `nodeAlias`: NodeAlias?, + val `trustedPeers0conf`: List, + val `probingLiquidityLimitMultiplier`: kotlin.ULong, + val `anchorChannelsConfig`: AnchorChannelsConfig?, + val `routeParameters`: RouteParametersConfig?, + val `scoringFeeParams`: ScoringFeeParameters?, + val `scoringDecayParams`: ScoringDecayParameters?, + val `includeUntrustedPendingInSpendable`: kotlin.Boolean, + val `addressType`: AddressType, val `addressTypesToMonitor`: List ) { companion object @@ -886,7 +892,7 @@ data class Config ( @kotlinx.serialization.Serializable data class CustomTlvRecord ( - val `typeNum`: kotlin.ULong, + val `typeNum`: kotlin.ULong, val `value`: List ) { companion object @@ -896,7 +902,7 @@ data class CustomTlvRecord ( @kotlinx.serialization.Serializable data class ElectrumSyncConfig ( - val `backgroundSyncConfig`: BackgroundSyncConfig?, + val `backgroundSyncConfig`: BackgroundSyncConfig?, val `connectionTimeoutSecs`: kotlin.ULong ) { companion object @@ -915,7 +921,7 @@ data class EsploraSyncConfig ( @kotlinx.serialization.Serializable data class LspFeeLimits ( - val `maxTotalOpeningFeeMsat`: kotlin.ULong?, + val `maxTotalOpeningFeeMsat`: kotlin.ULong?, val `maxProportionalOpeningFeePpmMsat`: kotlin.ULong? ) { companion object @@ -925,10 +931,10 @@ data class LspFeeLimits ( data class Lsps1Bolt11PaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, + val `state`: Lsps1PaymentState, + val `expiresAt`: LspsDateTime, + val `feeTotalSat`: kotlin.ULong, + val `orderTotalSat`: kotlin.ULong, val `invoice`: Bolt11Invoice ) : Disposable { override fun destroy() { @@ -947,8 +953,8 @@ data class Lsps1Bolt11PaymentInfo ( @kotlinx.serialization.Serializable data class Lsps1ChannelInfo ( - val `fundedAt`: LspsDateTime, - val `fundingOutpoint`: OutPoint, + val `fundedAt`: LspsDateTime, + val `fundingOutpoint`: OutPoint, val `expiresAt`: LspsDateTime ) { companion object @@ -958,13 +964,13 @@ data class Lsps1ChannelInfo ( data class Lsps1OnchainPaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, - val `address`: Address, - val `minOnchainPaymentConfirmations`: kotlin.UShort?, - val `minFeeFor0conf`: FeeRate, + val `state`: Lsps1PaymentState, + val `expiresAt`: LspsDateTime, + val `feeTotalSat`: kotlin.ULong, + val `orderTotalSat`: kotlin.ULong, + val `address`: Address, + val `minOnchainPaymentConfirmations`: kotlin.UShort?, + val `minFeeFor0conf`: FeeRate, val `refundOnchainAddress`: Address? ) : Disposable { override fun destroy() { @@ -986,12 +992,12 @@ data class Lsps1OnchainPaymentInfo ( @kotlinx.serialization.Serializable data class Lsps1OrderParams ( - val `lspBalanceSat`: kotlin.ULong, - val `clientBalanceSat`: kotlin.ULong, - val `requiredChannelConfirmations`: kotlin.UShort, - val `fundingConfirmsWithinBlocks`: kotlin.UShort, - val `channelExpiryBlocks`: kotlin.UInt, - val `token`: kotlin.String?, + val `lspBalanceSat`: kotlin.ULong, + val `clientBalanceSat`: kotlin.ULong, + val `requiredChannelConfirmations`: kotlin.UShort, + val `fundingConfirmsWithinBlocks`: kotlin.UShort, + val `channelExpiryBlocks`: kotlin.UInt, + val `token`: kotlin.String?, val `announceChannel`: kotlin.Boolean ) { companion object @@ -1001,9 +1007,9 @@ data class Lsps1OrderParams ( data class Lsps1OrderStatus ( - val `orderId`: Lsps1OrderId, - val `orderParams`: Lsps1OrderParams, - val `paymentOptions`: Lsps1PaymentInfo, + val `orderId`: Lsps1OrderId, + val `orderParams`: Lsps1OrderParams, + val `paymentOptions`: Lsps1PaymentInfo, val `channelState`: Lsps1ChannelInfo? ) : Disposable { override fun destroy() { @@ -1021,7 +1027,7 @@ data class Lsps1OrderStatus ( data class Lsps1PaymentInfo ( - val `bolt11`: Lsps1Bolt11PaymentInfo?, + val `bolt11`: Lsps1Bolt11PaymentInfo?, val `onchain`: Lsps1OnchainPaymentInfo? ) : Disposable { override fun destroy() { @@ -1037,15 +1043,15 @@ data class Lsps1PaymentInfo ( @kotlinx.serialization.Serializable data class Lsps2ServiceConfig ( - val `requireToken`: kotlin.String?, - val `advertiseService`: kotlin.Boolean, - val `channelOpeningFeePpm`: kotlin.UInt, - val `channelOverProvisioningPpm`: kotlin.UInt, - val `minChannelOpeningFeeMsat`: kotlin.ULong, - val `minChannelLifetime`: kotlin.UInt, - val `maxClientToSelfDelay`: kotlin.UInt, - val `minPaymentSizeMsat`: kotlin.ULong, - val `maxPaymentSizeMsat`: kotlin.ULong, + val `requireToken`: kotlin.String?, + val `advertiseService`: kotlin.Boolean, + val `channelOpeningFeePpm`: kotlin.UInt, + val `channelOverProvisioningPpm`: kotlin.UInt, + val `minChannelOpeningFeeMsat`: kotlin.ULong, + val `minChannelLifetime`: kotlin.UInt, + val `maxClientToSelfDelay`: kotlin.UInt, + val `minPaymentSizeMsat`: kotlin.ULong, + val `maxPaymentSizeMsat`: kotlin.ULong, val `clientTrustsLsp`: kotlin.Boolean ) { companion object @@ -1055,9 +1061,9 @@ data class Lsps2ServiceConfig ( @kotlinx.serialization.Serializable data class LogRecord ( - val `level`: LogLevel, - val `args`: kotlin.String, - val `modulePath`: kotlin.String, + val `level`: LogLevel, + val `args`: kotlin.String, + val `modulePath`: kotlin.String, val `line`: kotlin.UInt ) { companion object @@ -1067,8 +1073,8 @@ data class LogRecord ( @kotlinx.serialization.Serializable data class NodeAnnouncementInfo ( - val `lastUpdate`: kotlin.UInt, - val `alias`: kotlin.String, + val `lastUpdate`: kotlin.UInt, + val `alias`: kotlin.String, val `addresses`: List ) { companion object @@ -1078,7 +1084,7 @@ data class NodeAnnouncementInfo ( @kotlinx.serialization.Serializable data class NodeInfo ( - val `channels`: List, + val `channels`: List, val `announcementInfo`: NodeAnnouncementInfo? ) { companion object @@ -1088,14 +1094,14 @@ data class NodeInfo ( @kotlinx.serialization.Serializable data class NodeStatus ( - val `isRunning`: kotlin.Boolean, - val `currentBestBlock`: BestBlock, - val `latestLightningWalletSyncTimestamp`: kotlin.ULong?, - val `latestOnchainWalletSyncTimestamp`: kotlin.ULong?, - val `latestFeeRateCacheUpdateTimestamp`: kotlin.ULong?, - val `latestRgsSnapshotTimestamp`: kotlin.ULong?, - val `latestPathfindingScoresSyncTimestamp`: kotlin.ULong?, - val `latestNodeAnnouncementBroadcastTimestamp`: kotlin.ULong?, + val `isRunning`: kotlin.Boolean, + val `currentBestBlock`: BestBlock, + val `latestLightningWalletSyncTimestamp`: kotlin.ULong?, + val `latestOnchainWalletSyncTimestamp`: kotlin.ULong?, + val `latestFeeRateCacheUpdateTimestamp`: kotlin.ULong?, + val `latestRgsSnapshotTimestamp`: kotlin.ULong?, + val `latestPathfindingScoresSyncTimestamp`: kotlin.ULong?, + val `latestNodeAnnouncementBroadcastTimestamp`: kotlin.ULong?, val `latestChannelMonitorArchivalHeight`: kotlin.UInt? ) { companion object @@ -1105,7 +1111,7 @@ data class NodeStatus ( @kotlinx.serialization.Serializable data class OutPoint ( - val `txid`: Txid, + val `txid`: Txid, val `vout`: kotlin.UInt ) { companion object @@ -1115,12 +1121,12 @@ data class OutPoint ( @kotlinx.serialization.Serializable data class PaymentDetails ( - val `id`: PaymentId, - val `kind`: PaymentKind, - val `amountMsat`: kotlin.ULong?, - val `feePaidMsat`: kotlin.ULong?, - val `direction`: PaymentDirection, - val `status`: PaymentStatus, + val `id`: PaymentId, + val `kind`: PaymentKind, + val `amountMsat`: kotlin.ULong?, + val `feePaidMsat`: kotlin.ULong?, + val `direction`: PaymentDirection, + val `status`: PaymentStatus, val `latestUpdateTimestamp`: kotlin.ULong ) { companion object @@ -1130,9 +1136,9 @@ data class PaymentDetails ( @kotlinx.serialization.Serializable data class PeerDetails ( - val `nodeId`: PublicKey, - val `address`: SocketAddress, - val `isPersisted`: kotlin.Boolean, + val `nodeId`: PublicKey, + val `address`: SocketAddress, + val `isPersisted`: kotlin.Boolean, val `isConnected`: kotlin.Boolean ) { companion object @@ -1142,7 +1148,7 @@ data class PeerDetails ( @kotlinx.serialization.Serializable data class ProbeHandle ( - val `paymentHash`: PaymentHash, + val `paymentHash`: PaymentHash, val `paymentId`: PaymentId ) { companion object @@ -1152,11 +1158,11 @@ data class ProbeHandle ( @kotlinx.serialization.Serializable data class RouteHintHop ( - val `srcNodeId`: PublicKey, - val `shortChannelId`: kotlin.ULong, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong?, - val `htlcMaximumMsat`: kotlin.ULong?, + val `srcNodeId`: PublicKey, + val `shortChannelId`: kotlin.ULong, + val `cltvExpiryDelta`: kotlin.UShort, + val `htlcMinimumMsat`: kotlin.ULong?, + val `htlcMaximumMsat`: kotlin.ULong?, val `fees`: RoutingFees ) { companion object @@ -1166,9 +1172,9 @@ data class RouteHintHop ( @kotlinx.serialization.Serializable data class RouteParametersConfig ( - val `maxTotalRoutingFeeMsat`: kotlin.ULong?, - val `maxTotalCltvExpiryDelta`: kotlin.UInt, - val `maxPathCount`: kotlin.UByte, + val `maxTotalRoutingFeeMsat`: kotlin.ULong?, + val `maxTotalCltvExpiryDelta`: kotlin.UInt, + val `maxPathCount`: kotlin.UByte, val `maxChannelSaturationPowerOfHalf`: kotlin.UByte ) { companion object @@ -1178,7 +1184,7 @@ data class RouteParametersConfig ( @kotlinx.serialization.Serializable data class RoutingFees ( - val `baseMsat`: kotlin.UInt, + val `baseMsat`: kotlin.UInt, val `proportionalMillionths`: kotlin.UInt ) { companion object @@ -1188,8 +1194,8 @@ data class RoutingFees ( @kotlinx.serialization.Serializable data class RuntimeSyncIntervals ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, + val `onchainWalletSyncIntervalSecs`: kotlin.ULong, + val `lightningWalletSyncIntervalSecs`: kotlin.ULong, val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong ) { companion object @@ -1197,9 +1203,37 @@ data class RuntimeSyncIntervals ( +@kotlinx.serialization.Serializable +data class ScoringDecayParameters ( + val `historicalNoUpdatesHalfLifeSecs`: kotlin.ULong, + val `liquidityOffsetHalfLifeSecs`: kotlin.ULong +) { + companion object +} + + + +@kotlinx.serialization.Serializable +data class ScoringFeeParameters ( + val `basePenaltyMsat`: kotlin.ULong, + val `basePenaltyAmountMultiplierMsat`: kotlin.ULong, + val `liquidityPenaltyMultiplierMsat`: kotlin.ULong, + val `liquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, + val `historicalLiquidityPenaltyMultiplierMsat`: kotlin.ULong, + val `historicalLiquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, + val `antiProbingPenaltyMsat`: kotlin.ULong, + val `consideredImpossiblePenaltyMsat`: kotlin.ULong, + val `linearSuccessProbability`: kotlin.Boolean, + val `probingDiversityPenaltyMsat`: kotlin.ULong +) { + companion object +} + + + @kotlinx.serialization.Serializable data class SpendableUtxo ( - val `outpoint`: OutPoint, + val `outpoint`: OutPoint, val `valueSats`: kotlin.ULong ) { companion object @@ -1209,8 +1243,8 @@ data class SpendableUtxo ( @kotlinx.serialization.Serializable data class TransactionDetails ( - val `amountSats`: kotlin.Long, - val `inputs`: List, + val `amountSats`: kotlin.Long, + val `inputs`: List, val `outputs`: List ) { companion object @@ -1220,10 +1254,10 @@ data class TransactionDetails ( @kotlinx.serialization.Serializable data class TxInput ( - val `txid`: Txid, - val `vout`: kotlin.UInt, - val `scriptsig`: kotlin.String, - val `witness`: List, + val `txid`: Txid, + val `vout`: kotlin.UInt, + val `scriptsig`: kotlin.String, + val `witness`: List, val `sequence`: kotlin.UInt ) { companion object @@ -1233,10 +1267,10 @@ data class TxInput ( @kotlinx.serialization.Serializable data class TxOutput ( - val `scriptpubkey`: kotlin.String, - val `scriptpubkeyType`: kotlin.String?, - val `scriptpubkeyAddress`: kotlin.String?, - val `value`: kotlin.Long, + val `scriptpubkey`: kotlin.String, + val `scriptpubkeyType`: kotlin.String?, + val `scriptpubkeyAddress`: kotlin.String?, + val `value`: kotlin.Long, val `n`: kotlin.UInt ) { companion object @@ -1248,7 +1282,7 @@ data class TxOutput ( @kotlinx.serialization.Serializable enum class AddressType { - + LEGACY, NESTED_SEGWIT, NATIVE_SEGWIT, @@ -1264,7 +1298,7 @@ enum class AddressType { @kotlinx.serialization.Serializable enum class AsyncPaymentsRole { - + CLIENT, SERVER; companion object @@ -1278,7 +1312,7 @@ enum class AsyncPaymentsRole { @kotlinx.serialization.Serializable enum class BalanceSource { - + HOLDER_FORCE_CLOSED, COUNTERPARTY_FORCE_CLOSED, COOP_CLOSE, @@ -1303,7 +1337,7 @@ sealed class Bolt11InvoiceDescription { val `description`: kotlin.String, ) : Bolt11InvoiceDescription() { } - + } @@ -1313,41 +1347,41 @@ sealed class Bolt11InvoiceDescription { sealed class BuildException(message: String): kotlin.Exception(message) { - + class InvalidSeedBytes(message: String) : BuildException(message) - + class InvalidSeedFile(message: String) : BuildException(message) - + class InvalidSystemTime(message: String) : BuildException(message) - + class InvalidChannelMonitor(message: String) : BuildException(message) - + class InvalidListeningAddresses(message: String) : BuildException(message) - + class InvalidAnnouncementAddresses(message: String) : BuildException(message) - + class InvalidNodeAlias(message: String) : BuildException(message) - + class RuntimeSetupFailed(message: String) : BuildException(message) - + class ReadFailed(message: String) : BuildException(message) - + class DangerousValue(message: String) : BuildException(message) - + class WriteFailed(message: String) : BuildException(message) - + class StoragePathAccessFailed(message: String) : BuildException(message) - + class KvStoreSetupFailed(message: String) : BuildException(message) - + class WalletSetupFailed(message: String) : BuildException(message) - + class LoggerSetupFailed(message: String) : BuildException(message) - + class NetworkMismatch(message: String) : BuildException(message) - + class AsyncPaymentsConfigMismatch(message: String) : BuildException(message) - + } @@ -1366,51 +1400,51 @@ sealed class ClosureReason { val `message`: kotlin.String, ) : ClosureReason() { } - + @kotlinx.serialization.Serializable - data object LegacyCooperativeClosure : ClosureReason() - - + data object LegacyCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object CounterpartyInitiatedCooperativeClosure : ClosureReason() - - + data object CounterpartyInitiatedCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object LocallyInitiatedCooperativeClosure : ClosureReason() - - + data object LocallyInitiatedCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object CommitmentTxConfirmed : ClosureReason() - - + data object CommitmentTxConfirmed : ClosureReason() + + @kotlinx.serialization.Serializable - data object FundingTimedOut : ClosureReason() - + data object FundingTimedOut : ClosureReason() + @kotlinx.serialization.Serializable data class ProcessingError( val `err`: kotlin.String, ) : ClosureReason() { } - + @kotlinx.serialization.Serializable - data object DisconnectedPeer : ClosureReason() - - + data object DisconnectedPeer : ClosureReason() + + @kotlinx.serialization.Serializable - data object OutdatedChannelManager : ClosureReason() - - + data object OutdatedChannelManager : ClosureReason() + + @kotlinx.serialization.Serializable - data object CounterpartyCoopClosedUnfundedChannel : ClosureReason() - - + data object CounterpartyCoopClosedUnfundedChannel : ClosureReason() + + @kotlinx.serialization.Serializable - data object LocallyCoopClosedUnfundedChannel : ClosureReason() - - + data object LocallyCoopClosedUnfundedChannel : ClosureReason() + + @kotlinx.serialization.Serializable - data object FundingBatchClosure : ClosureReason() - + data object FundingBatchClosure : ClosureReason() + @kotlinx.serialization.Serializable data class HtlCsTimedOut( val `paymentHash`: PaymentHash?, @@ -1422,7 +1456,7 @@ sealed class ClosureReason { val `requiredFeerateSatPerKw`: kotlin.UInt, ) : ClosureReason() { } - + } @@ -1433,7 +1467,7 @@ sealed class ClosureReason { @kotlinx.serialization.Serializable enum class CoinSelectionAlgorithm { - + BRANCH_AND_BOUND, LARGEST_FIRST, OLDEST_FIRST, @@ -1455,11 +1489,11 @@ sealed class ConfirmationStatus { val `timestamp`: kotlin.ULong, ) : ConfirmationStatus() { } - + @kotlinx.serialization.Serializable - data object Unconfirmed : ConfirmationStatus() - - + data object Unconfirmed : ConfirmationStatus() + + } @@ -1470,7 +1504,7 @@ sealed class ConfirmationStatus { @kotlinx.serialization.Serializable enum class Currency { - + BITCOIN, BITCOIN_TESTNET, REGTEST, @@ -1641,7 +1675,7 @@ sealed class Event { val `newTotalLightningBalanceSats`: kotlin.ULong, ) : Event() { } - + } @@ -1652,7 +1686,7 @@ sealed class Event { @kotlinx.serialization.Serializable enum class KeychainKind { - + EXTERNAL, INTERNAL; companion object @@ -1666,7 +1700,7 @@ enum class KeychainKind { @kotlinx.serialization.Serializable enum class Lsps1PaymentState { - + EXPECT_PAYMENT, PAID, REFUNDED; @@ -1737,7 +1771,7 @@ sealed class LightningBalance { val `amountSatoshis`: kotlin.ULong, ) : LightningBalance() { } - + } @@ -1748,7 +1782,7 @@ sealed class LightningBalance { @kotlinx.serialization.Serializable enum class LogLevel { - + GOSSIP, TRACE, DEBUG, @@ -1775,7 +1809,7 @@ sealed class MaxDustHtlcExposure { val `multiplier`: kotlin.ULong, ) : MaxDustHtlcExposure() { } - + } @@ -1786,7 +1820,7 @@ sealed class MaxDustHtlcExposure { @kotlinx.serialization.Serializable enum class Network { - + BITCOIN, TESTNET, SIGNET, @@ -1801,141 +1835,141 @@ enum class Network { sealed class NodeException(message: String): kotlin.Exception(message) { - + class AlreadyRunning(message: String) : NodeException(message) - + class NotRunning(message: String) : NodeException(message) - + class OnchainTxCreationFailed(message: String) : NodeException(message) - + class ConnectionFailed(message: String) : NodeException(message) - + class InvoiceCreationFailed(message: String) : NodeException(message) - + class InvoiceRequestCreationFailed(message: String) : NodeException(message) - + class OfferCreationFailed(message: String) : NodeException(message) - + class RefundCreationFailed(message: String) : NodeException(message) - + class PaymentSendingFailed(message: String) : NodeException(message) - + class InvalidCustomTlvs(message: String) : NodeException(message) - + class ProbeSendingFailed(message: String) : NodeException(message) - + class RouteNotFound(message: String) : NodeException(message) - + class ChannelCreationFailed(message: String) : NodeException(message) - + class ChannelClosingFailed(message: String) : NodeException(message) - + class ChannelSplicingFailed(message: String) : NodeException(message) - + class ChannelConfigUpdateFailed(message: String) : NodeException(message) - + class PersistenceFailed(message: String) : NodeException(message) - + class FeerateEstimationUpdateFailed(message: String) : NodeException(message) - + class FeerateEstimationUpdateTimeout(message: String) : NodeException(message) - + class WalletOperationFailed(message: String) : NodeException(message) - + class WalletOperationTimeout(message: String) : NodeException(message) - + class OnchainTxSigningFailed(message: String) : NodeException(message) - + class TxSyncFailed(message: String) : NodeException(message) - + class TxSyncTimeout(message: String) : NodeException(message) - + class GossipUpdateFailed(message: String) : NodeException(message) - + class GossipUpdateTimeout(message: String) : NodeException(message) - + class LiquidityRequestFailed(message: String) : NodeException(message) - + class UriParameterParsingFailed(message: String) : NodeException(message) - + class InvalidAddress(message: String) : NodeException(message) - + class InvalidSocketAddress(message: String) : NodeException(message) - + class InvalidPublicKey(message: String) : NodeException(message) - + class InvalidSecretKey(message: String) : NodeException(message) - + class InvalidOfferId(message: String) : NodeException(message) - + class InvalidNodeId(message: String) : NodeException(message) - + class InvalidPaymentId(message: String) : NodeException(message) - + class InvalidPaymentHash(message: String) : NodeException(message) - + class InvalidPaymentPreimage(message: String) : NodeException(message) - + class InvalidPaymentSecret(message: String) : NodeException(message) - + class InvalidAmount(message: String) : NodeException(message) - + class InvalidInvoice(message: String) : NodeException(message) - + class InvalidOffer(message: String) : NodeException(message) - + class InvalidRefund(message: String) : NodeException(message) - + class InvalidChannelId(message: String) : NodeException(message) - + class InvalidNetwork(message: String) : NodeException(message) - + class InvalidUri(message: String) : NodeException(message) - + class InvalidQuantity(message: String) : NodeException(message) - + class InvalidNodeAlias(message: String) : NodeException(message) - + class InvalidDateTime(message: String) : NodeException(message) - + class InvalidFeeRate(message: String) : NodeException(message) - + class DuplicatePayment(message: String) : NodeException(message) - + class UnsupportedCurrency(message: String) : NodeException(message) - + class InsufficientFunds(message: String) : NodeException(message) - + class LiquiditySourceUnavailable(message: String) : NodeException(message) - + class LiquidityFeeTooHigh(message: String) : NodeException(message) - + class InvalidBlindedPaths(message: String) : NodeException(message) - + class AsyncPaymentServicesDisabled(message: String) : NodeException(message) - + class CannotRbfFundingTransaction(message: String) : NodeException(message) - + class TransactionNotFound(message: String) : NodeException(message) - + class TransactionAlreadyConfirmed(message: String) : NodeException(message) - + class NoSpendableOutputs(message: String) : NodeException(message) - + class CoinSelectionFailed(message: String) : NodeException(message) - + class InvalidMnemonic(message: String) : NodeException(message) - + class BackgroundSyncNotEnabled(message: String) : NodeException(message) - + class AddressTypeAlreadyMonitored(message: String) : NodeException(message) - + class AddressTypeIsPrimary(message: String) : NodeException(message) - + class AddressTypeNotMonitored(message: String) : NodeException(message) - + class InvalidSeedBytes(message: String) : NodeException(message) - + } @@ -1954,7 +1988,7 @@ sealed class OfferAmount { val `amount`: kotlin.ULong, ) : OfferAmount() { } - + } @@ -1965,7 +1999,7 @@ sealed class OfferAmount { @kotlinx.serialization.Serializable enum class PaymentDirection { - + INBOUND, OUTBOUND; companion object @@ -1979,7 +2013,7 @@ enum class PaymentDirection { @kotlinx.serialization.Serializable enum class PaymentFailureReason { - + RECIPIENT_REJECTED, USER_ABANDONED, RETRIES_EXHAUSTED, @@ -2051,7 +2085,7 @@ sealed class PaymentKind { val `preimage`: PaymentPreimage?, ) : PaymentKind() { } - + } @@ -2062,7 +2096,7 @@ sealed class PaymentKind { @kotlinx.serialization.Serializable enum class PaymentStatus { - + PENDING, SUCCEEDED, FAILED; @@ -2099,7 +2133,7 @@ sealed class PendingSweepBalance { val `amountSatoshis`: kotlin.ULong, ) : PendingSweepBalance() { } - + } @@ -2124,7 +2158,7 @@ sealed class QrPaymentResult { val `paymentId`: PaymentId, ) : QrPaymentResult() { } - + } @@ -2135,7 +2169,7 @@ sealed class QrPaymentResult { @kotlinx.serialization.Serializable enum class SyncType { - + ONCHAIN_WALLET, LIGHTNING_WALLET, FEE_RATE_CACHE; @@ -2149,15 +2183,15 @@ enum class SyncType { sealed class VssHeaderProviderException(message: String): kotlin.Exception(message) { - + class InvalidData(message: String) : VssHeaderProviderException(message) - + class RequestException(message: String) : VssHeaderProviderException(message) - + class AuthorizationException(message: String) : VssHeaderProviderException(message) - + class InternalException(message: String) : VssHeaderProviderException(message) - + } @@ -2166,7 +2200,7 @@ sealed class VssHeaderProviderException(message: String): kotlin.Exception(messa @kotlinx.serialization.Serializable enum class WordCount { - + WORDS12, WORDS15, WORDS18, @@ -2312,6 +2346,10 @@ enum class WordCount { + + + + diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt index 21e71fdd6..a6bf869af 100644 --- a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt +++ b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.common.kt @@ -104,39 +104,39 @@ object NoPointer interface Bolt11InvoiceInterface { - + fun `amountMilliSatoshis`(): kotlin.ULong? - + fun `currency`(): Currency - + fun `expiryTimeSeconds`(): kotlin.ULong - + fun `fallbackAddresses`(): List
- + fun `invoiceDescription`(): Bolt11InvoiceDescription - + fun `isExpired`(): kotlin.Boolean - + fun `minFinalCltvExpiryDelta`(): kotlin.ULong - + fun `network`(): Network - + fun `paymentHash`(): PaymentHash - + fun `paymentSecret`(): PaymentSecret - + fun `recoverPayeePubKey`(): PublicKey - + fun `routeHints`(): List> - + fun `secondsSinceEpoch`(): kotlin.ULong - + fun `secondsUntilExpiry`(): kotlin.ULong - + fun `signableHash`(): List - + fun `wouldExpire`(`atTimeSeconds`: kotlin.ULong): kotlin.Boolean - + companion object } @@ -144,55 +144,55 @@ interface Bolt11InvoiceInterface { interface Bolt11PaymentInterface { - + @Throws(NodeException::class) fun `claimForHash`(`paymentHash`: PaymentHash, `claimableAmountMsat`: kotlin.ULong, `preimage`: PaymentPreimage) - + @Throws(NodeException::class) fun `estimateRoutingFees`(`invoice`: Bolt11Invoice): kotlin.ULong - + @Throws(NodeException::class) fun `estimateRoutingFeesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong): kotlin.ULong - + @Throws(NodeException::class) fun `failForHash`(`paymentHash`: PaymentHash) - + @Throws(NodeException::class) fun `receive`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmount`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountViaJitChannel`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveVariableAmountViaJitChannelForHash`(`description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxProportionalLspFeeLimitPpmMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveViaJitChannel`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?): Bolt11Invoice - + @Throws(NodeException::class) fun `receiveViaJitChannelForHash`(`amountMsat`: kotlin.ULong, `description`: Bolt11InvoiceDescription, `expirySecs`: kotlin.UInt, `maxLspFeeLimitMsat`: kotlin.ULong?, `paymentHash`: PaymentHash): Bolt11Invoice - + @Throws(NodeException::class) fun `send`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendProbes`(`invoice`: Bolt11Invoice, `routeParameters`: RouteParametersConfig?): List - + @Throws(NodeException::class) fun `sendProbesUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): List - + @Throws(NodeException::class) fun `sendUsingAmount`(`invoice`: Bolt11Invoice, `amountMsat`: kotlin.ULong, `routeParameters`: RouteParametersConfig?): PaymentId - + companion object } @@ -200,47 +200,47 @@ interface Bolt11PaymentInterface { interface Bolt12InvoiceInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amount`(): OfferAmount? - + fun `amountMsats`(): kotlin.ULong - + fun `chain`(): List - + fun `createdAt`(): kotlin.ULong - + fun `encode`(): List - + fun `fallbackAddresses`(): List
- + fun `invoiceDescription`(): kotlin.String? - + fun `isExpired`(): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `issuerSigningPubkey`(): PublicKey? - + fun `metadata`(): List? - + fun `offerChains`(): List>? - + fun `payerNote`(): kotlin.String? - + fun `payerSigningPubkey`(): PublicKey - + fun `paymentHash`(): PaymentHash - + fun `quantity`(): kotlin.ULong? - + fun `relativeExpiry`(): kotlin.ULong - + fun `signableHash`(): List - + fun `signingPubkey`(): PublicKey - + companion object } @@ -248,34 +248,34 @@ interface Bolt12InvoiceInterface { interface Bolt12PaymentInterface { - + @Throws(NodeException::class) fun `blindedPathsForAsyncRecipient`(`recipientId`: kotlin.ByteArray): kotlin.ByteArray - + @Throws(NodeException::class) fun `initiateRefund`(`amountMsat`: kotlin.ULong, `expirySecs`: kotlin.UInt, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): Refund - + @Throws(NodeException::class) fun `receive`(`amountMsat`: kotlin.ULong, `description`: kotlin.String, `expirySecs`: kotlin.UInt?, `quantity`: kotlin.ULong?): Offer - + @Throws(NodeException::class) fun `receiveAsync`(): Offer - + @Throws(NodeException::class) fun `receiveVariableAmount`(`description`: kotlin.String, `expirySecs`: kotlin.UInt?): Offer - + @Throws(NodeException::class) fun `requestRefundPayment`(`refund`: Refund): Bolt12Invoice - + @Throws(NodeException::class) fun `send`(`offer`: Offer, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendUsingAmount`(`offer`: Offer, `amountMsat`: kotlin.ULong, `quantity`: kotlin.ULong?, `payerNote`: kotlin.String?, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `setPathsToStaticInvoiceServer`(`paths`: kotlin.ByteArray) - + companion object } @@ -283,77 +283,81 @@ interface Bolt12PaymentInterface { interface BuilderInterface { - + @Throws(BuildException::class) fun `build`(): Node - + @Throws(BuildException::class) fun `buildWithFsStore`(): Node - + @Throws(BuildException::class) fun `buildWithVssStore`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `lnurlAuthServerUrl`: kotlin.String, `fixedHeaders`: Map): Node - + @Throws(BuildException::class) fun `buildWithVssStoreAndFixedHeaders`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `fixedHeaders`: Map): Node - + @Throws(BuildException::class) fun `buildWithVssStoreAndHeaderProvider`(`vssUrl`: kotlin.String, `storeId`: kotlin.String, `headerProvider`: VssHeaderProvider): Node - + fun `setAcceptStaleChannelMonitors`(`accept`: kotlin.Boolean) - + fun `setAddressType`(`addressType`: AddressType) - + fun `setAddressTypesToMonitor`(`addressTypesToMonitor`: List) - + @Throws(BuildException::class) fun `setAnnouncementAddresses`(`announcementAddresses`: List) - + @Throws(BuildException::class) fun `setAsyncPaymentsRole`(`role`: AsyncPaymentsRole?) - + fun `setChainSourceBitcoindRest`(`restHost`: kotlin.String, `restPort`: kotlin.UShort, `rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - + fun `setChainSourceBitcoindRpc`(`rpcHost`: kotlin.String, `rpcPort`: kotlin.UShort, `rpcUser`: kotlin.String, `rpcPassword`: kotlin.String) - + fun `setChainSourceElectrum`(`serverUrl`: kotlin.String, `config`: ElectrumSyncConfig?) - + fun `setChainSourceEsplora`(`serverUrl`: kotlin.String, `config`: EsploraSyncConfig?) - + fun `setChannelDataMigration`(`migration`: ChannelDataMigration) - + fun `setCustomLogger`(`logWriter`: LogWriter) - + fun `setEntropyBip39Mnemonic`(`mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + @Throws(BuildException::class) fun `setEntropySeedBytes`(`seedBytes`: List) - + fun `setEntropySeedPath`(`seedPath`: kotlin.String) - + fun `setFilesystemLogger`(`logFilePath`: kotlin.String?, `maxLogLevel`: LogLevel?) - + fun `setGossipSourceP2p`() - + fun `setGossipSourceRgs`(`rgsServerUrl`: kotlin.String) - + fun `setLiquiditySourceLsps1`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - + fun `setLiquiditySourceLsps2`(`nodeId`: PublicKey, `address`: SocketAddress, `token`: kotlin.String?) - + @Throws(BuildException::class) fun `setListeningAddresses`(`listeningAddresses`: List) - + fun `setLogFacadeLogger`() - + fun `setNetwork`(`network`: Network) - + @Throws(BuildException::class) fun `setNodeAlias`(`nodeAlias`: kotlin.String) - + fun `setPathfindingScoresSource`(`url`: kotlin.String) - + + fun `setScoringDecayParams`(`params`: ScoringDecayParameters) + + fun `setScoringFeeParams`(`params`: ScoringFeeParameters) + fun `setStorageDirPath`(`storageDirPath`: kotlin.String) - + companion object } @@ -361,13 +365,13 @@ interface BuilderInterface { interface FeeRateInterface { - + fun `toSatPerKwu`(): kotlin.ULong - + fun `toSatPerVbCeil`(): kotlin.ULong - + fun `toSatPerVbFloor`(): kotlin.ULong - + companion object } @@ -375,13 +379,13 @@ interface FeeRateInterface { interface Lsps1LiquidityInterface { - + @Throws(NodeException::class) fun `checkOrderStatus`(`orderId`: Lsps1OrderId): Lsps1OrderStatus - + @Throws(NodeException::class) fun `requestChannel`(`lspBalanceSat`: kotlin.ULong, `clientBalanceSat`: kotlin.ULong, `channelExpiryBlocks`: kotlin.UInt, `announceChannel`: kotlin.Boolean): Lsps1OrderStatus - + companion object } @@ -389,9 +393,9 @@ interface Lsps1LiquidityInterface { interface LogWriter { - + fun `log`(`record`: LogRecord) - + companion object } @@ -399,15 +403,15 @@ interface LogWriter { interface NetworkGraphInterface { - + fun `channel`(`shortChannelId`: kotlin.ULong): ChannelInfo? - + fun `listChannels`(): List - + fun `listNodes`(): List - + fun `node`(`nodeId`: NodeId): NodeInfo? - + companion object } @@ -415,128 +419,128 @@ interface NetworkGraphInterface { interface NodeInterface { - + @Throws(NodeException::class) fun `addAddressTypeToMonitor`(`addressType`: AddressType, `seedBytes`: List) - + @Throws(NodeException::class) fun `addAddressTypeToMonitorWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + fun `announcementAddresses`(): List? - + fun `bolt11Payment`(): Bolt11Payment - + fun `bolt12Payment`(): Bolt12Payment - + @Throws(NodeException::class) fun `closeChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey) - + fun `config`(): Config - + @Throws(NodeException::class) fun `connect`(`nodeId`: PublicKey, `address`: SocketAddress, `persist`: kotlin.Boolean) - + fun `currentSyncIntervals`(): RuntimeSyncIntervals - + @Throws(NodeException::class) fun `disconnect`(`nodeId`: PublicKey) - + @Throws(NodeException::class) fun `eventHandled`() - + @Throws(NodeException::class) fun `exportPathfindingScores`(): kotlin.ByteArray - + @Throws(NodeException::class) fun `forceCloseChannel`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `reason`: kotlin.String?) - + @Throws(NodeException::class) fun `getAddressBalance`(`addressStr`: kotlin.String): kotlin.ULong - + @Throws(NodeException::class) fun `getBalanceForAddressType`(`addressType`: AddressType): AddressTypeBalance - + fun `getTransactionDetails`(`txid`: Txid): TransactionDetails? - + fun `listBalances`(): BalanceDetails - + fun `listChannels`(): List - + fun `listMonitoredAddressTypes`(): List - + fun `listPayments`(): List - + fun `listPeers`(): List - + fun `listeningAddresses`(): List? - + fun `lsps1Liquidity`(): Lsps1Liquidity - + fun `networkGraph`(): NetworkGraph - + fun `nextEvent`(): Event? - + suspend fun `nextEventAsync`(): Event - + fun `nodeAlias`(): NodeAlias? - + fun `nodeId`(): PublicKey - + fun `onchainPayment`(): OnchainPayment - + @Throws(NodeException::class) fun `openAnnouncedChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - + @Throws(NodeException::class) fun `openChannel`(`nodeId`: PublicKey, `address`: SocketAddress, `channelAmountSats`: kotlin.ULong, `pushToCounterpartyMsat`: kotlin.ULong?, `channelConfig`: ChannelConfig?): UserChannelId - + fun `payment`(`paymentId`: PaymentId): PaymentDetails? - + @Throws(NodeException::class) fun `removeAddressTypeFromMonitor`(`addressType`: AddressType) - + @Throws(NodeException::class) fun `removePayment`(`paymentId`: PaymentId) - + @Throws(NodeException::class) fun `setPrimaryAddressType`(`addressType`: AddressType, `seedBytes`: List) - + @Throws(NodeException::class) fun `setPrimaryAddressTypeWithMnemonic`(`addressType`: AddressType, `mnemonic`: Mnemonic, `passphrase`: kotlin.String?) - + fun `signMessage`(`msg`: List): kotlin.String - + @Throws(NodeException::class) fun `spliceIn`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `spliceAmountSats`: kotlin.ULong) - + @Throws(NodeException::class) fun `spliceOut`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `address`: Address, `spliceAmountSats`: kotlin.ULong) - + fun `spontaneousPayment`(): SpontaneousPayment - + @Throws(NodeException::class) fun `start`() - + fun `status`(): NodeStatus - + @Throws(NodeException::class) fun `stop`() - + @Throws(NodeException::class) fun `syncWallets`() - + fun `unifiedQrPayment`(): UnifiedQrPayment - + @Throws(NodeException::class) fun `updateChannelConfig`(`userChannelId`: UserChannelId, `counterpartyNodeId`: PublicKey, `channelConfig`: ChannelConfig) - + @Throws(NodeException::class) fun `updateSyncIntervals`(`intervals`: RuntimeSyncIntervals) - + fun `verifySignature`(`msg`: List, `sig`: kotlin.String, `pkey`: PublicKey): kotlin.Boolean - + fun `waitNextEvent`(): Event - + companion object } @@ -544,31 +548,31 @@ interface NodeInterface { interface OfferInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amount`(): OfferAmount? - + fun `chains`(): List - + fun `expectsQuantity`(): kotlin.Boolean - + fun `id`(): OfferId - + fun `isExpired`(): kotlin.Boolean - + fun `isValidQuantity`(`quantity`: kotlin.ULong): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `issuerSigningPubkey`(): PublicKey? - + fun `metadata`(): List? - + fun `offerDescription`(): kotlin.String? - + fun `supportsChain`(`chain`: Network): kotlin.Boolean - + companion object } @@ -576,55 +580,55 @@ interface OfferInterface { interface OnchainPaymentInterface { - + @Throws(NodeException::class) fun `accelerateByCpfp`(`txid`: Txid, `feeRate`: FeeRate?, `destinationAddress`: Address?): Txid - + @Throws(NodeException::class) fun `addressInfoForTypeAtIndex`(`addressType`: AddressType, `keychain`: KeychainKind, `index`: kotlin.UInt): AddressInfo - + @Throws(NodeException::class) fun `addressInfosForType`(`addressType`: AddressType, `keychain`: KeychainKind, `startIndex`: kotlin.UInt, `count`: kotlin.UInt): List - + @Throws(NodeException::class) fun `bumpFeeByRbf`(`txid`: Txid, `feeRate`: FeeRate): Txid - + @Throws(NodeException::class) fun `calculateCpfpFeeRate`(`parentTxid`: Txid, `urgent`: kotlin.Boolean): FeeRate - + @Throws(NodeException::class) fun `calculateSendAllFee`(`address`: Address, `retainReserves`: kotlin.Boolean, `feeRate`: FeeRate?): kotlin.ULong - + @Throws(NodeException::class) fun `calculateTotalFee`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): kotlin.ULong - + @Throws(NodeException::class) fun `listSpendableOutputs`(): List - + @Throws(NodeException::class) fun `newAddress`(): Address - + @Throws(NodeException::class) fun `newAddressForType`(`addressType`: AddressType): Address - + @Throws(NodeException::class) fun `newAddressInfo`(): AddressInfo - + @Throws(NodeException::class) fun `newAddressInfoForType`(`addressType`: AddressType): AddressInfo - + @Throws(NodeException::class) fun `revealReceiveAddressesTo`(`addressType`: AddressType, `index`: kotlin.UInt) - + @Throws(NodeException::class) fun `selectUtxosWithAlgorithm`(`targetAmountSats`: kotlin.ULong, `feeRate`: FeeRate?, `algorithm`: CoinSelectionAlgorithm, `utxos`: List?): List - + @Throws(NodeException::class) fun `sendAllToAddress`(`address`: Address, `retainReserve`: kotlin.Boolean, `feeRate`: FeeRate?): Txid - + @Throws(NodeException::class) fun `sendToAddress`(`address`: Address, `amountSats`: kotlin.ULong, `feeRate`: FeeRate?, `utxosToSpend`: List?): Txid - + companion object } @@ -632,27 +636,27 @@ interface OnchainPaymentInterface { interface RefundInterface { - + fun `absoluteExpirySeconds`(): kotlin.ULong? - + fun `amountMsats`(): kotlin.ULong - + fun `chain`(): Network? - + fun `isExpired`(): kotlin.Boolean - + fun `issuer`(): kotlin.String? - + fun `payerMetadata`(): List - + fun `payerNote`(): kotlin.String? - + fun `payerSigningPubkey`(): PublicKey - + fun `quantity`(): kotlin.ULong? - + fun `refundDescription`(): kotlin.String - + companion object } @@ -660,22 +664,22 @@ interface RefundInterface { interface SpontaneousPaymentInterface { - + @Throws(NodeException::class) fun `send`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendProbes`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey): List - + @Throws(NodeException::class) fun `sendWithCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `routeParameters`: RouteParametersConfig?, `customTlvs`: List): PaymentId - + @Throws(NodeException::class) fun `sendWithPreimage`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - + @Throws(NodeException::class) fun `sendWithPreimageAndCustomTlvs`(`amountMsat`: kotlin.ULong, `nodeId`: PublicKey, `customTlvs`: List, `preimage`: PaymentPreimage, `routeParameters`: RouteParametersConfig?): PaymentId - + companion object } @@ -683,13 +687,13 @@ interface SpontaneousPaymentInterface { interface UnifiedQrPaymentInterface { - + @Throws(NodeException::class) fun `receive`(`amountSats`: kotlin.ULong, `message`: kotlin.String, `expirySec`: kotlin.UInt): kotlin.String - + @Throws(NodeException::class) fun `send`(`uriStr`: kotlin.String, `routeParameters`: RouteParametersConfig?): QrPaymentResult - + companion object } @@ -697,10 +701,10 @@ interface UnifiedQrPaymentInterface { interface VssHeaderProviderInterface { - + @Throws(VssHeaderProviderException::class, kotlin.coroutines.cancellation.CancellationException::class) suspend fun `getHeaders`(`request`: List): Map - + companion object } @@ -709,8 +713,8 @@ interface VssHeaderProviderInterface { @kotlinx.serialization.Serializable data class AddressInfo ( - val `index`: kotlin.UInt, - val `address`: Address, + val `index`: kotlin.UInt, + val `address`: Address, val `keychain`: KeychainKind ) { companion object @@ -720,7 +724,7 @@ data class AddressInfo ( @kotlinx.serialization.Serializable data class AddressTypeBalance ( - val `totalSats`: kotlin.ULong, + val `totalSats`: kotlin.ULong, val `spendableSats`: kotlin.ULong ) { companion object @@ -730,7 +734,7 @@ data class AddressTypeBalance ( @kotlinx.serialization.Serializable data class AnchorChannelsConfig ( - val `trustedPeersNoReserve`: List, + val `trustedPeersNoReserve`: List, val `perChannelReserveSats`: kotlin.ULong ) { companion object @@ -740,8 +744,8 @@ data class AnchorChannelsConfig ( @kotlinx.serialization.Serializable data class BackgroundSyncConfig ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, + val `onchainWalletSyncIntervalSecs`: kotlin.ULong, + val `lightningWalletSyncIntervalSecs`: kotlin.ULong, val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong ) { companion object @@ -751,11 +755,11 @@ data class BackgroundSyncConfig ( @kotlinx.serialization.Serializable data class BalanceDetails ( - val `totalOnchainBalanceSats`: kotlin.ULong, - val `spendableOnchainBalanceSats`: kotlin.ULong, - val `totalAnchorChannelsReserveSats`: kotlin.ULong, - val `totalLightningBalanceSats`: kotlin.ULong, - val `lightningBalances`: List, + val `totalOnchainBalanceSats`: kotlin.ULong, + val `spendableOnchainBalanceSats`: kotlin.ULong, + val `totalAnchorChannelsReserveSats`: kotlin.ULong, + val `totalLightningBalanceSats`: kotlin.ULong, + val `lightningBalances`: List, val `pendingBalancesFromChannelClosures`: List ) { companion object @@ -765,7 +769,7 @@ data class BalanceDetails ( @kotlinx.serialization.Serializable data class BestBlock ( - val `blockHash`: BlockHash, + val `blockHash`: BlockHash, val `height`: kotlin.UInt ) { companion object @@ -775,11 +779,11 @@ data class BestBlock ( @kotlinx.serialization.Serializable data class ChannelConfig ( - val `forwardingFeeProportionalMillionths`: kotlin.UInt, - val `forwardingFeeBaseMsat`: kotlin.UInt, - val `cltvExpiryDelta`: kotlin.UShort, - val `maxDustHtlcExposure`: MaxDustHtlcExposure, - val `forceCloseAvoidanceMaxFeeSatoshis`: kotlin.ULong, + val `forwardingFeeProportionalMillionths`: kotlin.UInt, + val `forwardingFeeBaseMsat`: kotlin.UInt, + val `cltvExpiryDelta`: kotlin.UShort, + val `maxDustHtlcExposure`: MaxDustHtlcExposure, + val `forceCloseAvoidanceMaxFeeSatoshis`: kotlin.ULong, val `acceptUnderpayingHtlcs`: kotlin.Boolean ) { companion object @@ -789,7 +793,7 @@ data class ChannelConfig ( @kotlinx.serialization.Serializable data class ChannelDataMigration ( - val `channelManager`: List?, + val `channelManager`: List?, val `channelMonitors`: List> ) { companion object @@ -799,37 +803,37 @@ data class ChannelDataMigration ( @kotlinx.serialization.Serializable data class ChannelDetails ( - val `channelId`: ChannelId, - val `counterpartyNodeId`: PublicKey, - val `fundingTxo`: OutPoint?, - val `shortChannelId`: kotlin.ULong?, - val `outboundScidAlias`: kotlin.ULong?, - val `inboundScidAlias`: kotlin.ULong?, - val `channelValueSats`: kotlin.ULong, - val `unspendablePunishmentReserve`: kotlin.ULong?, - val `userChannelId`: UserChannelId, - val `feerateSatPer1000Weight`: kotlin.UInt, - val `outboundCapacityMsat`: kotlin.ULong, - val `inboundCapacityMsat`: kotlin.ULong, - val `confirmationsRequired`: kotlin.UInt?, - val `confirmations`: kotlin.UInt?, - val `isOutbound`: kotlin.Boolean, - val `isChannelReady`: kotlin.Boolean, - val `isUsable`: kotlin.Boolean, - val `isAnnounced`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort?, - val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, - val `counterpartyOutboundHtlcMinimumMsat`: kotlin.ULong?, - val `counterpartyOutboundHtlcMaximumMsat`: kotlin.ULong?, - val `counterpartyForwardingInfoFeeBaseMsat`: kotlin.UInt?, - val `counterpartyForwardingInfoFeeProportionalMillionths`: kotlin.UInt?, - val `counterpartyForwardingInfoCltvExpiryDelta`: kotlin.UShort?, - val `nextOutboundHtlcLimitMsat`: kotlin.ULong, - val `nextOutboundHtlcMinimumMsat`: kotlin.ULong, - val `forceCloseSpendDelay`: kotlin.UShort?, - val `inboundHtlcMinimumMsat`: kotlin.ULong, - val `inboundHtlcMaximumMsat`: kotlin.ULong?, - val `config`: ChannelConfig, + val `channelId`: ChannelId, + val `counterpartyNodeId`: PublicKey, + val `fundingTxo`: OutPoint?, + val `shortChannelId`: kotlin.ULong?, + val `outboundScidAlias`: kotlin.ULong?, + val `inboundScidAlias`: kotlin.ULong?, + val `channelValueSats`: kotlin.ULong, + val `unspendablePunishmentReserve`: kotlin.ULong?, + val `userChannelId`: UserChannelId, + val `feerateSatPer1000Weight`: kotlin.UInt, + val `outboundCapacityMsat`: kotlin.ULong, + val `inboundCapacityMsat`: kotlin.ULong, + val `confirmationsRequired`: kotlin.UInt?, + val `confirmations`: kotlin.UInt?, + val `isOutbound`: kotlin.Boolean, + val `isChannelReady`: kotlin.Boolean, + val `isUsable`: kotlin.Boolean, + val `isAnnounced`: kotlin.Boolean, + val `cltvExpiryDelta`: kotlin.UShort?, + val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, + val `counterpartyOutboundHtlcMinimumMsat`: kotlin.ULong?, + val `counterpartyOutboundHtlcMaximumMsat`: kotlin.ULong?, + val `counterpartyForwardingInfoFeeBaseMsat`: kotlin.UInt?, + val `counterpartyForwardingInfoFeeProportionalMillionths`: kotlin.UInt?, + val `counterpartyForwardingInfoCltvExpiryDelta`: kotlin.UShort?, + val `nextOutboundHtlcLimitMsat`: kotlin.ULong, + val `nextOutboundHtlcMinimumMsat`: kotlin.ULong, + val `forceCloseSpendDelay`: kotlin.UShort?, + val `inboundHtlcMinimumMsat`: kotlin.ULong, + val `inboundHtlcMaximumMsat`: kotlin.ULong?, + val `config`: ChannelConfig, val `claimableOnCloseSats`: kotlin.ULong? ) { companion object @@ -839,10 +843,10 @@ data class ChannelDetails ( @kotlinx.serialization.Serializable data class ChannelInfo ( - val `nodeOne`: NodeId, - val `oneToTwo`: ChannelUpdateInfo?, - val `nodeTwo`: NodeId, - val `twoToOne`: ChannelUpdateInfo?, + val `nodeOne`: NodeId, + val `oneToTwo`: ChannelUpdateInfo?, + val `nodeTwo`: NodeId, + val `twoToOne`: ChannelUpdateInfo?, val `capacitySats`: kotlin.ULong? ) { companion object @@ -852,11 +856,11 @@ data class ChannelInfo ( @kotlinx.serialization.Serializable data class ChannelUpdateInfo ( - val `lastUpdate`: kotlin.UInt, - val `enabled`: kotlin.Boolean, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong, - val `htlcMaximumMsat`: kotlin.ULong, + val `lastUpdate`: kotlin.UInt, + val `enabled`: kotlin.Boolean, + val `cltvExpiryDelta`: kotlin.UShort, + val `htlcMinimumMsat`: kotlin.ULong, + val `htlcMaximumMsat`: kotlin.ULong, val `fees`: RoutingFees ) { companion object @@ -866,17 +870,19 @@ data class ChannelUpdateInfo ( @kotlinx.serialization.Serializable data class Config ( - val `storageDirPath`: kotlin.String, - val `network`: Network, - val `listeningAddresses`: List?, - val `announcementAddresses`: List?, - val `nodeAlias`: NodeAlias?, - val `trustedPeers0conf`: List, - val `probingLiquidityLimitMultiplier`: kotlin.ULong, - val `anchorChannelsConfig`: AnchorChannelsConfig?, - val `routeParameters`: RouteParametersConfig?, - val `includeUntrustedPendingInSpendable`: kotlin.Boolean, - val `addressType`: AddressType, + val `storageDirPath`: kotlin.String, + val `network`: Network, + val `listeningAddresses`: List?, + val `announcementAddresses`: List?, + val `nodeAlias`: NodeAlias?, + val `trustedPeers0conf`: List, + val `probingLiquidityLimitMultiplier`: kotlin.ULong, + val `anchorChannelsConfig`: AnchorChannelsConfig?, + val `routeParameters`: RouteParametersConfig?, + val `scoringFeeParams`: ScoringFeeParameters?, + val `scoringDecayParams`: ScoringDecayParameters?, + val `includeUntrustedPendingInSpendable`: kotlin.Boolean, + val `addressType`: AddressType, val `addressTypesToMonitor`: List ) { companion object @@ -886,7 +892,7 @@ data class Config ( @kotlinx.serialization.Serializable data class CustomTlvRecord ( - val `typeNum`: kotlin.ULong, + val `typeNum`: kotlin.ULong, val `value`: List ) { companion object @@ -896,7 +902,7 @@ data class CustomTlvRecord ( @kotlinx.serialization.Serializable data class ElectrumSyncConfig ( - val `backgroundSyncConfig`: BackgroundSyncConfig?, + val `backgroundSyncConfig`: BackgroundSyncConfig?, val `connectionTimeoutSecs`: kotlin.ULong ) { companion object @@ -915,7 +921,7 @@ data class EsploraSyncConfig ( @kotlinx.serialization.Serializable data class LspFeeLimits ( - val `maxTotalOpeningFeeMsat`: kotlin.ULong?, + val `maxTotalOpeningFeeMsat`: kotlin.ULong?, val `maxProportionalOpeningFeePpmMsat`: kotlin.ULong? ) { companion object @@ -925,10 +931,10 @@ data class LspFeeLimits ( data class Lsps1Bolt11PaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, + val `state`: Lsps1PaymentState, + val `expiresAt`: LspsDateTime, + val `feeTotalSat`: kotlin.ULong, + val `orderTotalSat`: kotlin.ULong, val `invoice`: Bolt11Invoice ) : Disposable { override fun destroy() { @@ -947,8 +953,8 @@ data class Lsps1Bolt11PaymentInfo ( @kotlinx.serialization.Serializable data class Lsps1ChannelInfo ( - val `fundedAt`: LspsDateTime, - val `fundingOutpoint`: OutPoint, + val `fundedAt`: LspsDateTime, + val `fundingOutpoint`: OutPoint, val `expiresAt`: LspsDateTime ) { companion object @@ -958,13 +964,13 @@ data class Lsps1ChannelInfo ( data class Lsps1OnchainPaymentInfo ( - val `state`: Lsps1PaymentState, - val `expiresAt`: LspsDateTime, - val `feeTotalSat`: kotlin.ULong, - val `orderTotalSat`: kotlin.ULong, - val `address`: Address, - val `minOnchainPaymentConfirmations`: kotlin.UShort?, - val `minFeeFor0conf`: FeeRate, + val `state`: Lsps1PaymentState, + val `expiresAt`: LspsDateTime, + val `feeTotalSat`: kotlin.ULong, + val `orderTotalSat`: kotlin.ULong, + val `address`: Address, + val `minOnchainPaymentConfirmations`: kotlin.UShort?, + val `minFeeFor0conf`: FeeRate, val `refundOnchainAddress`: Address? ) : Disposable { override fun destroy() { @@ -986,12 +992,12 @@ data class Lsps1OnchainPaymentInfo ( @kotlinx.serialization.Serializable data class Lsps1OrderParams ( - val `lspBalanceSat`: kotlin.ULong, - val `clientBalanceSat`: kotlin.ULong, - val `requiredChannelConfirmations`: kotlin.UShort, - val `fundingConfirmsWithinBlocks`: kotlin.UShort, - val `channelExpiryBlocks`: kotlin.UInt, - val `token`: kotlin.String?, + val `lspBalanceSat`: kotlin.ULong, + val `clientBalanceSat`: kotlin.ULong, + val `requiredChannelConfirmations`: kotlin.UShort, + val `fundingConfirmsWithinBlocks`: kotlin.UShort, + val `channelExpiryBlocks`: kotlin.UInt, + val `token`: kotlin.String?, val `announceChannel`: kotlin.Boolean ) { companion object @@ -1001,9 +1007,9 @@ data class Lsps1OrderParams ( data class Lsps1OrderStatus ( - val `orderId`: Lsps1OrderId, - val `orderParams`: Lsps1OrderParams, - val `paymentOptions`: Lsps1PaymentInfo, + val `orderId`: Lsps1OrderId, + val `orderParams`: Lsps1OrderParams, + val `paymentOptions`: Lsps1PaymentInfo, val `channelState`: Lsps1ChannelInfo? ) : Disposable { override fun destroy() { @@ -1021,7 +1027,7 @@ data class Lsps1OrderStatus ( data class Lsps1PaymentInfo ( - val `bolt11`: Lsps1Bolt11PaymentInfo?, + val `bolt11`: Lsps1Bolt11PaymentInfo?, val `onchain`: Lsps1OnchainPaymentInfo? ) : Disposable { override fun destroy() { @@ -1037,15 +1043,15 @@ data class Lsps1PaymentInfo ( @kotlinx.serialization.Serializable data class Lsps2ServiceConfig ( - val `requireToken`: kotlin.String?, - val `advertiseService`: kotlin.Boolean, - val `channelOpeningFeePpm`: kotlin.UInt, - val `channelOverProvisioningPpm`: kotlin.UInt, - val `minChannelOpeningFeeMsat`: kotlin.ULong, - val `minChannelLifetime`: kotlin.UInt, - val `maxClientToSelfDelay`: kotlin.UInt, - val `minPaymentSizeMsat`: kotlin.ULong, - val `maxPaymentSizeMsat`: kotlin.ULong, + val `requireToken`: kotlin.String?, + val `advertiseService`: kotlin.Boolean, + val `channelOpeningFeePpm`: kotlin.UInt, + val `channelOverProvisioningPpm`: kotlin.UInt, + val `minChannelOpeningFeeMsat`: kotlin.ULong, + val `minChannelLifetime`: kotlin.UInt, + val `maxClientToSelfDelay`: kotlin.UInt, + val `minPaymentSizeMsat`: kotlin.ULong, + val `maxPaymentSizeMsat`: kotlin.ULong, val `clientTrustsLsp`: kotlin.Boolean ) { companion object @@ -1055,9 +1061,9 @@ data class Lsps2ServiceConfig ( @kotlinx.serialization.Serializable data class LogRecord ( - val `level`: LogLevel, - val `args`: kotlin.String, - val `modulePath`: kotlin.String, + val `level`: LogLevel, + val `args`: kotlin.String, + val `modulePath`: kotlin.String, val `line`: kotlin.UInt ) { companion object @@ -1067,8 +1073,8 @@ data class LogRecord ( @kotlinx.serialization.Serializable data class NodeAnnouncementInfo ( - val `lastUpdate`: kotlin.UInt, - val `alias`: kotlin.String, + val `lastUpdate`: kotlin.UInt, + val `alias`: kotlin.String, val `addresses`: List ) { companion object @@ -1078,7 +1084,7 @@ data class NodeAnnouncementInfo ( @kotlinx.serialization.Serializable data class NodeInfo ( - val `channels`: List, + val `channels`: List, val `announcementInfo`: NodeAnnouncementInfo? ) { companion object @@ -1088,14 +1094,14 @@ data class NodeInfo ( @kotlinx.serialization.Serializable data class NodeStatus ( - val `isRunning`: kotlin.Boolean, - val `currentBestBlock`: BestBlock, - val `latestLightningWalletSyncTimestamp`: kotlin.ULong?, - val `latestOnchainWalletSyncTimestamp`: kotlin.ULong?, - val `latestFeeRateCacheUpdateTimestamp`: kotlin.ULong?, - val `latestRgsSnapshotTimestamp`: kotlin.ULong?, - val `latestPathfindingScoresSyncTimestamp`: kotlin.ULong?, - val `latestNodeAnnouncementBroadcastTimestamp`: kotlin.ULong?, + val `isRunning`: kotlin.Boolean, + val `currentBestBlock`: BestBlock, + val `latestLightningWalletSyncTimestamp`: kotlin.ULong?, + val `latestOnchainWalletSyncTimestamp`: kotlin.ULong?, + val `latestFeeRateCacheUpdateTimestamp`: kotlin.ULong?, + val `latestRgsSnapshotTimestamp`: kotlin.ULong?, + val `latestPathfindingScoresSyncTimestamp`: kotlin.ULong?, + val `latestNodeAnnouncementBroadcastTimestamp`: kotlin.ULong?, val `latestChannelMonitorArchivalHeight`: kotlin.UInt? ) { companion object @@ -1105,7 +1111,7 @@ data class NodeStatus ( @kotlinx.serialization.Serializable data class OutPoint ( - val `txid`: Txid, + val `txid`: Txid, val `vout`: kotlin.UInt ) { companion object @@ -1115,12 +1121,12 @@ data class OutPoint ( @kotlinx.serialization.Serializable data class PaymentDetails ( - val `id`: PaymentId, - val `kind`: PaymentKind, - val `amountMsat`: kotlin.ULong?, - val `feePaidMsat`: kotlin.ULong?, - val `direction`: PaymentDirection, - val `status`: PaymentStatus, + val `id`: PaymentId, + val `kind`: PaymentKind, + val `amountMsat`: kotlin.ULong?, + val `feePaidMsat`: kotlin.ULong?, + val `direction`: PaymentDirection, + val `status`: PaymentStatus, val `latestUpdateTimestamp`: kotlin.ULong ) { companion object @@ -1130,9 +1136,9 @@ data class PaymentDetails ( @kotlinx.serialization.Serializable data class PeerDetails ( - val `nodeId`: PublicKey, - val `address`: SocketAddress, - val `isPersisted`: kotlin.Boolean, + val `nodeId`: PublicKey, + val `address`: SocketAddress, + val `isPersisted`: kotlin.Boolean, val `isConnected`: kotlin.Boolean ) { companion object @@ -1142,7 +1148,7 @@ data class PeerDetails ( @kotlinx.serialization.Serializable data class ProbeHandle ( - val `paymentHash`: PaymentHash, + val `paymentHash`: PaymentHash, val `paymentId`: PaymentId ) { companion object @@ -1152,11 +1158,11 @@ data class ProbeHandle ( @kotlinx.serialization.Serializable data class RouteHintHop ( - val `srcNodeId`: PublicKey, - val `shortChannelId`: kotlin.ULong, - val `cltvExpiryDelta`: kotlin.UShort, - val `htlcMinimumMsat`: kotlin.ULong?, - val `htlcMaximumMsat`: kotlin.ULong?, + val `srcNodeId`: PublicKey, + val `shortChannelId`: kotlin.ULong, + val `cltvExpiryDelta`: kotlin.UShort, + val `htlcMinimumMsat`: kotlin.ULong?, + val `htlcMaximumMsat`: kotlin.ULong?, val `fees`: RoutingFees ) { companion object @@ -1166,9 +1172,9 @@ data class RouteHintHop ( @kotlinx.serialization.Serializable data class RouteParametersConfig ( - val `maxTotalRoutingFeeMsat`: kotlin.ULong?, - val `maxTotalCltvExpiryDelta`: kotlin.UInt, - val `maxPathCount`: kotlin.UByte, + val `maxTotalRoutingFeeMsat`: kotlin.ULong?, + val `maxTotalCltvExpiryDelta`: kotlin.UInt, + val `maxPathCount`: kotlin.UByte, val `maxChannelSaturationPowerOfHalf`: kotlin.UByte ) { companion object @@ -1178,7 +1184,7 @@ data class RouteParametersConfig ( @kotlinx.serialization.Serializable data class RoutingFees ( - val `baseMsat`: kotlin.UInt, + val `baseMsat`: kotlin.UInt, val `proportionalMillionths`: kotlin.UInt ) { companion object @@ -1188,8 +1194,8 @@ data class RoutingFees ( @kotlinx.serialization.Serializable data class RuntimeSyncIntervals ( - val `onchainWalletSyncIntervalSecs`: kotlin.ULong, - val `lightningWalletSyncIntervalSecs`: kotlin.ULong, + val `onchainWalletSyncIntervalSecs`: kotlin.ULong, + val `lightningWalletSyncIntervalSecs`: kotlin.ULong, val `feeRateCacheUpdateIntervalSecs`: kotlin.ULong ) { companion object @@ -1197,9 +1203,37 @@ data class RuntimeSyncIntervals ( +@kotlinx.serialization.Serializable +data class ScoringDecayParameters ( + val `historicalNoUpdatesHalfLifeSecs`: kotlin.ULong, + val `liquidityOffsetHalfLifeSecs`: kotlin.ULong +) { + companion object +} + + + +@kotlinx.serialization.Serializable +data class ScoringFeeParameters ( + val `basePenaltyMsat`: kotlin.ULong, + val `basePenaltyAmountMultiplierMsat`: kotlin.ULong, + val `liquidityPenaltyMultiplierMsat`: kotlin.ULong, + val `liquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, + val `historicalLiquidityPenaltyMultiplierMsat`: kotlin.ULong, + val `historicalLiquidityPenaltyAmountMultiplierMsat`: kotlin.ULong, + val `antiProbingPenaltyMsat`: kotlin.ULong, + val `consideredImpossiblePenaltyMsat`: kotlin.ULong, + val `linearSuccessProbability`: kotlin.Boolean, + val `probingDiversityPenaltyMsat`: kotlin.ULong +) { + companion object +} + + + @kotlinx.serialization.Serializable data class SpendableUtxo ( - val `outpoint`: OutPoint, + val `outpoint`: OutPoint, val `valueSats`: kotlin.ULong ) { companion object @@ -1209,8 +1243,8 @@ data class SpendableUtxo ( @kotlinx.serialization.Serializable data class TransactionDetails ( - val `amountSats`: kotlin.Long, - val `inputs`: List, + val `amountSats`: kotlin.Long, + val `inputs`: List, val `outputs`: List ) { companion object @@ -1220,10 +1254,10 @@ data class TransactionDetails ( @kotlinx.serialization.Serializable data class TxInput ( - val `txid`: Txid, - val `vout`: kotlin.UInt, - val `scriptsig`: kotlin.String, - val `witness`: List, + val `txid`: Txid, + val `vout`: kotlin.UInt, + val `scriptsig`: kotlin.String, + val `witness`: List, val `sequence`: kotlin.UInt ) { companion object @@ -1233,10 +1267,10 @@ data class TxInput ( @kotlinx.serialization.Serializable data class TxOutput ( - val `scriptpubkey`: kotlin.String, - val `scriptpubkeyType`: kotlin.String?, - val `scriptpubkeyAddress`: kotlin.String?, - val `value`: kotlin.Long, + val `scriptpubkey`: kotlin.String, + val `scriptpubkeyType`: kotlin.String?, + val `scriptpubkeyAddress`: kotlin.String?, + val `value`: kotlin.Long, val `n`: kotlin.UInt ) { companion object @@ -1248,7 +1282,7 @@ data class TxOutput ( @kotlinx.serialization.Serializable enum class AddressType { - + LEGACY, NESTED_SEGWIT, NATIVE_SEGWIT, @@ -1264,7 +1298,7 @@ enum class AddressType { @kotlinx.serialization.Serializable enum class AsyncPaymentsRole { - + CLIENT, SERVER; companion object @@ -1278,7 +1312,7 @@ enum class AsyncPaymentsRole { @kotlinx.serialization.Serializable enum class BalanceSource { - + HOLDER_FORCE_CLOSED, COUNTERPARTY_FORCE_CLOSED, COOP_CLOSE, @@ -1303,7 +1337,7 @@ sealed class Bolt11InvoiceDescription { val `description`: kotlin.String, ) : Bolt11InvoiceDescription() { } - + } @@ -1313,41 +1347,41 @@ sealed class Bolt11InvoiceDescription { sealed class BuildException(message: String): kotlin.Exception(message) { - + class InvalidSeedBytes(message: String) : BuildException(message) - + class InvalidSeedFile(message: String) : BuildException(message) - + class InvalidSystemTime(message: String) : BuildException(message) - + class InvalidChannelMonitor(message: String) : BuildException(message) - + class InvalidListeningAddresses(message: String) : BuildException(message) - + class InvalidAnnouncementAddresses(message: String) : BuildException(message) - + class InvalidNodeAlias(message: String) : BuildException(message) - + class RuntimeSetupFailed(message: String) : BuildException(message) - + class ReadFailed(message: String) : BuildException(message) - + class DangerousValue(message: String) : BuildException(message) - + class WriteFailed(message: String) : BuildException(message) - + class StoragePathAccessFailed(message: String) : BuildException(message) - + class KvStoreSetupFailed(message: String) : BuildException(message) - + class WalletSetupFailed(message: String) : BuildException(message) - + class LoggerSetupFailed(message: String) : BuildException(message) - + class NetworkMismatch(message: String) : BuildException(message) - + class AsyncPaymentsConfigMismatch(message: String) : BuildException(message) - + } @@ -1366,51 +1400,51 @@ sealed class ClosureReason { val `message`: kotlin.String, ) : ClosureReason() { } - + @kotlinx.serialization.Serializable - data object LegacyCooperativeClosure : ClosureReason() - - + data object LegacyCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object CounterpartyInitiatedCooperativeClosure : ClosureReason() - - + data object CounterpartyInitiatedCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object LocallyInitiatedCooperativeClosure : ClosureReason() - - + data object LocallyInitiatedCooperativeClosure : ClosureReason() + + @kotlinx.serialization.Serializable - data object CommitmentTxConfirmed : ClosureReason() - - + data object CommitmentTxConfirmed : ClosureReason() + + @kotlinx.serialization.Serializable - data object FundingTimedOut : ClosureReason() - + data object FundingTimedOut : ClosureReason() + @kotlinx.serialization.Serializable data class ProcessingError( val `err`: kotlin.String, ) : ClosureReason() { } - + @kotlinx.serialization.Serializable - data object DisconnectedPeer : ClosureReason() - - + data object DisconnectedPeer : ClosureReason() + + @kotlinx.serialization.Serializable - data object OutdatedChannelManager : ClosureReason() - - + data object OutdatedChannelManager : ClosureReason() + + @kotlinx.serialization.Serializable - data object CounterpartyCoopClosedUnfundedChannel : ClosureReason() - - + data object CounterpartyCoopClosedUnfundedChannel : ClosureReason() + + @kotlinx.serialization.Serializable - data object LocallyCoopClosedUnfundedChannel : ClosureReason() - - + data object LocallyCoopClosedUnfundedChannel : ClosureReason() + + @kotlinx.serialization.Serializable - data object FundingBatchClosure : ClosureReason() - + data object FundingBatchClosure : ClosureReason() + @kotlinx.serialization.Serializable data class HtlCsTimedOut( val `paymentHash`: PaymentHash?, @@ -1422,7 +1456,7 @@ sealed class ClosureReason { val `requiredFeerateSatPerKw`: kotlin.UInt, ) : ClosureReason() { } - + } @@ -1433,7 +1467,7 @@ sealed class ClosureReason { @kotlinx.serialization.Serializable enum class CoinSelectionAlgorithm { - + BRANCH_AND_BOUND, LARGEST_FIRST, OLDEST_FIRST, @@ -1455,11 +1489,11 @@ sealed class ConfirmationStatus { val `timestamp`: kotlin.ULong, ) : ConfirmationStatus() { } - + @kotlinx.serialization.Serializable - data object Unconfirmed : ConfirmationStatus() - - + data object Unconfirmed : ConfirmationStatus() + + } @@ -1470,7 +1504,7 @@ sealed class ConfirmationStatus { @kotlinx.serialization.Serializable enum class Currency { - + BITCOIN, BITCOIN_TESTNET, REGTEST, @@ -1641,7 +1675,7 @@ sealed class Event { val `newTotalLightningBalanceSats`: kotlin.ULong, ) : Event() { } - + } @@ -1652,7 +1686,7 @@ sealed class Event { @kotlinx.serialization.Serializable enum class KeychainKind { - + EXTERNAL, INTERNAL; companion object @@ -1666,7 +1700,7 @@ enum class KeychainKind { @kotlinx.serialization.Serializable enum class Lsps1PaymentState { - + EXPECT_PAYMENT, PAID, REFUNDED; @@ -1737,7 +1771,7 @@ sealed class LightningBalance { val `amountSatoshis`: kotlin.ULong, ) : LightningBalance() { } - + } @@ -1748,7 +1782,7 @@ sealed class LightningBalance { @kotlinx.serialization.Serializable enum class LogLevel { - + GOSSIP, TRACE, DEBUG, @@ -1775,7 +1809,7 @@ sealed class MaxDustHtlcExposure { val `multiplier`: kotlin.ULong, ) : MaxDustHtlcExposure() { } - + } @@ -1786,7 +1820,7 @@ sealed class MaxDustHtlcExposure { @kotlinx.serialization.Serializable enum class Network { - + BITCOIN, TESTNET, SIGNET, @@ -1801,141 +1835,141 @@ enum class Network { sealed class NodeException(message: String): kotlin.Exception(message) { - + class AlreadyRunning(message: String) : NodeException(message) - + class NotRunning(message: String) : NodeException(message) - + class OnchainTxCreationFailed(message: String) : NodeException(message) - + class ConnectionFailed(message: String) : NodeException(message) - + class InvoiceCreationFailed(message: String) : NodeException(message) - + class InvoiceRequestCreationFailed(message: String) : NodeException(message) - + class OfferCreationFailed(message: String) : NodeException(message) - + class RefundCreationFailed(message: String) : NodeException(message) - + class PaymentSendingFailed(message: String) : NodeException(message) - + class InvalidCustomTlvs(message: String) : NodeException(message) - + class ProbeSendingFailed(message: String) : NodeException(message) - + class RouteNotFound(message: String) : NodeException(message) - + class ChannelCreationFailed(message: String) : NodeException(message) - + class ChannelClosingFailed(message: String) : NodeException(message) - + class ChannelSplicingFailed(message: String) : NodeException(message) - + class ChannelConfigUpdateFailed(message: String) : NodeException(message) - + class PersistenceFailed(message: String) : NodeException(message) - + class FeerateEstimationUpdateFailed(message: String) : NodeException(message) - + class FeerateEstimationUpdateTimeout(message: String) : NodeException(message) - + class WalletOperationFailed(message: String) : NodeException(message) - + class WalletOperationTimeout(message: String) : NodeException(message) - + class OnchainTxSigningFailed(message: String) : NodeException(message) - + class TxSyncFailed(message: String) : NodeException(message) - + class TxSyncTimeout(message: String) : NodeException(message) - + class GossipUpdateFailed(message: String) : NodeException(message) - + class GossipUpdateTimeout(message: String) : NodeException(message) - + class LiquidityRequestFailed(message: String) : NodeException(message) - + class UriParameterParsingFailed(message: String) : NodeException(message) - + class InvalidAddress(message: String) : NodeException(message) - + class InvalidSocketAddress(message: String) : NodeException(message) - + class InvalidPublicKey(message: String) : NodeException(message) - + class InvalidSecretKey(message: String) : NodeException(message) - + class InvalidOfferId(message: String) : NodeException(message) - + class InvalidNodeId(message: String) : NodeException(message) - + class InvalidPaymentId(message: String) : NodeException(message) - + class InvalidPaymentHash(message: String) : NodeException(message) - + class InvalidPaymentPreimage(message: String) : NodeException(message) - + class InvalidPaymentSecret(message: String) : NodeException(message) - + class InvalidAmount(message: String) : NodeException(message) - + class InvalidInvoice(message: String) : NodeException(message) - + class InvalidOffer(message: String) : NodeException(message) - + class InvalidRefund(message: String) : NodeException(message) - + class InvalidChannelId(message: String) : NodeException(message) - + class InvalidNetwork(message: String) : NodeException(message) - + class InvalidUri(message: String) : NodeException(message) - + class InvalidQuantity(message: String) : NodeException(message) - + class InvalidNodeAlias(message: String) : NodeException(message) - + class InvalidDateTime(message: String) : NodeException(message) - + class InvalidFeeRate(message: String) : NodeException(message) - + class DuplicatePayment(message: String) : NodeException(message) - + class UnsupportedCurrency(message: String) : NodeException(message) - + class InsufficientFunds(message: String) : NodeException(message) - + class LiquiditySourceUnavailable(message: String) : NodeException(message) - + class LiquidityFeeTooHigh(message: String) : NodeException(message) - + class InvalidBlindedPaths(message: String) : NodeException(message) - + class AsyncPaymentServicesDisabled(message: String) : NodeException(message) - + class CannotRbfFundingTransaction(message: String) : NodeException(message) - + class TransactionNotFound(message: String) : NodeException(message) - + class TransactionAlreadyConfirmed(message: String) : NodeException(message) - + class NoSpendableOutputs(message: String) : NodeException(message) - + class CoinSelectionFailed(message: String) : NodeException(message) - + class InvalidMnemonic(message: String) : NodeException(message) - + class BackgroundSyncNotEnabled(message: String) : NodeException(message) - + class AddressTypeAlreadyMonitored(message: String) : NodeException(message) - + class AddressTypeIsPrimary(message: String) : NodeException(message) - + class AddressTypeNotMonitored(message: String) : NodeException(message) - + class InvalidSeedBytes(message: String) : NodeException(message) - + } @@ -1954,7 +1988,7 @@ sealed class OfferAmount { val `amount`: kotlin.ULong, ) : OfferAmount() { } - + } @@ -1965,7 +1999,7 @@ sealed class OfferAmount { @kotlinx.serialization.Serializable enum class PaymentDirection { - + INBOUND, OUTBOUND; companion object @@ -1979,7 +2013,7 @@ enum class PaymentDirection { @kotlinx.serialization.Serializable enum class PaymentFailureReason { - + RECIPIENT_REJECTED, USER_ABANDONED, RETRIES_EXHAUSTED, @@ -2051,7 +2085,7 @@ sealed class PaymentKind { val `preimage`: PaymentPreimage?, ) : PaymentKind() { } - + } @@ -2062,7 +2096,7 @@ sealed class PaymentKind { @kotlinx.serialization.Serializable enum class PaymentStatus { - + PENDING, SUCCEEDED, FAILED; @@ -2099,7 +2133,7 @@ sealed class PendingSweepBalance { val `amountSatoshis`: kotlin.ULong, ) : PendingSweepBalance() { } - + } @@ -2124,7 +2158,7 @@ sealed class QrPaymentResult { val `paymentId`: PaymentId, ) : QrPaymentResult() { } - + } @@ -2135,7 +2169,7 @@ sealed class QrPaymentResult { @kotlinx.serialization.Serializable enum class SyncType { - + ONCHAIN_WALLET, LIGHTNING_WALLET, FEE_RATE_CACHE; @@ -2149,15 +2183,15 @@ enum class SyncType { sealed class VssHeaderProviderException(message: String): kotlin.Exception(message) { - + class InvalidData(message: String) : VssHeaderProviderException(message) - + class RequestException(message: String) : VssHeaderProviderException(message) - + class AuthorizationException(message: String) : VssHeaderProviderException(message) - + class InternalException(message: String) : VssHeaderProviderException(message) - + } @@ -2166,7 +2200,7 @@ sealed class VssHeaderProviderException(message: String): kotlin.Exception(messa @kotlinx.serialization.Serializable enum class WordCount { - + WORDS12, WORDS15, WORDS18, @@ -2312,6 +2346,10 @@ enum class WordCount { + + + + diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt index 2802ce1eb..77b240d4c 100644 --- a/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt +++ b/bindings/kotlin/ldk-node-jvm/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.jvm.kt @@ -1525,6 +1525,10 @@ internal typealias UniffiVTableCallbackInterfaceVssHeaderProviderUniffiByValue = + + + + @@ -2115,6 +2119,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, @@ -3216,6 +3230,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( @@ -3743,6 +3761,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") } @@ -6153,6 +6177,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 -> @@ -9566,6 +9614,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { FfiConverterULong.read(buf), FfiConverterOptionalTypeAnchorChannelsConfig.read(buf), FfiConverterOptionalTypeRouteParametersConfig.read(buf), + FfiConverterOptionalTypeScoringFeeParameters.read(buf), + FfiConverterOptionalTypeScoringDecayParameters.read(buf), FfiConverterBoolean.read(buf), FfiConverterTypeAddressType.read(buf), FfiConverterSequenceTypeAddressType.read(buf), @@ -9582,6 +9632,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { 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`) @@ -9597,6 +9649,8 @@ object FfiConverterTypeConfig: FfiConverterRustBuffer { 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) @@ -10256,6 +10310,74 @@ object FfiConverterTypeRuntimeSyncIntervals: FfiConverterRustBuffer { + 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 { + 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 { override fun read(buf: ByteBuffer): SpendableUtxo { return SpendableUtxo( @@ -13157,6 +13279,64 @@ object FfiConverterOptionalTypeRouteParametersConfig: FfiConverterRustBuffer { + 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 { + 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 { override fun read(buf: ByteBuffer): TransactionDetails? { if (buf.get().toInt() == 0) { diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib index b6a407013..2afbf1aa0 100644 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib and b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-aarch64/libldk_node.dylib differ diff --git a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib index 14d3d6861..23e8aedf4 100644 Binary files a/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib and b/bindings/kotlin/ldk-node-jvm/lib/src/main/resources/darwin-x86-64/libldk_node.dylib differ diff --git a/bindings/ldk_node.udl b/bindings/ldk_node.udl index 02169f334..9c04e551f 100644 --- a/bindings/ldk_node.udl +++ b/bindings/ldk_node.udl @@ -16,11 +16,31 @@ dictionary Config { u64 probing_liquidity_limit_multiplier; AnchorChannelsConfig? anchor_channels_config; RouteParametersConfig? route_parameters; + ScoringFeeParameters? scoring_fee_params; + ScoringDecayParameters? scoring_decay_params; boolean include_untrusted_pending_in_spendable; AddressType address_type; sequence address_types_to_monitor; }; +dictionary ScoringFeeParameters { + u64 base_penalty_msat; + u64 base_penalty_amount_multiplier_msat; + u64 liquidity_penalty_multiplier_msat; + u64 liquidity_penalty_amount_multiplier_msat; + u64 historical_liquidity_penalty_multiplier_msat; + u64 historical_liquidity_penalty_amount_multiplier_msat; + u64 anti_probing_penalty_msat; + u64 considered_impossible_penalty_msat; + boolean linear_success_probability; + u64 probing_diversity_penalty_msat; +}; + +dictionary ScoringDecayParameters { + u64 historical_no_updates_half_life_secs; + u64 liquidity_offset_half_life_secs; +}; + dictionary AnchorChannelsConfig { sequence trusted_peers_no_reserve; u64 per_channel_reserve_sats; @@ -129,6 +149,8 @@ interface Builder { void set_gossip_source_p2p(); void set_gossip_source_rgs(string rgs_server_url); void set_pathfinding_scores_source(string url); + void set_scoring_fee_params(ScoringFeeParameters params); + void set_scoring_decay_params(ScoringDecayParameters params); void set_liquidity_source_lsps1(PublicKey node_id, SocketAddress address, string? token); void set_liquidity_source_lsps2(PublicKey node_id, SocketAddress address, string? token); void set_storage_dir_path(string storage_dir_path); diff --git a/bindings/python/src/ldk_node/ldk_node.py b/bindings/python/src/ldk_node/ldk_node.py index 32b486ed6..d67f6da0e 100644 --- a/bindings/python/src/ldk_node/ldk_node.py +++ b/bindings/python/src/ldk_node/ldk_node.py @@ -649,6 +649,10 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source() != 63501: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params() != 19869: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params() != 11588: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_ldk_node_checksum_method_builder_set_storage_dir_path() != 59019: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_ldk_node_checksum_method_feerate_to_sat_per_kwu() != 58911: @@ -1656,6 +1660,18 @@ class _UniffiVTableCallbackInterfaceVssHeaderProvider(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_ldk_node_fn_method_builder_set_pathfinding_scores_source.restype = None +_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_decay_params.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_decay_params.restype = None +_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_fee_params.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_fee_params.restype = None _UniffiLib.uniffi_ldk_node_fn_method_builder_set_storage_dir_path.argtypes = ( ctypes.c_void_p, _UniffiRustBuffer, @@ -3052,6 +3068,12 @@ class _UniffiVTableCallbackInterfaceVssHeaderProvider(ctypes.Structure): _UniffiLib.uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source.argtypes = ( ) _UniffiLib.uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source.restype = ctypes.c_uint16 +_UniffiLib.uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params.argtypes = ( +) +_UniffiLib.uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params.restype = ctypes.c_uint16 +_UniffiLib.uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params.argtypes = ( +) +_UniffiLib.uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params.restype = ctypes.c_uint16 _UniffiLib.uniffi_ldk_node_checksum_method_builder_set_storage_dir_path.argtypes = ( ) _UniffiLib.uniffi_ldk_node_checksum_method_builder_set_storage_dir_path.restype = ctypes.c_uint16 @@ -3581,7 +3603,7 @@ def would_expire(self, at_time_seconds: "int"): class Bolt11Invoice: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -3605,7 +3627,7 @@ def _make_instance_(cls, pointer): @classmethod def from_str(cls, invoice_str: "str"): _UniffiConverterString.check_lower(invoice_str) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_constructor_bolt11invoice_from_str, _UniffiConverterString.lower(invoice_str)) @@ -3750,7 +3772,7 @@ def signable_hash(self, ) -> "typing.List[int]": def would_expire(self, at_time_seconds: "int") -> "bool": _UniffiConverterUInt64.check_lower(at_time_seconds) - + return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_bolt11invoice_would_expire,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(at_time_seconds)) @@ -3859,7 +3881,7 @@ def send_using_amount(self, invoice: "Bolt11Invoice",amount_msat: "int",route_pa class Bolt11Payment: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -3884,11 +3906,11 @@ def _make_instance_(cls, pointer): def claim_for_hash(self, payment_hash: "PaymentHash",claimable_amount_msat: "int",preimage: "PaymentPreimage") -> None: _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + _UniffiConverterUInt64.check_lower(claimable_amount_msat) - + _UniffiConverterTypePaymentPreimage.check_lower(preimage) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_claim_for_hash,self._uniffi_clone_pointer(), _UniffiConverterTypePaymentHash.lower(payment_hash), _UniffiConverterUInt64.lower(claimable_amount_msat), @@ -3901,7 +3923,7 @@ def claim_for_hash(self, payment_hash: "PaymentHash",claimable_amount_msat: "int def estimate_routing_fees(self, invoice: "Bolt11Invoice") -> "int": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + return _UniffiConverterUInt64.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice)) @@ -3913,9 +3935,9 @@ def estimate_routing_fees(self, invoice: "Bolt11Invoice") -> "int": def estimate_routing_fees_using_amount(self, invoice: "Bolt11Invoice",amount_msat: "int") -> "int": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + _UniffiConverterUInt64.check_lower(amount_msat) - + return _UniffiConverterUInt64.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_estimate_routing_fees_using_amount,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice), @@ -3928,7 +3950,7 @@ def estimate_routing_fees_using_amount(self, invoice: "Bolt11Invoice",amount_msa def fail_for_hash(self, payment_hash: "PaymentHash") -> None: _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_fail_for_hash,self._uniffi_clone_pointer(), _UniffiConverterTypePaymentHash.lower(payment_hash)) @@ -3939,11 +3961,11 @@ def fail_for_hash(self, payment_hash: "PaymentHash") -> None: def receive(self, amount_msat: "int",description: "Bolt11InvoiceDescription",expiry_secs: "int") -> "Bolt11Invoice": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -3957,13 +3979,13 @@ def receive(self, amount_msat: "int",description: "Bolt11InvoiceDescription",exp def receive_for_hash(self, amount_msat: "int",description: "Bolt11InvoiceDescription",expiry_secs: "int",payment_hash: "PaymentHash") -> "Bolt11Invoice": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_for_hash,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -3978,9 +4000,9 @@ def receive_for_hash(self, amount_msat: "int",description: "Bolt11InvoiceDescrip def receive_variable_amount(self, description: "Bolt11InvoiceDescription",expiry_secs: "int") -> "Bolt11Invoice": _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11InvoiceDescription.lower(description), @@ -3993,11 +4015,11 @@ def receive_variable_amount(self, description: "Bolt11InvoiceDescription",expiry def receive_variable_amount_for_hash(self, description: "Bolt11InvoiceDescription",expiry_secs: "int",payment_hash: "PaymentHash") -> "Bolt11Invoice": _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_for_hash,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11InvoiceDescription.lower(description), @@ -4011,11 +4033,11 @@ def receive_variable_amount_for_hash(self, description: "Bolt11InvoiceDescriptio def receive_variable_amount_via_jit_channel(self, description: "Bolt11InvoiceDescription",expiry_secs: "int",max_proportional_lsp_fee_limit_ppm_msat: "typing.Optional[int]") -> "Bolt11Invoice": _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(max_proportional_lsp_fee_limit_ppm_msat) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11InvoiceDescription.lower(description), @@ -4029,13 +4051,13 @@ def receive_variable_amount_via_jit_channel(self, description: "Bolt11InvoiceDes def receive_variable_amount_via_jit_channel_for_hash(self, description: "Bolt11InvoiceDescription",expiry_secs: "int",max_proportional_lsp_fee_limit_ppm_msat: "typing.Optional[int]",payment_hash: "PaymentHash") -> "Bolt11Invoice": _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(max_proportional_lsp_fee_limit_ppm_msat) - + _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_variable_amount_via_jit_channel_for_hash,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11InvoiceDescription.lower(description), @@ -4050,13 +4072,13 @@ def receive_variable_amount_via_jit_channel_for_hash(self, description: "Bolt11I def receive_via_jit_channel(self, amount_msat: "int",description: "Bolt11InvoiceDescription",expiry_secs: "int",max_lsp_fee_limit_msat: "typing.Optional[int]") -> "Bolt11Invoice": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(max_lsp_fee_limit_msat) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -4071,15 +4093,15 @@ def receive_via_jit_channel(self, amount_msat: "int",description: "Bolt11Invoice def receive_via_jit_channel_for_hash(self, amount_msat: "int",description: "Bolt11InvoiceDescription",expiry_secs: "int",max_lsp_fee_limit_msat: "typing.Optional[int]",payment_hash: "PaymentHash") -> "Bolt11Invoice": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypeBolt11InvoiceDescription.check_lower(description) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(max_lsp_fee_limit_msat) - + _UniffiConverterTypePaymentHash.check_lower(payment_hash) - + return _UniffiConverterTypeBolt11Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_receive_via_jit_channel_for_hash,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -4095,9 +4117,9 @@ def receive_via_jit_channel_for_hash(self, amount_msat: "int",description: "Bolt def send(self, invoice: "Bolt11Invoice",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_send,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice), @@ -4110,9 +4132,9 @@ def send(self, invoice: "Bolt11Invoice",route_parameters: "typing.Optional[Route def send_probes(self, invoice: "Bolt11Invoice",route_parameters: "typing.Optional[RouteParametersConfig]") -> "typing.List[ProbeHandle]": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterSequenceTypeProbeHandle.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_send_probes,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice), @@ -4125,11 +4147,11 @@ def send_probes(self, invoice: "Bolt11Invoice",route_parameters: "typing.Optiona def send_probes_using_amount(self, invoice: "Bolt11Invoice",amount_msat: "int",route_parameters: "typing.Optional[RouteParametersConfig]") -> "typing.List[ProbeHandle]": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterSequenceTypeProbeHandle.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_send_probes_using_amount,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice), @@ -4143,11 +4165,11 @@ def send_probes_using_amount(self, invoice: "Bolt11Invoice",amount_msat: "int",r def send_using_amount(self, invoice: "Bolt11Invoice",amount_msat: "int",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterTypeBolt11Invoice.check_lower(invoice) - + _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt11payment_send_using_amount,self._uniffi_clone_pointer(), _UniffiConverterTypeBolt11Invoice.lower(invoice), @@ -4235,7 +4257,7 @@ def signing_pubkey(self, ): class Bolt12Invoice: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -4259,7 +4281,7 @@ def _make_instance_(cls, pointer): @classmethod def from_str(cls, invoice_str: "str"): _UniffiConverterString.check_lower(invoice_str) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_constructor_bolt12invoice_from_str, _UniffiConverterString.lower(invoice_str)) @@ -4501,7 +4523,7 @@ def set_paths_to_static_invoice_server(self, paths: "bytes"): class Bolt12Payment: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -4526,7 +4548,7 @@ def _make_instance_(cls, pointer): def blinded_paths_for_async_recipient(self, recipient_id: "bytes") -> "bytes": _UniffiConverterBytes.check_lower(recipient_id) - + return _UniffiConverterBytes.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_blinded_paths_for_async_recipient,self._uniffi_clone_pointer(), _UniffiConverterBytes.lower(recipient_id)) @@ -4538,15 +4560,15 @@ def blinded_paths_for_async_recipient(self, recipient_id: "bytes") -> "bytes": def initiate_refund(self, amount_msat: "int",expiry_secs: "int",quantity: "typing.Optional[int]",payer_note: "typing.Optional[str]",route_parameters: "typing.Optional[RouteParametersConfig]") -> "Refund": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(quantity) - + _UniffiConverterOptionalString.check_lower(payer_note) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypeRefund.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_initiate_refund,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -4562,13 +4584,13 @@ def initiate_refund(self, amount_msat: "int",expiry_secs: "int",quantity: "typin def receive(self, amount_msat: "int",description: "str",expiry_secs: "typing.Optional[int]",quantity: "typing.Optional[int]") -> "Offer": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterString.check_lower(description) - + _UniffiConverterOptionalUInt32.check_lower(expiry_secs) - + _UniffiConverterOptionalUInt64.check_lower(quantity) - + return _UniffiConverterTypeOffer.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_receive,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -4592,9 +4614,9 @@ def receive_async(self, ) -> "Offer": def receive_variable_amount(self, description: "str",expiry_secs: "typing.Optional[int]") -> "Offer": _UniffiConverterString.check_lower(description) - + _UniffiConverterOptionalUInt32.check_lower(expiry_secs) - + return _UniffiConverterTypeOffer.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_receive_variable_amount,self._uniffi_clone_pointer(), _UniffiConverterString.lower(description), @@ -4607,7 +4629,7 @@ def receive_variable_amount(self, description: "str",expiry_secs: "typing.Option def request_refund_payment(self, refund: "Refund") -> "Bolt12Invoice": _UniffiConverterTypeRefund.check_lower(refund) - + return _UniffiConverterTypeBolt12Invoice.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_request_refund_payment,self._uniffi_clone_pointer(), _UniffiConverterTypeRefund.lower(refund)) @@ -4619,13 +4641,13 @@ def request_refund_payment(self, refund: "Refund") -> "Bolt12Invoice": def send(self, offer: "Offer",quantity: "typing.Optional[int]",payer_note: "typing.Optional[str]",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterTypeOffer.check_lower(offer) - + _UniffiConverterOptionalUInt64.check_lower(quantity) - + _UniffiConverterOptionalString.check_lower(payer_note) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_send,self._uniffi_clone_pointer(), _UniffiConverterTypeOffer.lower(offer), @@ -4640,15 +4662,15 @@ def send(self, offer: "Offer",quantity: "typing.Optional[int]",payer_note: "typi def send_using_amount(self, offer: "Offer",amount_msat: "int",quantity: "typing.Optional[int]",payer_note: "typing.Optional[str]",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterTypeOffer.check_lower(offer) - + _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterOptionalUInt64.check_lower(quantity) - + _UniffiConverterOptionalString.check_lower(payer_note) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_send_using_amount,self._uniffi_clone_pointer(), _UniffiConverterTypeOffer.lower(offer), @@ -4664,7 +4686,7 @@ def send_using_amount(self, offer: "Offer",amount_msat: "int",quantity: "typing. def set_paths_to_static_invoice_server(self, paths: "bytes") -> None: _UniffiConverterBytes.check_lower(paths) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_bolt12payment_set_paths_to_static_invoice_server,self._uniffi_clone_pointer(), _UniffiConverterBytes.lower(paths)) @@ -4763,6 +4785,10 @@ def set_node_alias(self, node_alias: "str"): raise NotImplementedError def set_pathfinding_scores_source(self, url: "str"): raise NotImplementedError + def set_scoring_decay_params(self, params: "ScoringDecayParameters"): + raise NotImplementedError + def set_scoring_fee_params(self, params: "ScoringFeeParameters"): + raise NotImplementedError def set_storage_dir_path(self, storage_dir_path: "str"): raise NotImplementedError @@ -4792,7 +4818,7 @@ def _make_instance_(cls, pointer): @classmethod def from_config(cls, config: "Config"): _UniffiConverterTypeConfig.check_lower(config) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_constructor_builder_from_config, _UniffiConverterTypeConfig.lower(config)) @@ -4820,13 +4846,13 @@ def build_with_fs_store(self, ) -> "Node": def build_with_vss_store(self, vss_url: "str",store_id: "str",lnurl_auth_server_url: "str",fixed_headers: "dict[str, str]") -> "Node": _UniffiConverterString.check_lower(vss_url) - + _UniffiConverterString.check_lower(store_id) - + _UniffiConverterString.check_lower(lnurl_auth_server_url) - + _UniffiConverterMapStringString.check_lower(fixed_headers) - + return _UniffiConverterTypeNode.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_build_with_vss_store,self._uniffi_clone_pointer(), _UniffiConverterString.lower(vss_url), @@ -4841,11 +4867,11 @@ def build_with_vss_store(self, vss_url: "str",store_id: "str",lnurl_auth_server_ def build_with_vss_store_and_fixed_headers(self, vss_url: "str",store_id: "str",fixed_headers: "dict[str, str]") -> "Node": _UniffiConverterString.check_lower(vss_url) - + _UniffiConverterString.check_lower(store_id) - + _UniffiConverterMapStringString.check_lower(fixed_headers) - + return _UniffiConverterTypeNode.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_fixed_headers,self._uniffi_clone_pointer(), _UniffiConverterString.lower(vss_url), @@ -4859,11 +4885,11 @@ def build_with_vss_store_and_fixed_headers(self, vss_url: "str",store_id: "str", def build_with_vss_store_and_header_provider(self, vss_url: "str",store_id: "str",header_provider: "VssHeaderProvider") -> "Node": _UniffiConverterString.check_lower(vss_url) - + _UniffiConverterString.check_lower(store_id) - + _UniffiConverterTypeVssHeaderProvider.check_lower(header_provider) - + return _UniffiConverterTypeNode.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_build_with_vss_store_and_header_provider,self._uniffi_clone_pointer(), _UniffiConverterString.lower(vss_url), @@ -4877,7 +4903,7 @@ def build_with_vss_store_and_header_provider(self, vss_url: "str",store_id: "str def set_accept_stale_channel_monitors(self, accept: "bool") -> None: _UniffiConverterBool.check_lower(accept) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_accept_stale_channel_monitors,self._uniffi_clone_pointer(), _UniffiConverterBool.lower(accept)) @@ -4888,7 +4914,7 @@ def set_accept_stale_channel_monitors(self, accept: "bool") -> None: def set_address_type(self, address_type: "AddressType") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_address_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type)) @@ -4899,7 +4925,7 @@ def set_address_type(self, address_type: "AddressType") -> None: def set_address_types_to_monitor(self, address_types_to_monitor: "typing.List[AddressType]") -> None: _UniffiConverterSequenceTypeAddressType.check_lower(address_types_to_monitor) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_address_types_to_monitor,self._uniffi_clone_pointer(), _UniffiConverterSequenceTypeAddressType.lower(address_types_to_monitor)) @@ -4910,7 +4936,7 @@ def set_address_types_to_monitor(self, address_types_to_monitor: "typing.List[Ad def set_announcement_addresses(self, announcement_addresses: "typing.List[SocketAddress]") -> None: _UniffiConverterSequenceTypeSocketAddress.check_lower(announcement_addresses) - + _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_set_announcement_addresses,self._uniffi_clone_pointer(), _UniffiConverterSequenceTypeSocketAddress.lower(announcement_addresses)) @@ -4921,7 +4947,7 @@ def set_announcement_addresses(self, announcement_addresses: "typing.List[Socket def set_async_payments_role(self, role: "typing.Optional[AsyncPaymentsRole]") -> None: _UniffiConverterOptionalTypeAsyncPaymentsRole.check_lower(role) - + _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_set_async_payments_role,self._uniffi_clone_pointer(), _UniffiConverterOptionalTypeAsyncPaymentsRole.lower(role)) @@ -4932,17 +4958,17 @@ def set_async_payments_role(self, role: "typing.Optional[AsyncPaymentsRole]") -> def set_chain_source_bitcoind_rest(self, rest_host: "str",rest_port: "int",rpc_host: "str",rpc_port: "int",rpc_user: "str",rpc_password: "str") -> None: _UniffiConverterString.check_lower(rest_host) - + _UniffiConverterUInt16.check_lower(rest_port) - + _UniffiConverterString.check_lower(rpc_host) - + _UniffiConverterUInt16.check_lower(rpc_port) - + _UniffiConverterString.check_lower(rpc_user) - + _UniffiConverterString.check_lower(rpc_password) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rest,self._uniffi_clone_pointer(), _UniffiConverterString.lower(rest_host), _UniffiConverterUInt16.lower(rest_port), @@ -4958,13 +4984,13 @@ def set_chain_source_bitcoind_rest(self, rest_host: "str",rest_port: "int",rpc_h def set_chain_source_bitcoind_rpc(self, rpc_host: "str",rpc_port: "int",rpc_user: "str",rpc_password: "str") -> None: _UniffiConverterString.check_lower(rpc_host) - + _UniffiConverterUInt16.check_lower(rpc_port) - + _UniffiConverterString.check_lower(rpc_user) - + _UniffiConverterString.check_lower(rpc_password) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_chain_source_bitcoind_rpc,self._uniffi_clone_pointer(), _UniffiConverterString.lower(rpc_host), _UniffiConverterUInt16.lower(rpc_port), @@ -4978,9 +5004,9 @@ def set_chain_source_bitcoind_rpc(self, rpc_host: "str",rpc_port: "int",rpc_user def set_chain_source_electrum(self, server_url: "str",config: "typing.Optional[ElectrumSyncConfig]") -> None: _UniffiConverterString.check_lower(server_url) - + _UniffiConverterOptionalTypeElectrumSyncConfig.check_lower(config) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_chain_source_electrum,self._uniffi_clone_pointer(), _UniffiConverterString.lower(server_url), _UniffiConverterOptionalTypeElectrumSyncConfig.lower(config)) @@ -4992,9 +5018,9 @@ def set_chain_source_electrum(self, server_url: "str",config: "typing.Optional[E def set_chain_source_esplora(self, server_url: "str",config: "typing.Optional[EsploraSyncConfig]") -> None: _UniffiConverterString.check_lower(server_url) - + _UniffiConverterOptionalTypeEsploraSyncConfig.check_lower(config) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_chain_source_esplora,self._uniffi_clone_pointer(), _UniffiConverterString.lower(server_url), _UniffiConverterOptionalTypeEsploraSyncConfig.lower(config)) @@ -5006,7 +5032,7 @@ def set_chain_source_esplora(self, server_url: "str",config: "typing.Optional[Es def set_channel_data_migration(self, migration: "ChannelDataMigration") -> None: _UniffiConverterTypeChannelDataMigration.check_lower(migration) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_channel_data_migration,self._uniffi_clone_pointer(), _UniffiConverterTypeChannelDataMigration.lower(migration)) @@ -5017,7 +5043,7 @@ def set_channel_data_migration(self, migration: "ChannelDataMigration") -> None: def set_custom_logger(self, log_writer: "LogWriter") -> None: _UniffiConverterTypeLogWriter.check_lower(log_writer) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_custom_logger,self._uniffi_clone_pointer(), _UniffiConverterTypeLogWriter.lower(log_writer)) @@ -5028,9 +5054,9 @@ def set_custom_logger(self, log_writer: "LogWriter") -> None: def set_entropy_bip39_mnemonic(self, mnemonic: "Mnemonic",passphrase: "typing.Optional[str]") -> None: _UniffiConverterTypeMnemonic.check_lower(mnemonic) - + _UniffiConverterOptionalString.check_lower(passphrase) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_entropy_bip39_mnemonic,self._uniffi_clone_pointer(), _UniffiConverterTypeMnemonic.lower(mnemonic), _UniffiConverterOptionalString.lower(passphrase)) @@ -5042,7 +5068,7 @@ def set_entropy_bip39_mnemonic(self, mnemonic: "Mnemonic",passphrase: "typing.Op def set_entropy_seed_bytes(self, seed_bytes: "typing.List[int]") -> None: _UniffiConverterSequenceUInt8.check_lower(seed_bytes) - + _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_set_entropy_seed_bytes,self._uniffi_clone_pointer(), _UniffiConverterSequenceUInt8.lower(seed_bytes)) @@ -5053,7 +5079,7 @@ def set_entropy_seed_bytes(self, seed_bytes: "typing.List[int]") -> None: def set_entropy_seed_path(self, seed_path: "str") -> None: _UniffiConverterString.check_lower(seed_path) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_entropy_seed_path,self._uniffi_clone_pointer(), _UniffiConverterString.lower(seed_path)) @@ -5064,9 +5090,9 @@ def set_entropy_seed_path(self, seed_path: "str") -> None: def set_filesystem_logger(self, log_file_path: "typing.Optional[str]",max_log_level: "typing.Optional[LogLevel]") -> None: _UniffiConverterOptionalString.check_lower(log_file_path) - + _UniffiConverterOptionalTypeLogLevel.check_lower(max_log_level) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_filesystem_logger,self._uniffi_clone_pointer(), _UniffiConverterOptionalString.lower(log_file_path), _UniffiConverterOptionalTypeLogLevel.lower(max_log_level)) @@ -5086,7 +5112,7 @@ def set_gossip_source_p2p(self, ) -> None: def set_gossip_source_rgs(self, rgs_server_url: "str") -> None: _UniffiConverterString.check_lower(rgs_server_url) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_gossip_source_rgs,self._uniffi_clone_pointer(), _UniffiConverterString.lower(rgs_server_url)) @@ -5097,11 +5123,11 @@ def set_gossip_source_rgs(self, rgs_server_url: "str") -> None: def set_liquidity_source_lsps1(self, node_id: "PublicKey",address: "SocketAddress",token: "typing.Optional[str]") -> None: _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypeSocketAddress.check_lower(address) - + _UniffiConverterOptionalString.check_lower(token) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps1,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id), _UniffiConverterTypeSocketAddress.lower(address), @@ -5114,11 +5140,11 @@ def set_liquidity_source_lsps1(self, node_id: "PublicKey",address: "SocketAddres def set_liquidity_source_lsps2(self, node_id: "PublicKey",address: "SocketAddress",token: "typing.Optional[str]") -> None: _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypeSocketAddress.check_lower(address) - + _UniffiConverterOptionalString.check_lower(token) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_liquidity_source_lsps2,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id), _UniffiConverterTypeSocketAddress.lower(address), @@ -5131,7 +5157,7 @@ def set_liquidity_source_lsps2(self, node_id: "PublicKey",address: "SocketAddres def set_listening_addresses(self, listening_addresses: "typing.List[SocketAddress]") -> None: _UniffiConverterSequenceTypeSocketAddress.check_lower(listening_addresses) - + _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_set_listening_addresses,self._uniffi_clone_pointer(), _UniffiConverterSequenceTypeSocketAddress.lower(listening_addresses)) @@ -5150,7 +5176,7 @@ def set_log_facade_logger(self, ) -> None: def set_network(self, network: "Network") -> None: _UniffiConverterTypeNetwork.check_lower(network) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_network,self._uniffi_clone_pointer(), _UniffiConverterTypeNetwork.lower(network)) @@ -5161,7 +5187,7 @@ def set_network(self, network: "Network") -> None: def set_node_alias(self, node_alias: "str") -> None: _UniffiConverterString.check_lower(node_alias) - + _uniffi_rust_call_with_error(_UniffiConverterTypeBuildError,_UniffiLib.uniffi_ldk_node_fn_method_builder_set_node_alias,self._uniffi_clone_pointer(), _UniffiConverterString.lower(node_alias)) @@ -5172,7 +5198,7 @@ def set_node_alias(self, node_alias: "str") -> None: def set_pathfinding_scores_source(self, url: "str") -> None: _UniffiConverterString.check_lower(url) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_pathfinding_scores_source,self._uniffi_clone_pointer(), _UniffiConverterString.lower(url)) @@ -5181,9 +5207,31 @@ def set_pathfinding_scores_source(self, url: "str") -> None: + def set_scoring_decay_params(self, params: "ScoringDecayParameters") -> None: + _UniffiConverterTypeScoringDecayParameters.check_lower(params) + + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_decay_params,self._uniffi_clone_pointer(), + _UniffiConverterTypeScoringDecayParameters.lower(params)) + + + + + + + def set_scoring_fee_params(self, params: "ScoringFeeParameters") -> None: + _UniffiConverterTypeScoringFeeParameters.check_lower(params) + + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_scoring_fee_params,self._uniffi_clone_pointer(), + _UniffiConverterTypeScoringFeeParameters.lower(params)) + + + + + + def set_storage_dir_path(self, storage_dir_path: "str") -> None: _UniffiConverterString.check_lower(storage_dir_path) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_builder_set_storage_dir_path,self._uniffi_clone_pointer(), _UniffiConverterString.lower(storage_dir_path)) @@ -5234,7 +5282,7 @@ def to_sat_per_vb_floor(self, ): class FeeRate: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -5258,7 +5306,7 @@ def _make_instance_(cls, pointer): @classmethod def from_sat_per_kwu(cls, sat_kwu: "int"): _UniffiConverterUInt64.check_lower(sat_kwu) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_constructor_feerate_from_sat_per_kwu, _UniffiConverterUInt64.lower(sat_kwu)) @@ -5267,7 +5315,7 @@ def from_sat_per_kwu(cls, sat_kwu: "int"): @classmethod def from_sat_per_vb_unchecked(cls, sat_vb: "int"): _UniffiConverterUInt64.check_lower(sat_vb) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_constructor_feerate_from_sat_per_vb_unchecked, _UniffiConverterUInt64.lower(sat_vb)) @@ -5340,7 +5388,7 @@ def log(self, record: "LogRecord"): class LogWriterImpl: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -5365,7 +5413,7 @@ def _make_instance_(cls, pointer): def log(self, record: "LogRecord") -> None: _UniffiConverterTypeLogRecord.check_lower(record) - + _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_logwriter_log,self._uniffi_clone_pointer(), _UniffiConverterTypeLogRecord.lower(record)) @@ -5422,7 +5470,7 @@ def make_call(): method = uniffi_obj.log return method(*args) - + write_return_value = lambda v: None _uniffi_trait_interface_call( uniffi_call_status_ptr.contents, @@ -5482,7 +5530,7 @@ def request_channel(self, lsp_balance_sat: "int",client_balance_sat: "int",chann class Lsps1Liquidity: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -5507,7 +5555,7 @@ def _make_instance_(cls, pointer): def check_order_status(self, order_id: "Lsps1OrderId") -> "Lsps1OrderStatus": _UniffiConverterTypeLsps1OrderId.check_lower(order_id) - + return _UniffiConverterTypeLsps1OrderStatus.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_lsps1liquidity_check_order_status,self._uniffi_clone_pointer(), _UniffiConverterTypeLsps1OrderId.lower(order_id)) @@ -5519,13 +5567,13 @@ def check_order_status(self, order_id: "Lsps1OrderId") -> "Lsps1OrderStatus": def request_channel(self, lsp_balance_sat: "int",client_balance_sat: "int",channel_expiry_blocks: "int",announce_channel: "bool") -> "Lsps1OrderStatus": _UniffiConverterUInt64.check_lower(lsp_balance_sat) - + _UniffiConverterUInt64.check_lower(client_balance_sat) - + _UniffiConverterUInt32.check_lower(channel_expiry_blocks) - + _UniffiConverterBool.check_lower(announce_channel) - + return _UniffiConverterTypeLsps1OrderStatus.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_lsps1liquidity_request_channel,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(lsp_balance_sat), @@ -5582,7 +5630,7 @@ def node(self, node_id: "NodeId"): class NetworkGraph: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -5607,7 +5655,7 @@ def _make_instance_(cls, pointer): def channel(self, short_channel_id: "int") -> "typing.Optional[ChannelInfo]": _UniffiConverterUInt64.check_lower(short_channel_id) - + return _UniffiConverterOptionalTypeChannelInfo.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_networkgraph_channel,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(short_channel_id)) @@ -5637,7 +5685,7 @@ def list_nodes(self, ) -> "typing.List[NodeId]": def node(self, node_id: "NodeId") -> "typing.Optional[NodeInfo]": _UniffiConverterTypeNodeId.check_lower(node_id) - + return _UniffiConverterOptionalTypeNodeInfo.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_networkgraph_node,self._uniffi_clone_pointer(), _UniffiConverterTypeNodeId.lower(node_id)) @@ -5781,7 +5829,7 @@ def wait_next_event(self, ): class Node: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -5806,9 +5854,9 @@ def _make_instance_(cls, pointer): def add_address_type_to_monitor(self, address_type: "AddressType",seed_bytes: "typing.List[int]") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterSequenceUInt8.check_lower(seed_bytes) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_add_address_type_to_monitor,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), _UniffiConverterSequenceUInt8.lower(seed_bytes)) @@ -5820,11 +5868,11 @@ def add_address_type_to_monitor(self, address_type: "AddressType",seed_bytes: "t def add_address_type_to_monitor_with_mnemonic(self, address_type: "AddressType",mnemonic: "Mnemonic",passphrase: "typing.Optional[str]") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterTypeMnemonic.check_lower(mnemonic) - + _UniffiConverterOptionalString.check_lower(passphrase) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_add_address_type_to_monitor_with_mnemonic,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), _UniffiConverterTypeMnemonic.lower(mnemonic), @@ -5864,9 +5912,9 @@ def bolt12_payment(self, ) -> "Bolt12Payment": def close_channel(self, user_channel_id: "UserChannelId",counterparty_node_id: "PublicKey") -> None: _UniffiConverterTypeUserChannelId.check_lower(user_channel_id) - + _UniffiConverterTypePublicKey.check_lower(counterparty_node_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_close_channel,self._uniffi_clone_pointer(), _UniffiConverterTypeUserChannelId.lower(user_channel_id), _UniffiConverterTypePublicKey.lower(counterparty_node_id)) @@ -5887,11 +5935,11 @@ def config(self, ) -> "Config": def connect(self, node_id: "PublicKey",address: "SocketAddress",persist: "bool") -> None: _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypeSocketAddress.check_lower(address) - + _UniffiConverterBool.check_lower(persist) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_connect,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id), _UniffiConverterTypeSocketAddress.lower(address), @@ -5913,7 +5961,7 @@ def current_sync_intervals(self, ) -> "RuntimeSyncIntervals": def disconnect(self, node_id: "PublicKey") -> None: _UniffiConverterTypePublicKey.check_lower(node_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_disconnect,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id)) @@ -5941,11 +5989,11 @@ def export_pathfinding_scores(self, ) -> "bytes": def force_close_channel(self, user_channel_id: "UserChannelId",counterparty_node_id: "PublicKey",reason: "typing.Optional[str]") -> None: _UniffiConverterTypeUserChannelId.check_lower(user_channel_id) - + _UniffiConverterTypePublicKey.check_lower(counterparty_node_id) - + _UniffiConverterOptionalString.check_lower(reason) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_force_close_channel,self._uniffi_clone_pointer(), _UniffiConverterTypeUserChannelId.lower(user_channel_id), _UniffiConverterTypePublicKey.lower(counterparty_node_id), @@ -5958,7 +6006,7 @@ def force_close_channel(self, user_channel_id: "UserChannelId",counterparty_node def get_address_balance(self, address_str: "str") -> "int": _UniffiConverterString.check_lower(address_str) - + return _UniffiConverterUInt64.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_get_address_balance,self._uniffi_clone_pointer(), _UniffiConverterString.lower(address_str)) @@ -5970,7 +6018,7 @@ def get_address_balance(self, address_str: "str") -> "int": def get_balance_for_address_type(self, address_type: "AddressType") -> "AddressTypeBalance": _UniffiConverterTypeAddressType.check_lower(address_type) - + return _UniffiConverterTypeAddressTypeBalance.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_get_balance_for_address_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type)) @@ -5982,7 +6030,7 @@ def get_balance_for_address_type(self, address_type: "AddressType") -> "AddressT def get_transaction_details(self, txid: "Txid") -> "typing.Optional[TransactionDetails]": _UniffiConverterTypeTxid.check_lower(txid) - + return _UniffiConverterOptionalTypeTransactionDetails.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_node_get_transaction_details,self._uniffi_clone_pointer(), _UniffiConverterTypeTxid.lower(txid)) @@ -6075,14 +6123,14 @@ def next_event(self, ) -> "typing.Optional[Event]": async def next_event_async(self, ) -> "Event": return await _uniffi_rust_call_async( _UniffiLib.uniffi_ldk_node_fn_method_node_next_event_async( - self._uniffi_clone_pointer(), + self._uniffi_clone_pointer(), ), _UniffiLib.ffi_ldk_node_rust_future_poll_rust_buffer, _UniffiLib.ffi_ldk_node_rust_future_complete_rust_buffer, _UniffiLib.ffi_ldk_node_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeEvent.lift, - + # Error FFI converter None, @@ -6121,15 +6169,15 @@ def onchain_payment(self, ) -> "OnchainPayment": def open_announced_channel(self, node_id: "PublicKey",address: "SocketAddress",channel_amount_sats: "int",push_to_counterparty_msat: "typing.Optional[int]",channel_config: "typing.Optional[ChannelConfig]") -> "UserChannelId": _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypeSocketAddress.check_lower(address) - + _UniffiConverterUInt64.check_lower(channel_amount_sats) - + _UniffiConverterOptionalUInt64.check_lower(push_to_counterparty_msat) - + _UniffiConverterOptionalTypeChannelConfig.check_lower(channel_config) - + return _UniffiConverterTypeUserChannelId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_open_announced_channel,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id), @@ -6145,15 +6193,15 @@ def open_announced_channel(self, node_id: "PublicKey",address: "SocketAddress",c def open_channel(self, node_id: "PublicKey",address: "SocketAddress",channel_amount_sats: "int",push_to_counterparty_msat: "typing.Optional[int]",channel_config: "typing.Optional[ChannelConfig]") -> "UserChannelId": _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypeSocketAddress.check_lower(address) - + _UniffiConverterUInt64.check_lower(channel_amount_sats) - + _UniffiConverterOptionalUInt64.check_lower(push_to_counterparty_msat) - + _UniffiConverterOptionalTypeChannelConfig.check_lower(channel_config) - + return _UniffiConverterTypeUserChannelId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_open_channel,self._uniffi_clone_pointer(), _UniffiConverterTypePublicKey.lower(node_id), @@ -6169,7 +6217,7 @@ def open_channel(self, node_id: "PublicKey",address: "SocketAddress",channel_amo def payment(self, payment_id: "PaymentId") -> "typing.Optional[PaymentDetails]": _UniffiConverterTypePaymentId.check_lower(payment_id) - + return _UniffiConverterOptionalTypePaymentDetails.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_node_payment,self._uniffi_clone_pointer(), _UniffiConverterTypePaymentId.lower(payment_id)) @@ -6181,7 +6229,7 @@ def payment(self, payment_id: "PaymentId") -> "typing.Optional[PaymentDetails]": def remove_address_type_from_monitor(self, address_type: "AddressType") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_remove_address_type_from_monitor,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type)) @@ -6192,7 +6240,7 @@ def remove_address_type_from_monitor(self, address_type: "AddressType") -> None: def remove_payment(self, payment_id: "PaymentId") -> None: _UniffiConverterTypePaymentId.check_lower(payment_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_remove_payment,self._uniffi_clone_pointer(), _UniffiConverterTypePaymentId.lower(payment_id)) @@ -6203,9 +6251,9 @@ def remove_payment(self, payment_id: "PaymentId") -> None: def set_primary_address_type(self, address_type: "AddressType",seed_bytes: "typing.List[int]") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterSequenceUInt8.check_lower(seed_bytes) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_set_primary_address_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), _UniffiConverterSequenceUInt8.lower(seed_bytes)) @@ -6217,11 +6265,11 @@ def set_primary_address_type(self, address_type: "AddressType",seed_bytes: "typi def set_primary_address_type_with_mnemonic(self, address_type: "AddressType",mnemonic: "Mnemonic",passphrase: "typing.Optional[str]") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterTypeMnemonic.check_lower(mnemonic) - + _UniffiConverterOptionalString.check_lower(passphrase) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_set_primary_address_type_with_mnemonic,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), _UniffiConverterTypeMnemonic.lower(mnemonic), @@ -6234,7 +6282,7 @@ def set_primary_address_type_with_mnemonic(self, address_type: "AddressType",mne def sign_message(self, msg: "typing.List[int]") -> "str": _UniffiConverterSequenceUInt8.check_lower(msg) - + return _UniffiConverterString.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_node_sign_message,self._uniffi_clone_pointer(), _UniffiConverterSequenceUInt8.lower(msg)) @@ -6246,11 +6294,11 @@ def sign_message(self, msg: "typing.List[int]") -> "str": def splice_in(self, user_channel_id: "UserChannelId",counterparty_node_id: "PublicKey",splice_amount_sats: "int") -> None: _UniffiConverterTypeUserChannelId.check_lower(user_channel_id) - + _UniffiConverterTypePublicKey.check_lower(counterparty_node_id) - + _UniffiConverterUInt64.check_lower(splice_amount_sats) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_splice_in,self._uniffi_clone_pointer(), _UniffiConverterTypeUserChannelId.lower(user_channel_id), _UniffiConverterTypePublicKey.lower(counterparty_node_id), @@ -6263,13 +6311,13 @@ def splice_in(self, user_channel_id: "UserChannelId",counterparty_node_id: "Publ def splice_out(self, user_channel_id: "UserChannelId",counterparty_node_id: "PublicKey",address: "Address",splice_amount_sats: "int") -> None: _UniffiConverterTypeUserChannelId.check_lower(user_channel_id) - + _UniffiConverterTypePublicKey.check_lower(counterparty_node_id) - + _UniffiConverterTypeAddress.check_lower(address) - + _UniffiConverterUInt64.check_lower(splice_amount_sats) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_splice_out,self._uniffi_clone_pointer(), _UniffiConverterTypeUserChannelId.lower(user_channel_id), _UniffiConverterTypePublicKey.lower(counterparty_node_id), @@ -6334,11 +6382,11 @@ def unified_qr_payment(self, ) -> "UnifiedQrPayment": def update_channel_config(self, user_channel_id: "UserChannelId",counterparty_node_id: "PublicKey",channel_config: "ChannelConfig") -> None: _UniffiConverterTypeUserChannelId.check_lower(user_channel_id) - + _UniffiConverterTypePublicKey.check_lower(counterparty_node_id) - + _UniffiConverterTypeChannelConfig.check_lower(channel_config) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_update_channel_config,self._uniffi_clone_pointer(), _UniffiConverterTypeUserChannelId.lower(user_channel_id), _UniffiConverterTypePublicKey.lower(counterparty_node_id), @@ -6351,7 +6399,7 @@ def update_channel_config(self, user_channel_id: "UserChannelId",counterparty_no def update_sync_intervals(self, intervals: "RuntimeSyncIntervals") -> None: _UniffiConverterTypeRuntimeSyncIntervals.check_lower(intervals) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_node_update_sync_intervals,self._uniffi_clone_pointer(), _UniffiConverterTypeRuntimeSyncIntervals.lower(intervals)) @@ -6362,11 +6410,11 @@ def update_sync_intervals(self, intervals: "RuntimeSyncIntervals") -> None: def verify_signature(self, msg: "typing.List[int]",sig: "str",pkey: "PublicKey") -> "bool": _UniffiConverterSequenceUInt8.check_lower(msg) - + _UniffiConverterString.check_lower(sig) - + _UniffiConverterTypePublicKey.check_lower(pkey) - + return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_node_verify_signature,self._uniffi_clone_pointer(), _UniffiConverterSequenceUInt8.lower(msg), @@ -6447,7 +6495,7 @@ def supports_chain(self, chain: "Network"): class Offer: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -6471,7 +6519,7 @@ def _make_instance_(cls, pointer): @classmethod def from_str(cls, offer_str: "str"): _UniffiConverterString.check_lower(offer_str) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_constructor_offer_from_str, _UniffiConverterString.lower(offer_str)) @@ -6535,7 +6583,7 @@ def is_expired(self, ) -> "bool": def is_valid_quantity(self, quantity: "int") -> "bool": _UniffiConverterUInt64.check_lower(quantity) - + return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_offer_is_valid_quantity,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(quantity)) @@ -6583,7 +6631,7 @@ def offer_description(self, ) -> "typing.Optional[str]": def supports_chain(self, chain: "Network") -> "bool": _UniffiConverterTypeNetwork.check_lower(chain) - + return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_method_offer_supports_chain,self._uniffi_clone_pointer(), _UniffiConverterTypeNetwork.lower(chain)) @@ -6692,7 +6740,7 @@ def send_to_address(self, address: "Address",amount_sats: "int",fee_rate: "typin class OnchainPayment: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -6717,11 +6765,11 @@ def _make_instance_(cls, pointer): def accelerate_by_cpfp(self, txid: "Txid",fee_rate: "typing.Optional[FeeRate]",destination_address: "typing.Optional[Address]") -> "Txid": _UniffiConverterTypeTxid.check_lower(txid) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + _UniffiConverterOptionalTypeAddress.check_lower(destination_address) - + return _UniffiConverterTypeTxid.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_accelerate_by_cpfp,self._uniffi_clone_pointer(), _UniffiConverterTypeTxid.lower(txid), @@ -6735,11 +6783,11 @@ def accelerate_by_cpfp(self, txid: "Txid",fee_rate: "typing.Optional[FeeRate]",d def address_info_for_type_at_index(self, address_type: "AddressType",keychain: "KeychainKind",index: "int") -> "AddressInfo": _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterTypeKeychainKind.check_lower(keychain) - + _UniffiConverterUInt32.check_lower(index) - + return _UniffiConverterTypeAddressInfo.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_address_info_for_type_at_index,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), @@ -6753,13 +6801,13 @@ def address_info_for_type_at_index(self, address_type: "AddressType",keychain: " def address_infos_for_type(self, address_type: "AddressType",keychain: "KeychainKind",start_index: "int",count: "int") -> "typing.List[AddressInfo]": _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterTypeKeychainKind.check_lower(keychain) - + _UniffiConverterUInt32.check_lower(start_index) - + _UniffiConverterUInt32.check_lower(count) - + return _UniffiConverterSequenceTypeAddressInfo.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_address_infos_for_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), @@ -6774,9 +6822,9 @@ def address_infos_for_type(self, address_type: "AddressType",keychain: "Keychain def bump_fee_by_rbf(self, txid: "Txid",fee_rate: "FeeRate") -> "Txid": _UniffiConverterTypeTxid.check_lower(txid) - + _UniffiConverterTypeFeeRate.check_lower(fee_rate) - + return _UniffiConverterTypeTxid.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_bump_fee_by_rbf,self._uniffi_clone_pointer(), _UniffiConverterTypeTxid.lower(txid), @@ -6789,9 +6837,9 @@ def bump_fee_by_rbf(self, txid: "Txid",fee_rate: "FeeRate") -> "Txid": def calculate_cpfp_fee_rate(self, parent_txid: "Txid",urgent: "bool") -> "FeeRate": _UniffiConverterTypeTxid.check_lower(parent_txid) - + _UniffiConverterBool.check_lower(urgent) - + return _UniffiConverterTypeFeeRate.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_calculate_cpfp_fee_rate,self._uniffi_clone_pointer(), _UniffiConverterTypeTxid.lower(parent_txid), @@ -6804,11 +6852,11 @@ def calculate_cpfp_fee_rate(self, parent_txid: "Txid",urgent: "bool") -> "FeeRat def calculate_send_all_fee(self, address: "Address",retain_reserves: "bool",fee_rate: "typing.Optional[FeeRate]") -> "int": _UniffiConverterTypeAddress.check_lower(address) - + _UniffiConverterBool.check_lower(retain_reserves) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + return _UniffiConverterUInt64.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_calculate_send_all_fee,self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), @@ -6822,13 +6870,13 @@ def calculate_send_all_fee(self, address: "Address",retain_reserves: "bool",fee_ def calculate_total_fee(self, address: "Address",amount_sats: "int",fee_rate: "typing.Optional[FeeRate]",utxos_to_spend: "typing.Optional[typing.List[SpendableUtxo]]") -> "int": _UniffiConverterTypeAddress.check_lower(address) - + _UniffiConverterUInt64.check_lower(amount_sats) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + _UniffiConverterOptionalSequenceTypeSpendableUtxo.check_lower(utxos_to_spend) - + return _UniffiConverterUInt64.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_calculate_total_fee,self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), @@ -6861,7 +6909,7 @@ def new_address(self, ) -> "Address": def new_address_for_type(self, address_type: "AddressType") -> "Address": _UniffiConverterTypeAddressType.check_lower(address_type) - + return _UniffiConverterTypeAddress.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_new_address_for_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type)) @@ -6882,7 +6930,7 @@ def new_address_info(self, ) -> "AddressInfo": def new_address_info_for_type(self, address_type: "AddressType") -> "AddressInfo": _UniffiConverterTypeAddressType.check_lower(address_type) - + return _UniffiConverterTypeAddressInfo.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_new_address_info_for_type,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type)) @@ -6894,9 +6942,9 @@ def new_address_info_for_type(self, address_type: "AddressType") -> "AddressInfo def reveal_receive_addresses_to(self, address_type: "AddressType",index: "int") -> None: _UniffiConverterTypeAddressType.check_lower(address_type) - + _UniffiConverterUInt32.check_lower(index) - + _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_reveal_receive_addresses_to,self._uniffi_clone_pointer(), _UniffiConverterTypeAddressType.lower(address_type), _UniffiConverterUInt32.lower(index)) @@ -6908,13 +6956,13 @@ def reveal_receive_addresses_to(self, address_type: "AddressType",index: "int") def select_utxos_with_algorithm(self, target_amount_sats: "int",fee_rate: "typing.Optional[FeeRate]",algorithm: "CoinSelectionAlgorithm",utxos: "typing.Optional[typing.List[SpendableUtxo]]") -> "typing.List[SpendableUtxo]": _UniffiConverterUInt64.check_lower(target_amount_sats) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + _UniffiConverterTypeCoinSelectionAlgorithm.check_lower(algorithm) - + _UniffiConverterOptionalSequenceTypeSpendableUtxo.check_lower(utxos) - + return _UniffiConverterSequenceTypeSpendableUtxo.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_select_utxos_with_algorithm,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(target_amount_sats), @@ -6929,11 +6977,11 @@ def select_utxos_with_algorithm(self, target_amount_sats: "int",fee_rate: "typin def send_all_to_address(self, address: "Address",retain_reserve: "bool",fee_rate: "typing.Optional[FeeRate]") -> "Txid": _UniffiConverterTypeAddress.check_lower(address) - + _UniffiConverterBool.check_lower(retain_reserve) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + return _UniffiConverterTypeTxid.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_send_all_to_address,self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), @@ -6947,13 +6995,13 @@ def send_all_to_address(self, address: "Address",retain_reserve: "bool",fee_rate def send_to_address(self, address: "Address",amount_sats: "int",fee_rate: "typing.Optional[FeeRate]",utxos_to_spend: "typing.Optional[typing.List[SpendableUtxo]]") -> "Txid": _UniffiConverterTypeAddress.check_lower(address) - + _UniffiConverterUInt64.check_lower(amount_sats) - + _UniffiConverterOptionalTypeFeeRate.check_lower(fee_rate) - + _UniffiConverterOptionalSequenceTypeSpendableUtxo.check_lower(utxos_to_spend) - + return _UniffiConverterTypeTxid.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_onchainpayment_send_to_address,self._uniffi_clone_pointer(), _UniffiConverterTypeAddress.lower(address), @@ -7022,7 +7070,7 @@ def refund_description(self, ): class Refund: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -7046,7 +7094,7 @@ def _make_instance_(cls, pointer): @classmethod def from_str(cls, refund_str: "str"): _UniffiConverterString.check_lower(refund_str) - + # Call the (fallible) function before creating any half-baked object instances. pointer = _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_constructor_refund_from_str, _UniffiConverterString.lower(refund_str)) @@ -7221,7 +7269,7 @@ def send_with_preimage_and_custom_tlvs(self, amount_msat: "int",node_id: "Public class SpontaneousPayment: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -7246,11 +7294,11 @@ def _make_instance_(cls, pointer): def send(self, amount_msat: "int",node_id: "PublicKey",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_spontaneouspayment_send,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -7264,9 +7312,9 @@ def send(self, amount_msat: "int",node_id: "PublicKey",route_parameters: "typing def send_probes(self, amount_msat: "int",node_id: "PublicKey") -> "typing.List[ProbeHandle]": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypePublicKey.check_lower(node_id) - + return _UniffiConverterSequenceTypeProbeHandle.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_spontaneouspayment_send_probes,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -7279,13 +7327,13 @@ def send_probes(self, amount_msat: "int",node_id: "PublicKey") -> "typing.List[P def send_with_custom_tlvs(self, amount_msat: "int",node_id: "PublicKey",route_parameters: "typing.Optional[RouteParametersConfig]",custom_tlvs: "typing.List[CustomTlvRecord]") -> "PaymentId": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + _UniffiConverterSequenceTypeCustomTlvRecord.check_lower(custom_tlvs) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_custom_tlvs,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -7300,13 +7348,13 @@ def send_with_custom_tlvs(self, amount_msat: "int",node_id: "PublicKey",route_pa def send_with_preimage(self, amount_msat: "int",node_id: "PublicKey",preimage: "PaymentPreimage",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterTypePaymentPreimage.check_lower(preimage) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -7321,15 +7369,15 @@ def send_with_preimage(self, amount_msat: "int",node_id: "PublicKey",preimage: " def send_with_preimage_and_custom_tlvs(self, amount_msat: "int",node_id: "PublicKey",custom_tlvs: "typing.List[CustomTlvRecord]",preimage: "PaymentPreimage",route_parameters: "typing.Optional[RouteParametersConfig]") -> "PaymentId": _UniffiConverterUInt64.check_lower(amount_msat) - + _UniffiConverterTypePublicKey.check_lower(node_id) - + _UniffiConverterSequenceTypeCustomTlvRecord.check_lower(custom_tlvs) - + _UniffiConverterTypePaymentPreimage.check_lower(preimage) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypePaymentId.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_spontaneouspayment_send_with_preimage_and_custom_tlvs,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_msat), @@ -7383,7 +7431,7 @@ def send(self, uri_str: "str",route_parameters: "typing.Optional[RouteParameters class UnifiedQrPayment: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -7408,11 +7456,11 @@ def _make_instance_(cls, pointer): def receive(self, amount_sats: "int",message: "str",expiry_sec: "int") -> "str": _UniffiConverterUInt64.check_lower(amount_sats) - + _UniffiConverterString.check_lower(message) - + _UniffiConverterUInt32.check_lower(expiry_sec) - + return _UniffiConverterString.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_unifiedqrpayment_receive,self._uniffi_clone_pointer(), _UniffiConverterUInt64.lower(amount_sats), @@ -7426,9 +7474,9 @@ def receive(self, amount_sats: "int",message: "str",expiry_sec: "int") -> "str": def send(self, uri_str: "str",route_parameters: "typing.Optional[RouteParametersConfig]") -> "QrPaymentResult": _UniffiConverterString.check_lower(uri_str) - + _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(route_parameters) - + return _UniffiConverterTypeQrPaymentResult.lift( _uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_method_unifiedqrpayment_send,self._uniffi_clone_pointer(), _UniffiConverterString.lower(uri_str), @@ -7477,7 +7525,7 @@ def get_headers(self, request: "typing.List[int]"): class VssHeaderProvider: _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -7501,10 +7549,10 @@ def _make_instance_(cls, pointer): async def get_headers(self, request: "typing.List[int]") -> "dict[str, str]": _UniffiConverterSequenceUInt8.check_lower(request) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_ldk_node_fn_method_vssheaderprovider_get_headers( - self._uniffi_clone_pointer(), + self._uniffi_clone_pointer(), _UniffiConverterSequenceUInt8.lower(request) ), _UniffiLib.ffi_ldk_node_rust_future_poll_rust_buffer, @@ -7512,7 +7560,7 @@ async def get_headers(self, request: "typing.List[int]") -> "dict[str, str]": _UniffiLib.ffi_ldk_node_rust_future_free_rust_buffer, # lift function _UniffiConverterMapStringString.lift, - + # Error FFI converter _UniffiConverterTypeVssHeaderProviderError, @@ -8286,10 +8334,12 @@ class Config: probing_liquidity_limit_multiplier: "int" anchor_channels_config: "typing.Optional[AnchorChannelsConfig]" route_parameters: "typing.Optional[RouteParametersConfig]" + scoring_fee_params: "typing.Optional[ScoringFeeParameters]" + scoring_decay_params: "typing.Optional[ScoringDecayParameters]" include_untrusted_pending_in_spendable: "bool" address_type: "AddressType" address_types_to_monitor: "typing.List[AddressType]" - def __init__(self, *, storage_dir_path: "str", network: "Network", listening_addresses: "typing.Optional[typing.List[SocketAddress]]", announcement_addresses: "typing.Optional[typing.List[SocketAddress]]", node_alias: "typing.Optional[NodeAlias]", trusted_peers_0conf: "typing.List[PublicKey]", probing_liquidity_limit_multiplier: "int", anchor_channels_config: "typing.Optional[AnchorChannelsConfig]", route_parameters: "typing.Optional[RouteParametersConfig]", include_untrusted_pending_in_spendable: "bool", address_type: "AddressType", address_types_to_monitor: "typing.List[AddressType]"): + def __init__(self, *, storage_dir_path: "str", network: "Network", listening_addresses: "typing.Optional[typing.List[SocketAddress]]", announcement_addresses: "typing.Optional[typing.List[SocketAddress]]", node_alias: "typing.Optional[NodeAlias]", trusted_peers_0conf: "typing.List[PublicKey]", probing_liquidity_limit_multiplier: "int", anchor_channels_config: "typing.Optional[AnchorChannelsConfig]", route_parameters: "typing.Optional[RouteParametersConfig]", scoring_fee_params: "typing.Optional[ScoringFeeParameters]", scoring_decay_params: "typing.Optional[ScoringDecayParameters]", include_untrusted_pending_in_spendable: "bool", address_type: "AddressType", address_types_to_monitor: "typing.List[AddressType]"): self.storage_dir_path = storage_dir_path self.network = network self.listening_addresses = listening_addresses @@ -8299,12 +8349,14 @@ def __init__(self, *, storage_dir_path: "str", network: "Network", listening_add self.probing_liquidity_limit_multiplier = probing_liquidity_limit_multiplier self.anchor_channels_config = anchor_channels_config self.route_parameters = route_parameters + self.scoring_fee_params = scoring_fee_params + self.scoring_decay_params = scoring_decay_params self.include_untrusted_pending_in_spendable = include_untrusted_pending_in_spendable self.address_type = address_type self.address_types_to_monitor = address_types_to_monitor def __str__(self): - return "Config(storage_dir_path={}, network={}, listening_addresses={}, announcement_addresses={}, node_alias={}, trusted_peers_0conf={}, probing_liquidity_limit_multiplier={}, anchor_channels_config={}, route_parameters={}, include_untrusted_pending_in_spendable={}, address_type={}, address_types_to_monitor={})".format(self.storage_dir_path, self.network, self.listening_addresses, self.announcement_addresses, self.node_alias, self.trusted_peers_0conf, self.probing_liquidity_limit_multiplier, self.anchor_channels_config, self.route_parameters, self.include_untrusted_pending_in_spendable, self.address_type, self.address_types_to_monitor) + return "Config(storage_dir_path={}, network={}, listening_addresses={}, announcement_addresses={}, node_alias={}, trusted_peers_0conf={}, probing_liquidity_limit_multiplier={}, anchor_channels_config={}, route_parameters={}, scoring_fee_params={}, scoring_decay_params={}, include_untrusted_pending_in_spendable={}, address_type={}, address_types_to_monitor={})".format(self.storage_dir_path, self.network, self.listening_addresses, self.announcement_addresses, self.node_alias, self.trusted_peers_0conf, self.probing_liquidity_limit_multiplier, self.anchor_channels_config, self.route_parameters, self.scoring_fee_params, self.scoring_decay_params, self.include_untrusted_pending_in_spendable, self.address_type, self.address_types_to_monitor) def __eq__(self, other): if self.storage_dir_path != other.storage_dir_path: @@ -8325,6 +8377,10 @@ def __eq__(self, other): return False if self.route_parameters != other.route_parameters: return False + if self.scoring_fee_params != other.scoring_fee_params: + return False + if self.scoring_decay_params != other.scoring_decay_params: + return False if self.include_untrusted_pending_in_spendable != other.include_untrusted_pending_in_spendable: return False if self.address_type != other.address_type: @@ -8346,6 +8402,8 @@ def read(buf): probing_liquidity_limit_multiplier=_UniffiConverterUInt64.read(buf), anchor_channels_config=_UniffiConverterOptionalTypeAnchorChannelsConfig.read(buf), route_parameters=_UniffiConverterOptionalTypeRouteParametersConfig.read(buf), + scoring_fee_params=_UniffiConverterOptionalTypeScoringFeeParameters.read(buf), + scoring_decay_params=_UniffiConverterOptionalTypeScoringDecayParameters.read(buf), include_untrusted_pending_in_spendable=_UniffiConverterBool.read(buf), address_type=_UniffiConverterTypeAddressType.read(buf), address_types_to_monitor=_UniffiConverterSequenceTypeAddressType.read(buf), @@ -8362,6 +8420,8 @@ def check_lower(value): _UniffiConverterUInt64.check_lower(value.probing_liquidity_limit_multiplier) _UniffiConverterOptionalTypeAnchorChannelsConfig.check_lower(value.anchor_channels_config) _UniffiConverterOptionalTypeRouteParametersConfig.check_lower(value.route_parameters) + _UniffiConverterOptionalTypeScoringFeeParameters.check_lower(value.scoring_fee_params) + _UniffiConverterOptionalTypeScoringDecayParameters.check_lower(value.scoring_decay_params) _UniffiConverterBool.check_lower(value.include_untrusted_pending_in_spendable) _UniffiConverterTypeAddressType.check_lower(value.address_type) _UniffiConverterSequenceTypeAddressType.check_lower(value.address_types_to_monitor) @@ -8377,6 +8437,8 @@ def write(value, buf): _UniffiConverterUInt64.write(value.probing_liquidity_limit_multiplier, buf) _UniffiConverterOptionalTypeAnchorChannelsConfig.write(value.anchor_channels_config, buf) _UniffiConverterOptionalTypeRouteParametersConfig.write(value.route_parameters, buf) + _UniffiConverterOptionalTypeScoringFeeParameters.write(value.scoring_fee_params, buf) + _UniffiConverterOptionalTypeScoringDecayParameters.write(value.scoring_decay_params, buf) _UniffiConverterBool.write(value.include_untrusted_pending_in_spendable, buf) _UniffiConverterTypeAddressType.write(value.address_type, buf) _UniffiConverterSequenceTypeAddressType.write(value.address_types_to_monitor, buf) @@ -9546,6 +9608,134 @@ def write(value, buf): _UniffiConverterUInt64.write(value.fee_rate_cache_update_interval_secs, buf) +class ScoringDecayParameters: + historical_no_updates_half_life_secs: "int" + liquidity_offset_half_life_secs: "int" + def __init__(self, *, historical_no_updates_half_life_secs: "int", liquidity_offset_half_life_secs: "int"): + self.historical_no_updates_half_life_secs = historical_no_updates_half_life_secs + self.liquidity_offset_half_life_secs = liquidity_offset_half_life_secs + + def __str__(self): + return "ScoringDecayParameters(historical_no_updates_half_life_secs={}, liquidity_offset_half_life_secs={})".format(self.historical_no_updates_half_life_secs, self.liquidity_offset_half_life_secs) + + def __eq__(self, other): + if self.historical_no_updates_half_life_secs != other.historical_no_updates_half_life_secs: + return False + if self.liquidity_offset_half_life_secs != other.liquidity_offset_half_life_secs: + return False + return True + +class _UniffiConverterTypeScoringDecayParameters(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ScoringDecayParameters( + historical_no_updates_half_life_secs=_UniffiConverterUInt64.read(buf), + liquidity_offset_half_life_secs=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.historical_no_updates_half_life_secs) + _UniffiConverterUInt64.check_lower(value.liquidity_offset_half_life_secs) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.historical_no_updates_half_life_secs, buf) + _UniffiConverterUInt64.write(value.liquidity_offset_half_life_secs, buf) + + +class ScoringFeeParameters: + base_penalty_msat: "int" + base_penalty_amount_multiplier_msat: "int" + liquidity_penalty_multiplier_msat: "int" + liquidity_penalty_amount_multiplier_msat: "int" + historical_liquidity_penalty_multiplier_msat: "int" + historical_liquidity_penalty_amount_multiplier_msat: "int" + anti_probing_penalty_msat: "int" + considered_impossible_penalty_msat: "int" + linear_success_probability: "bool" + probing_diversity_penalty_msat: "int" + def __init__(self, *, base_penalty_msat: "int", base_penalty_amount_multiplier_msat: "int", liquidity_penalty_multiplier_msat: "int", liquidity_penalty_amount_multiplier_msat: "int", historical_liquidity_penalty_multiplier_msat: "int", historical_liquidity_penalty_amount_multiplier_msat: "int", anti_probing_penalty_msat: "int", considered_impossible_penalty_msat: "int", linear_success_probability: "bool", probing_diversity_penalty_msat: "int"): + self.base_penalty_msat = base_penalty_msat + self.base_penalty_amount_multiplier_msat = base_penalty_amount_multiplier_msat + self.liquidity_penalty_multiplier_msat = liquidity_penalty_multiplier_msat + self.liquidity_penalty_amount_multiplier_msat = liquidity_penalty_amount_multiplier_msat + self.historical_liquidity_penalty_multiplier_msat = historical_liquidity_penalty_multiplier_msat + self.historical_liquidity_penalty_amount_multiplier_msat = historical_liquidity_penalty_amount_multiplier_msat + self.anti_probing_penalty_msat = anti_probing_penalty_msat + self.considered_impossible_penalty_msat = considered_impossible_penalty_msat + self.linear_success_probability = linear_success_probability + self.probing_diversity_penalty_msat = probing_diversity_penalty_msat + + def __str__(self): + return "ScoringFeeParameters(base_penalty_msat={}, base_penalty_amount_multiplier_msat={}, liquidity_penalty_multiplier_msat={}, liquidity_penalty_amount_multiplier_msat={}, historical_liquidity_penalty_multiplier_msat={}, historical_liquidity_penalty_amount_multiplier_msat={}, anti_probing_penalty_msat={}, considered_impossible_penalty_msat={}, linear_success_probability={}, probing_diversity_penalty_msat={})".format(self.base_penalty_msat, self.base_penalty_amount_multiplier_msat, self.liquidity_penalty_multiplier_msat, self.liquidity_penalty_amount_multiplier_msat, self.historical_liquidity_penalty_multiplier_msat, self.historical_liquidity_penalty_amount_multiplier_msat, self.anti_probing_penalty_msat, self.considered_impossible_penalty_msat, self.linear_success_probability, self.probing_diversity_penalty_msat) + + def __eq__(self, other): + if self.base_penalty_msat != other.base_penalty_msat: + return False + if self.base_penalty_amount_multiplier_msat != other.base_penalty_amount_multiplier_msat: + return False + if self.liquidity_penalty_multiplier_msat != other.liquidity_penalty_multiplier_msat: + return False + if self.liquidity_penalty_amount_multiplier_msat != other.liquidity_penalty_amount_multiplier_msat: + return False + if self.historical_liquidity_penalty_multiplier_msat != other.historical_liquidity_penalty_multiplier_msat: + return False + if self.historical_liquidity_penalty_amount_multiplier_msat != other.historical_liquidity_penalty_amount_multiplier_msat: + return False + if self.anti_probing_penalty_msat != other.anti_probing_penalty_msat: + return False + if self.considered_impossible_penalty_msat != other.considered_impossible_penalty_msat: + return False + if self.linear_success_probability != other.linear_success_probability: + return False + if self.probing_diversity_penalty_msat != other.probing_diversity_penalty_msat: + return False + return True + +class _UniffiConverterTypeScoringFeeParameters(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ScoringFeeParameters( + base_penalty_msat=_UniffiConverterUInt64.read(buf), + base_penalty_amount_multiplier_msat=_UniffiConverterUInt64.read(buf), + liquidity_penalty_multiplier_msat=_UniffiConverterUInt64.read(buf), + liquidity_penalty_amount_multiplier_msat=_UniffiConverterUInt64.read(buf), + historical_liquidity_penalty_multiplier_msat=_UniffiConverterUInt64.read(buf), + historical_liquidity_penalty_amount_multiplier_msat=_UniffiConverterUInt64.read(buf), + anti_probing_penalty_msat=_UniffiConverterUInt64.read(buf), + considered_impossible_penalty_msat=_UniffiConverterUInt64.read(buf), + linear_success_probability=_UniffiConverterBool.read(buf), + probing_diversity_penalty_msat=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.base_penalty_msat) + _UniffiConverterUInt64.check_lower(value.base_penalty_amount_multiplier_msat) + _UniffiConverterUInt64.check_lower(value.liquidity_penalty_multiplier_msat) + _UniffiConverterUInt64.check_lower(value.liquidity_penalty_amount_multiplier_msat) + _UniffiConverterUInt64.check_lower(value.historical_liquidity_penalty_multiplier_msat) + _UniffiConverterUInt64.check_lower(value.historical_liquidity_penalty_amount_multiplier_msat) + _UniffiConverterUInt64.check_lower(value.anti_probing_penalty_msat) + _UniffiConverterUInt64.check_lower(value.considered_impossible_penalty_msat) + _UniffiConverterBool.check_lower(value.linear_success_probability) + _UniffiConverterUInt64.check_lower(value.probing_diversity_penalty_msat) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.base_penalty_msat, buf) + _UniffiConverterUInt64.write(value.base_penalty_amount_multiplier_msat, buf) + _UniffiConverterUInt64.write(value.liquidity_penalty_multiplier_msat, buf) + _UniffiConverterUInt64.write(value.liquidity_penalty_amount_multiplier_msat, buf) + _UniffiConverterUInt64.write(value.historical_liquidity_penalty_multiplier_msat, buf) + _UniffiConverterUInt64.write(value.historical_liquidity_penalty_amount_multiplier_msat, buf) + _UniffiConverterUInt64.write(value.anti_probing_penalty_msat, buf) + _UniffiConverterUInt64.write(value.considered_impossible_penalty_msat, buf) + _UniffiConverterBool.write(value.linear_success_probability, buf) + _UniffiConverterUInt64.write(value.probing_diversity_penalty_msat, buf) + + class SpendableUtxo: outpoint: "OutPoint" value_sats: "int" @@ -9744,13 +9934,13 @@ def write(value, buf): class AddressType(enum.Enum): LEGACY = 0 - + NESTED_SEGWIT = 1 - + NATIVE_SEGWIT = 2 - + TAPROOT = 3 - + class _UniffiConverterTypeAddressType(_UniffiConverterRustBuffer): @@ -9798,9 +9988,9 @@ def write(value, buf): class AsyncPaymentsRole(enum.Enum): CLIENT = 0 - + SERVER = 1 - + class _UniffiConverterTypeAsyncPaymentsRole(_UniffiConverterRustBuffer): @@ -9836,13 +10026,13 @@ def write(value, buf): class BalanceSource(enum.Enum): HOLDER_FORCE_CLOSED = 0 - + COUNTERPARTY_FORCE_CLOSED = 1 - + COOP_CLOSE = 2 - + HTLC = 3 - + class _UniffiConverterTypeBalanceSource(_UniffiConverterRustBuffer): @@ -9908,7 +10098,7 @@ def __eq__(self, other): if self.hash != other.hash: return False return True - + class DIRECT: description: "str" @@ -9924,8 +10114,8 @@ def __eq__(self, other): if self.description != other.description: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -9933,7 +10123,7 @@ def is_hash(self) -> bool: return isinstance(self, Bolt11InvoiceDescription.HASH) def is_direct(self) -> bool: return isinstance(self, Bolt11InvoiceDescription.DIRECT) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -10254,7 +10444,7 @@ def __eq__(self, other): if self.peer_msg != other.peer_msg: return False return True - + class HOLDER_FORCE_CLOSED: broadcasted_latest_txn: "typing.Optional[bool]" message: "str" @@ -10274,7 +10464,7 @@ def __eq__(self, other): if self.message != other.message: return False return True - + class LEGACY_COOPERATIVE_CLOSURE: def __init__(self,): @@ -10287,7 +10477,7 @@ def __eq__(self, other): if not other.is_legacy_cooperative_closure(): return False return True - + class COUNTERPARTY_INITIATED_COOPERATIVE_CLOSURE: def __init__(self,): @@ -10300,7 +10490,7 @@ def __eq__(self, other): if not other.is_counterparty_initiated_cooperative_closure(): return False return True - + class LOCALLY_INITIATED_COOPERATIVE_CLOSURE: def __init__(self,): @@ -10313,7 +10503,7 @@ def __eq__(self, other): if not other.is_locally_initiated_cooperative_closure(): return False return True - + class COMMITMENT_TX_CONFIRMED: def __init__(self,): @@ -10326,7 +10516,7 @@ def __eq__(self, other): if not other.is_commitment_tx_confirmed(): return False return True - + class FUNDING_TIMED_OUT: def __init__(self,): @@ -10339,7 +10529,7 @@ def __eq__(self, other): if not other.is_funding_timed_out(): return False return True - + class PROCESSING_ERROR: err: "str" @@ -10355,7 +10545,7 @@ def __eq__(self, other): if self.err != other.err: return False return True - + class DISCONNECTED_PEER: def __init__(self,): @@ -10368,7 +10558,7 @@ def __eq__(self, other): if not other.is_disconnected_peer(): return False return True - + class OUTDATED_CHANNEL_MANAGER: def __init__(self,): @@ -10381,7 +10571,7 @@ def __eq__(self, other): if not other.is_outdated_channel_manager(): return False return True - + class COUNTERPARTY_COOP_CLOSED_UNFUNDED_CHANNEL: def __init__(self,): @@ -10394,7 +10584,7 @@ def __eq__(self, other): if not other.is_counterparty_coop_closed_unfunded_channel(): return False return True - + class LOCALLY_COOP_CLOSED_UNFUNDED_CHANNEL: def __init__(self,): @@ -10407,7 +10597,7 @@ def __eq__(self, other): if not other.is_locally_coop_closed_unfunded_channel(): return False return True - + class FUNDING_BATCH_CLOSURE: def __init__(self,): @@ -10420,7 +10610,7 @@ def __eq__(self, other): if not other.is_funding_batch_closure(): return False return True - + class HTL_CS_TIMED_OUT: payment_hash: "typing.Optional[PaymentHash]" @@ -10436,7 +10626,7 @@ def __eq__(self, other): if self.payment_hash != other.payment_hash: return False return True - + class PEER_FEERATE_TOO_LOW: peer_feerate_sat_per_kw: "int" required_feerate_sat_per_kw: "int" @@ -10456,8 +10646,8 @@ def __eq__(self, other): if self.required_feerate_sat_per_kw != other.required_feerate_sat_per_kw: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -10491,7 +10681,7 @@ def is_htl_cs_timed_out(self) -> bool: return isinstance(self, ClosureReason.HTL_CS_TIMED_OUT) def is_peer_feerate_too_low(self) -> bool: return isinstance(self, ClosureReason.PEER_FEERATE_TOO_LOW) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -10662,13 +10852,13 @@ def write(value, buf): class CoinSelectionAlgorithm(enum.Enum): BRANCH_AND_BOUND = 0 - + LARGEST_FIRST = 1 - + OLDEST_FIRST = 2 - + SINGLE_RANDOM_DRAW = 3 - + class _UniffiConverterTypeCoinSelectionAlgorithm(_UniffiConverterRustBuffer): @@ -10742,7 +10932,7 @@ def __eq__(self, other): if self.timestamp != other.timestamp: return False return True - + class UNCONFIRMED: def __init__(self,): @@ -10755,8 +10945,8 @@ def __eq__(self, other): if not other.is_unconfirmed(): return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -10764,7 +10954,7 @@ def is_confirmed(self) -> bool: return isinstance(self, ConfirmationStatus.CONFIRMED) def is_unconfirmed(self) -> bool: return isinstance(self, ConfirmationStatus.UNCONFIRMED) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -10819,15 +11009,15 @@ def write(value, buf): class Currency(enum.Enum): BITCOIN = 0 - + BITCOIN_TESTNET = 1 - + REGTEST = 2 - + SIMNET = 3 - + SIGNET = 4 - + class _UniffiConverterTypeCurrency(_UniffiConverterRustBuffer): @@ -10911,7 +11101,7 @@ def __eq__(self, other): if self.fee_paid_msat != other.fee_paid_msat: return False return True - + class PAYMENT_FAILED: payment_id: "typing.Optional[PaymentId]" payment_hash: "typing.Optional[PaymentHash]" @@ -10935,7 +11125,7 @@ def __eq__(self, other): if self.reason != other.reason: return False return True - + class PAYMENT_RECEIVED: payment_id: "typing.Optional[PaymentId]" payment_hash: "PaymentHash" @@ -10963,7 +11153,7 @@ def __eq__(self, other): if self.custom_records != other.custom_records: return False return True - + class PAYMENT_CLAIMABLE: payment_id: "PaymentId" payment_hash: "PaymentHash" @@ -10995,7 +11185,7 @@ def __eq__(self, other): if self.custom_records != other.custom_records: return False return True - + class PAYMENT_FORWARDED: prev_channel_id: "ChannelId" next_channel_id: "ChannelId" @@ -11047,7 +11237,7 @@ def __eq__(self, other): if self.outbound_amount_forwarded_msat != other.outbound_amount_forwarded_msat: return False return True - + class PROBE_SUCCESSFUL: payment_id: "PaymentId" payment_hash: "PaymentHash" @@ -11067,7 +11257,7 @@ def __eq__(self, other): if self.payment_hash != other.payment_hash: return False return True - + class PROBE_FAILED: payment_id: "PaymentId" payment_hash: "PaymentHash" @@ -11091,7 +11281,7 @@ def __eq__(self, other): if self.short_channel_id != other.short_channel_id: return False return True - + class CHANNEL_PENDING: channel_id: "ChannelId" user_channel_id: "UserChannelId" @@ -11123,7 +11313,7 @@ def __eq__(self, other): if self.funding_txo != other.funding_txo: return False return True - + class CHANNEL_READY: channel_id: "ChannelId" user_channel_id: "UserChannelId" @@ -11151,7 +11341,7 @@ def __eq__(self, other): if self.funding_txo != other.funding_txo: return False return True - + class CHANNEL_CLOSED: channel_id: "ChannelId" user_channel_id: "UserChannelId" @@ -11179,7 +11369,7 @@ def __eq__(self, other): if self.reason != other.reason: return False return True - + class SPLICE_PENDING: channel_id: "ChannelId" user_channel_id: "UserChannelId" @@ -11207,7 +11397,7 @@ def __eq__(self, other): if self.new_funding_txo != other.new_funding_txo: return False return True - + class SPLICE_FAILED: channel_id: "ChannelId" user_channel_id: "UserChannelId" @@ -11235,7 +11425,7 @@ def __eq__(self, other): if self.abandoned_funding_txo != other.abandoned_funding_txo: return False return True - + class ONCHAIN_TRANSACTION_CONFIRMED: txid: "Txid" block_hash: "BlockHash" @@ -11267,7 +11457,7 @@ def __eq__(self, other): if self.details != other.details: return False return True - + class ONCHAIN_TRANSACTION_RECEIVED: txid: "Txid" details: "TransactionDetails" @@ -11287,7 +11477,7 @@ def __eq__(self, other): if self.details != other.details: return False return True - + class ONCHAIN_TRANSACTION_REPLACED: txid: "Txid" conflicts: "typing.List[Txid]" @@ -11307,7 +11497,7 @@ def __eq__(self, other): if self.conflicts != other.conflicts: return False return True - + class ONCHAIN_TRANSACTION_REORGED: txid: "Txid" @@ -11323,7 +11513,7 @@ def __eq__(self, other): if self.txid != other.txid: return False return True - + class ONCHAIN_TRANSACTION_EVICTED: txid: "Txid" @@ -11339,7 +11529,7 @@ def __eq__(self, other): if self.txid != other.txid: return False return True - + class SYNC_PROGRESS: sync_type: "SyncType" progress_percent: "int" @@ -11367,7 +11557,7 @@ def __eq__(self, other): if self.target_block_height != other.target_block_height: return False return True - + class SYNC_COMPLETED: sync_type: "SyncType" synced_block_height: "int" @@ -11387,7 +11577,7 @@ def __eq__(self, other): if self.synced_block_height != other.synced_block_height: return False return True - + class BALANCE_CHANGED: old_spendable_onchain_balance_sats: "int" new_spendable_onchain_balance_sats: "int" @@ -11423,8 +11613,8 @@ def __eq__(self, other): if self.new_total_lightning_balance_sats != other.new_total_lightning_balance_sats: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -11468,7 +11658,7 @@ def is_sync_completed(self) -> bool: return isinstance(self, Event.SYNC_COMPLETED) def is_balance_changed(self) -> bool: return isinstance(self, Event.BALANCE_CHANGED) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -11883,9 +12073,9 @@ def write(value, buf): class KeychainKind(enum.Enum): EXTERNAL = 0 - + INTERNAL = 1 - + class _UniffiConverterTypeKeychainKind(_UniffiConverterRustBuffer): @@ -11967,7 +12157,7 @@ def __eq__(self, other): if self.inbound_htlc_rounded_msat != other.inbound_htlc_rounded_msat: return False return True - + class CLAIMABLE_AWAITING_CONFIRMATIONS: channel_id: "ChannelId" counterparty_node_id: "PublicKey" @@ -11999,7 +12189,7 @@ def __eq__(self, other): if self.source != other.source: return False return True - + class CONTENTIOUS_CLAIMABLE: channel_id: "ChannelId" counterparty_node_id: "PublicKey" @@ -12035,7 +12225,7 @@ def __eq__(self, other): if self.payment_preimage != other.payment_preimage: return False return True - + class MAYBE_TIMEOUT_CLAIMABLE_HTLC: channel_id: "ChannelId" counterparty_node_id: "PublicKey" @@ -12071,7 +12261,7 @@ def __eq__(self, other): if self.outbound_payment != other.outbound_payment: return False return True - + class MAYBE_PREIMAGE_CLAIMABLE_HTLC: channel_id: "ChannelId" counterparty_node_id: "PublicKey" @@ -12103,7 +12293,7 @@ def __eq__(self, other): if self.payment_hash != other.payment_hash: return False return True - + class COUNTERPARTY_REVOKED_OUTPUT_CLAIMABLE: channel_id: "ChannelId" counterparty_node_id: "PublicKey" @@ -12127,8 +12317,8 @@ def __eq__(self, other): if self.amount_satoshis != other.amount_satoshis: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -12144,7 +12334,7 @@ def is_maybe_preimage_claimable_htlc(self) -> bool: return isinstance(self, LightningBalance.MAYBE_PREIMAGE_CLAIMABLE_HTLC) def is_counterparty_revoked_output_claimable(self) -> bool: return isinstance(self, LightningBalance.COUNTERPARTY_REVOKED_OUTPUT_CLAIMABLE) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -12321,17 +12511,17 @@ def write(value, buf): class LogLevel(enum.Enum): GOSSIP = 0 - + TRACE = 1 - + DEBUG = 2 - + INFO = 3 - + WARN = 4 - + ERROR = 5 - + class _UniffiConverterTypeLogLevel(_UniffiConverterRustBuffer): @@ -12391,11 +12581,11 @@ def write(value, buf): class Lsps1PaymentState(enum.Enum): EXPECT_PAYMENT = 0 - + PAID = 1 - + REFUNDED = 2 - + class _UniffiConverterTypeLsps1PaymentState(_UniffiConverterRustBuffer): @@ -12455,7 +12645,7 @@ def __eq__(self, other): if self.limit_msat != other.limit_msat: return False return True - + class FEE_RATE_MULTIPLIER: multiplier: "int" @@ -12471,8 +12661,8 @@ def __eq__(self, other): if self.multiplier != other.multiplier: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -12480,7 +12670,7 @@ def is_fixed_limit(self) -> bool: return isinstance(self, MaxDustHtlcExposure.FIXED_LIMIT) def is_fee_rate_multiplier(self) -> bool: return isinstance(self, MaxDustHtlcExposure.FEE_RATE_MULTIPLIER) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -12532,13 +12722,13 @@ def write(value, buf): class Network(enum.Enum): BITCOIN = 0 - + TESTNET = 1 - + SIGNET = 2 - + REGTEST = 3 - + class _UniffiConverterTypeNetwork(_UniffiConverterRustBuffer): @@ -13505,7 +13695,7 @@ def __eq__(self, other): if self.amount_msats != other.amount_msats: return False return True - + class CURRENCY: iso4217_code: "str" amount: "int" @@ -13525,8 +13715,8 @@ def __eq__(self, other): if self.amount != other.amount: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -13534,7 +13724,7 @@ def is_bitcoin(self) -> bool: return isinstance(self, OfferAmount.BITCOIN) def is_currency(self) -> bool: return isinstance(self, OfferAmount.CURRENCY) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -13589,9 +13779,9 @@ def write(value, buf): class PaymentDirection(enum.Enum): INBOUND = 0 - + OUTBOUND = 1 - + class _UniffiConverterTypePaymentDirection(_UniffiConverterRustBuffer): @@ -13627,25 +13817,25 @@ def write(value, buf): class PaymentFailureReason(enum.Enum): RECIPIENT_REJECTED = 0 - + USER_ABANDONED = 1 - + RETRIES_EXHAUSTED = 2 - + PAYMENT_EXPIRED = 3 - + ROUTE_NOT_FOUND = 4 - + UNEXPECTED_ERROR = 5 - + UNKNOWN_REQUIRED_FEATURES = 6 - + INVOICE_REQUEST_EXPIRED = 7 - + INVOICE_REQUEST_REJECTED = 8 - + BLINDED_PATH_CREATION_FAILED = 9 - + class _UniffiConverterTypePaymentFailureReason(_UniffiConverterRustBuffer): @@ -13751,7 +13941,7 @@ def __eq__(self, other): if self.status != other.status: return False return True - + class BOLT11: hash: "PaymentHash" preimage: "typing.Optional[PaymentPreimage]" @@ -13783,7 +13973,7 @@ def __eq__(self, other): if self.bolt11 != other.bolt11: return False return True - + class BOLT11_JIT: hash: "PaymentHash" preimage: "typing.Optional[PaymentPreimage]" @@ -13823,7 +14013,7 @@ def __eq__(self, other): if self.bolt11 != other.bolt11: return False return True - + class BOLT12_OFFER: hash: "typing.Optional[PaymentHash]" preimage: "typing.Optional[PaymentPreimage]" @@ -13859,7 +14049,7 @@ def __eq__(self, other): if self.quantity != other.quantity: return False return True - + class BOLT12_REFUND: hash: "typing.Optional[PaymentHash]" preimage: "typing.Optional[PaymentPreimage]" @@ -13891,7 +14081,7 @@ def __eq__(self, other): if self.quantity != other.quantity: return False return True - + class SPONTANEOUS: hash: "PaymentHash" preimage: "typing.Optional[PaymentPreimage]" @@ -13911,8 +14101,8 @@ def __eq__(self, other): if self.preimage != other.preimage: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -13928,7 +14118,7 @@ def is_bolt12_refund(self) -> bool: return isinstance(self, PaymentKind.BOLT12_REFUND) def is_spontaneous(self) -> bool: return isinstance(self, PaymentKind.SPONTANEOUS) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -14087,11 +14277,11 @@ def write(value, buf): class PaymentStatus(enum.Enum): PENDING = 0 - + SUCCEEDED = 1 - + FAILED = 2 - + class _UniffiConverterTypePaymentStatus(_UniffiConverterRustBuffer): @@ -14155,7 +14345,7 @@ def __eq__(self, other): if self.amount_satoshis != other.amount_satoshis: return False return True - + class BROADCAST_AWAITING_CONFIRMATION: channel_id: "typing.Optional[ChannelId]" latest_broadcast_height: "int" @@ -14183,7 +14373,7 @@ def __eq__(self, other): if self.amount_satoshis != other.amount_satoshis: return False return True - + class AWAITING_THRESHOLD_CONFIRMATIONS: channel_id: "typing.Optional[ChannelId]" latest_spending_txid: "Txid" @@ -14215,8 +14405,8 @@ def __eq__(self, other): if self.amount_satoshis != other.amount_satoshis: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -14226,7 +14416,7 @@ def is_broadcast_awaiting_confirmation(self) -> bool: return isinstance(self, PendingSweepBalance.BROADCAST_AWAITING_CONFIRMATION) def is_awaiting_threshold_confirmations(self) -> bool: return isinstance(self, PendingSweepBalance.AWAITING_THRESHOLD_CONFIRMATIONS) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -14331,7 +14521,7 @@ def __eq__(self, other): if self.txid != other.txid: return False return True - + class BOLT11: payment_id: "PaymentId" @@ -14347,7 +14537,7 @@ def __eq__(self, other): if self.payment_id != other.payment_id: return False return True - + class BOLT12: payment_id: "PaymentId" @@ -14363,8 +14553,8 @@ def __eq__(self, other): if self.payment_id != other.payment_id: return False return True - - + + # For each variant, we have an `is_NAME` method for easily checking # whether an instance is that variant. @@ -14374,7 +14564,7 @@ def is_bolt11(self) -> bool: return isinstance(self, QrPaymentResult.BOLT11) def is_bolt12(self) -> bool: return isinstance(self, QrPaymentResult.BOLT12) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -14437,11 +14627,11 @@ def write(value, buf): class SyncType(enum.Enum): ONCHAIN_WALLET = 0 - + LIGHTNING_WALLET = 1 - + FEE_RATE_CACHE = 2 - + class _UniffiConverterTypeSyncType(_UniffiConverterRustBuffer): @@ -14565,15 +14755,15 @@ def write(value, buf): class WordCount(enum.Enum): WORDS12 = 0 - + WORDS15 = 1 - + WORDS18 = 2 - + WORDS21 = 3 - + WORDS24 = 4 - + class _UniffiConverterTypeWordCount(_UniffiConverterRustBuffer): @@ -15190,6 +15380,60 @@ def read(cls, buf): +class _UniffiConverterOptionalTypeScoringDecayParameters(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeScoringDecayParameters.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeScoringDecayParameters.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeScoringDecayParameters.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeScoringFeeParameters(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeScoringFeeParameters.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeScoringFeeParameters.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeScoringFeeParameters.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + class _UniffiConverterOptionalTypeTransactionDetails(_UniffiConverterRustBuffer): @classmethod def check_lower(cls, value): @@ -16930,9 +17174,9 @@ def default_config() -> "Config": def derive_node_secret_from_mnemonic(mnemonic: "str",passphrase: "typing.Optional[str]") -> "typing.List[int]": _UniffiConverterString.check_lower(mnemonic) - + _UniffiConverterOptionalString.check_lower(passphrase) - + return _UniffiConverterSequenceUInt8.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeNodeError,_UniffiLib.uniffi_ldk_node_fn_func_derive_node_secret_from_mnemonic, _UniffiConverterString.lower(mnemonic), _UniffiConverterOptionalString.lower(passphrase))) @@ -16940,7 +17184,7 @@ def derive_node_secret_from_mnemonic(mnemonic: "str",passphrase: "typing.Optiona def generate_entropy_mnemonic(word_count: "typing.Optional[WordCount]") -> "Mnemonic": _UniffiConverterOptionalTypeWordCount.check_lower(word_count) - + return _UniffiConverterTypeMnemonic.lift(_uniffi_rust_call(_UniffiLib.uniffi_ldk_node_fn_func_generate_entropy_mnemonic, _UniffiConverterOptionalTypeWordCount.lower(word_count))) @@ -17009,6 +17253,8 @@ def generate_entropy_mnemonic(word_count: "typing.Optional[WordCount]") -> "Mnem "RouteParametersConfig", "RoutingFees", "RuntimeSyncIntervals", + "ScoringDecayParameters", + "ScoringFeeParameters", "SpendableUtxo", "TransactionDetails", "TxInput", diff --git a/bindings/swift/Sources/LDKNode/LDKNode.swift b/bindings/swift/Sources/LDKNode/LDKNode.swift index 52453c181..9f5220262 100644 --- a/bindings/swift/Sources/LDKNode/LDKNode.swift +++ b/bindings/swift/Sources/LDKNode/LDKNode.swift @@ -1615,6 +1615,10 @@ public protocol BuilderProtocol: AnyObject { func setPathfindingScoresSource(url: String) + func setScoringDecayParams(params: ScoringDecayParameters) + + func setScoringFeeParams(params: ScoringFeeParameters) + func setStorageDirPath(storageDirPath: String) } @@ -1903,6 +1907,20 @@ open class Builder: } } + open func setScoringDecayParams(params: ScoringDecayParameters) { + try! rustCall { + uniffi_ldk_node_fn_method_builder_set_scoring_decay_params(self.uniffiClonePointer(), + FfiConverterTypeScoringDecayParameters.lower(params), $0) + } + } + + open func setScoringFeeParams(params: ScoringFeeParameters) { + try! rustCall { + uniffi_ldk_node_fn_method_builder_set_scoring_fee_params(self.uniffiClonePointer(), + FfiConverterTypeScoringFeeParameters.lower(params), $0) + } + } + open func setStorageDirPath(storageDirPath: String) { try! rustCall { uniffi_ldk_node_fn_method_builder_set_storage_dir_path(self.uniffiClonePointer(), @@ -5226,13 +5244,15 @@ public struct Config { public var probingLiquidityLimitMultiplier: UInt64 public var anchorChannelsConfig: AnchorChannelsConfig? public var routeParameters: RouteParametersConfig? + public var scoringFeeParams: ScoringFeeParameters? + public var scoringDecayParams: ScoringDecayParameters? public var includeUntrustedPendingInSpendable: Bool public var addressType: AddressType public var addressTypesToMonitor: [AddressType] /// Default memberwise initializers are never public by default, so we /// declare one manually. - public init(storageDirPath: String, network: Network, listeningAddresses: [SocketAddress]?, announcementAddresses: [SocketAddress]?, nodeAlias: NodeAlias?, trustedPeers0conf: [PublicKey], probingLiquidityLimitMultiplier: UInt64, anchorChannelsConfig: AnchorChannelsConfig?, routeParameters: RouteParametersConfig?, includeUntrustedPendingInSpendable: Bool, addressType: AddressType, addressTypesToMonitor: [AddressType]) { + public init(storageDirPath: String, network: Network, listeningAddresses: [SocketAddress]?, announcementAddresses: [SocketAddress]?, nodeAlias: NodeAlias?, trustedPeers0conf: [PublicKey], probingLiquidityLimitMultiplier: UInt64, anchorChannelsConfig: AnchorChannelsConfig?, routeParameters: RouteParametersConfig?, scoringFeeParams: ScoringFeeParameters?, scoringDecayParams: ScoringDecayParameters?, includeUntrustedPendingInSpendable: Bool, addressType: AddressType, addressTypesToMonitor: [AddressType]) { self.storageDirPath = storageDirPath self.network = network self.listeningAddresses = listeningAddresses @@ -5242,6 +5262,8 @@ public struct Config { self.probingLiquidityLimitMultiplier = probingLiquidityLimitMultiplier self.anchorChannelsConfig = anchorChannelsConfig self.routeParameters = routeParameters + self.scoringFeeParams = scoringFeeParams + self.scoringDecayParams = scoringDecayParams self.includeUntrustedPendingInSpendable = includeUntrustedPendingInSpendable self.addressType = addressType self.addressTypesToMonitor = addressTypesToMonitor @@ -5277,6 +5299,12 @@ extension Config: Equatable, Hashable { if lhs.routeParameters != rhs.routeParameters { return false } + if lhs.scoringFeeParams != rhs.scoringFeeParams { + return false + } + if lhs.scoringDecayParams != rhs.scoringDecayParams { + return false + } if lhs.includeUntrustedPendingInSpendable != rhs.includeUntrustedPendingInSpendable { return false } @@ -5299,6 +5327,8 @@ extension Config: Equatable, Hashable { hasher.combine(probingLiquidityLimitMultiplier) hasher.combine(anchorChannelsConfig) hasher.combine(routeParameters) + hasher.combine(scoringFeeParams) + hasher.combine(scoringDecayParams) hasher.combine(includeUntrustedPendingInSpendable) hasher.combine(addressType) hasher.combine(addressTypesToMonitor) @@ -5321,6 +5351,8 @@ public struct FfiConverterTypeConfig: FfiConverterRustBuffer { probingLiquidityLimitMultiplier: FfiConverterUInt64.read(from: &buf), anchorChannelsConfig: FfiConverterOptionTypeAnchorChannelsConfig.read(from: &buf), routeParameters: FfiConverterOptionTypeRouteParametersConfig.read(from: &buf), + scoringFeeParams: FfiConverterOptionTypeScoringFeeParameters.read(from: &buf), + scoringDecayParams: FfiConverterOptionTypeScoringDecayParameters.read(from: &buf), includeUntrustedPendingInSpendable: FfiConverterBool.read(from: &buf), addressType: FfiConverterTypeAddressType.read(from: &buf), addressTypesToMonitor: FfiConverterSequenceTypeAddressType.read(from: &buf) @@ -5337,6 +5369,8 @@ public struct FfiConverterTypeConfig: FfiConverterRustBuffer { FfiConverterUInt64.write(value.probingLiquidityLimitMultiplier, into: &buf) FfiConverterOptionTypeAnchorChannelsConfig.write(value.anchorChannelsConfig, into: &buf) FfiConverterOptionTypeRouteParametersConfig.write(value.routeParameters, into: &buf) + FfiConverterOptionTypeScoringFeeParameters.write(value.scoringFeeParams, into: &buf) + FfiConverterOptionTypeScoringDecayParameters.write(value.scoringDecayParams, into: &buf) FfiConverterBool.write(value.includeUntrustedPendingInSpendable, into: &buf) FfiConverterTypeAddressType.write(value.addressType, into: &buf) FfiConverterSequenceTypeAddressType.write(value.addressTypesToMonitor, into: &buf) @@ -7032,6 +7066,192 @@ public func FfiConverterTypeRuntimeSyncIntervals_lower(_ value: RuntimeSyncInter return FfiConverterTypeRuntimeSyncIntervals.lower(value) } +public struct ScoringDecayParameters { + public var historicalNoUpdatesHalfLifeSecs: UInt64 + public var liquidityOffsetHalfLifeSecs: UInt64 + + /// Default memberwise initializers are never public by default, so we + /// declare one manually. + public init(historicalNoUpdatesHalfLifeSecs: UInt64, liquidityOffsetHalfLifeSecs: UInt64) { + self.historicalNoUpdatesHalfLifeSecs = historicalNoUpdatesHalfLifeSecs + self.liquidityOffsetHalfLifeSecs = liquidityOffsetHalfLifeSecs + } +} + +extension ScoringDecayParameters: Equatable, Hashable { + public static func == (lhs: ScoringDecayParameters, rhs: ScoringDecayParameters) -> Bool { + if lhs.historicalNoUpdatesHalfLifeSecs != rhs.historicalNoUpdatesHalfLifeSecs { + return false + } + if lhs.liquidityOffsetHalfLifeSecs != rhs.liquidityOffsetHalfLifeSecs { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(historicalNoUpdatesHalfLifeSecs) + hasher.combine(liquidityOffsetHalfLifeSecs) + } +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public struct FfiConverterTypeScoringDecayParameters: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ScoringDecayParameters { + return + try ScoringDecayParameters( + historicalNoUpdatesHalfLifeSecs: FfiConverterUInt64.read(from: &buf), + liquidityOffsetHalfLifeSecs: FfiConverterUInt64.read(from: &buf) + ) + } + + public static func write(_ value: ScoringDecayParameters, into buf: inout [UInt8]) { + FfiConverterUInt64.write(value.historicalNoUpdatesHalfLifeSecs, into: &buf) + FfiConverterUInt64.write(value.liquidityOffsetHalfLifeSecs, into: &buf) + } +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public func FfiConverterTypeScoringDecayParameters_lift(_ buf: RustBuffer) throws -> ScoringDecayParameters { + return try FfiConverterTypeScoringDecayParameters.lift(buf) +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public func FfiConverterTypeScoringDecayParameters_lower(_ value: ScoringDecayParameters) -> RustBuffer { + return FfiConverterTypeScoringDecayParameters.lower(value) +} + +public struct ScoringFeeParameters { + public var basePenaltyMsat: UInt64 + public var basePenaltyAmountMultiplierMsat: UInt64 + public var liquidityPenaltyMultiplierMsat: UInt64 + public var liquidityPenaltyAmountMultiplierMsat: UInt64 + public var historicalLiquidityPenaltyMultiplierMsat: UInt64 + public var historicalLiquidityPenaltyAmountMultiplierMsat: UInt64 + public var antiProbingPenaltyMsat: UInt64 + public var consideredImpossiblePenaltyMsat: UInt64 + public var linearSuccessProbability: Bool + public var probingDiversityPenaltyMsat: UInt64 + + /// Default memberwise initializers are never public by default, so we + /// declare one manually. + public init(basePenaltyMsat: UInt64, basePenaltyAmountMultiplierMsat: UInt64, liquidityPenaltyMultiplierMsat: UInt64, liquidityPenaltyAmountMultiplierMsat: UInt64, historicalLiquidityPenaltyMultiplierMsat: UInt64, historicalLiquidityPenaltyAmountMultiplierMsat: UInt64, antiProbingPenaltyMsat: UInt64, consideredImpossiblePenaltyMsat: UInt64, linearSuccessProbability: Bool, probingDiversityPenaltyMsat: UInt64) { + self.basePenaltyMsat = basePenaltyMsat + self.basePenaltyAmountMultiplierMsat = basePenaltyAmountMultiplierMsat + self.liquidityPenaltyMultiplierMsat = liquidityPenaltyMultiplierMsat + self.liquidityPenaltyAmountMultiplierMsat = liquidityPenaltyAmountMultiplierMsat + self.historicalLiquidityPenaltyMultiplierMsat = historicalLiquidityPenaltyMultiplierMsat + self.historicalLiquidityPenaltyAmountMultiplierMsat = historicalLiquidityPenaltyAmountMultiplierMsat + self.antiProbingPenaltyMsat = antiProbingPenaltyMsat + self.consideredImpossiblePenaltyMsat = consideredImpossiblePenaltyMsat + self.linearSuccessProbability = linearSuccessProbability + self.probingDiversityPenaltyMsat = probingDiversityPenaltyMsat + } +} + +extension ScoringFeeParameters: Equatable, Hashable { + public static func == (lhs: ScoringFeeParameters, rhs: ScoringFeeParameters) -> Bool { + if lhs.basePenaltyMsat != rhs.basePenaltyMsat { + return false + } + if lhs.basePenaltyAmountMultiplierMsat != rhs.basePenaltyAmountMultiplierMsat { + return false + } + if lhs.liquidityPenaltyMultiplierMsat != rhs.liquidityPenaltyMultiplierMsat { + return false + } + if lhs.liquidityPenaltyAmountMultiplierMsat != rhs.liquidityPenaltyAmountMultiplierMsat { + return false + } + if lhs.historicalLiquidityPenaltyMultiplierMsat != rhs.historicalLiquidityPenaltyMultiplierMsat { + return false + } + if lhs.historicalLiquidityPenaltyAmountMultiplierMsat != rhs.historicalLiquidityPenaltyAmountMultiplierMsat { + return false + } + if lhs.antiProbingPenaltyMsat != rhs.antiProbingPenaltyMsat { + return false + } + if lhs.consideredImpossiblePenaltyMsat != rhs.consideredImpossiblePenaltyMsat { + return false + } + if lhs.linearSuccessProbability != rhs.linearSuccessProbability { + return false + } + if lhs.probingDiversityPenaltyMsat != rhs.probingDiversityPenaltyMsat { + return false + } + return true + } + + public func hash(into hasher: inout Hasher) { + hasher.combine(basePenaltyMsat) + hasher.combine(basePenaltyAmountMultiplierMsat) + hasher.combine(liquidityPenaltyMultiplierMsat) + hasher.combine(liquidityPenaltyAmountMultiplierMsat) + hasher.combine(historicalLiquidityPenaltyMultiplierMsat) + hasher.combine(historicalLiquidityPenaltyAmountMultiplierMsat) + hasher.combine(antiProbingPenaltyMsat) + hasher.combine(consideredImpossiblePenaltyMsat) + hasher.combine(linearSuccessProbability) + hasher.combine(probingDiversityPenaltyMsat) + } +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public struct FfiConverterTypeScoringFeeParameters: FfiConverterRustBuffer { + public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ScoringFeeParameters { + return + try ScoringFeeParameters( + basePenaltyMsat: FfiConverterUInt64.read(from: &buf), + basePenaltyAmountMultiplierMsat: FfiConverterUInt64.read(from: &buf), + liquidityPenaltyMultiplierMsat: FfiConverterUInt64.read(from: &buf), + liquidityPenaltyAmountMultiplierMsat: FfiConverterUInt64.read(from: &buf), + historicalLiquidityPenaltyMultiplierMsat: FfiConverterUInt64.read(from: &buf), + historicalLiquidityPenaltyAmountMultiplierMsat: FfiConverterUInt64.read(from: &buf), + antiProbingPenaltyMsat: FfiConverterUInt64.read(from: &buf), + consideredImpossiblePenaltyMsat: FfiConverterUInt64.read(from: &buf), + linearSuccessProbability: FfiConverterBool.read(from: &buf), + probingDiversityPenaltyMsat: FfiConverterUInt64.read(from: &buf) + ) + } + + public static func write(_ value: ScoringFeeParameters, into buf: inout [UInt8]) { + FfiConverterUInt64.write(value.basePenaltyMsat, into: &buf) + FfiConverterUInt64.write(value.basePenaltyAmountMultiplierMsat, into: &buf) + FfiConverterUInt64.write(value.liquidityPenaltyMultiplierMsat, into: &buf) + FfiConverterUInt64.write(value.liquidityPenaltyAmountMultiplierMsat, into: &buf) + FfiConverterUInt64.write(value.historicalLiquidityPenaltyMultiplierMsat, into: &buf) + FfiConverterUInt64.write(value.historicalLiquidityPenaltyAmountMultiplierMsat, into: &buf) + FfiConverterUInt64.write(value.antiProbingPenaltyMsat, into: &buf) + FfiConverterUInt64.write(value.consideredImpossiblePenaltyMsat, into: &buf) + FfiConverterBool.write(value.linearSuccessProbability, into: &buf) + FfiConverterUInt64.write(value.probingDiversityPenaltyMsat, into: &buf) + } +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public func FfiConverterTypeScoringFeeParameters_lift(_ buf: RustBuffer) throws -> ScoringFeeParameters { + return try FfiConverterTypeScoringFeeParameters.lift(buf) +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +public func FfiConverterTypeScoringFeeParameters_lower(_ value: ScoringFeeParameters) -> RustBuffer { + return FfiConverterTypeScoringFeeParameters.lower(value) +} + public struct SpendableUtxo { public var outpoint: OutPoint public var valueSats: UInt64 @@ -10461,6 +10681,54 @@ private struct FfiConverterOptionTypeRouteParametersConfig: FfiConverterRustBuff } } +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +private struct FfiConverterOptionTypeScoringDecayParameters: FfiConverterRustBuffer { + typealias SwiftType = ScoringDecayParameters? + + static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeScoringDecayParameters.write(value, into: &buf) + } + + static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeScoringDecayParameters.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + +#if swift(>=5.8) + @_documentation(visibility: private) +#endif +private struct FfiConverterOptionTypeScoringFeeParameters: FfiConverterRustBuffer { + typealias SwiftType = ScoringFeeParameters? + + static func write(_ value: SwiftType, into buf: inout [UInt8]) { + guard let value = value else { + writeInt(&buf, Int8(0)) + return + } + writeInt(&buf, Int8(1)) + FfiConverterTypeScoringFeeParameters.write(value, into: &buf) + } + + static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType { + switch try readInt(&buf) as Int8 { + case 0: return nil + case 1: return try FfiConverterTypeScoringFeeParameters.read(from: &buf) + default: throw UniffiInternalError.unexpectedOptionalTag + } + } +} + #if swift(>=5.8) @_documentation(visibility: private) #endif @@ -12751,6 +13019,12 @@ private var initializationResult: InitializationResult = { if uniffi_ldk_node_checksum_method_builder_set_pathfinding_scores_source() != 63501 { return InitializationResult.apiChecksumMismatch } + if uniffi_ldk_node_checksum_method_builder_set_scoring_decay_params() != 19869 { + return InitializationResult.apiChecksumMismatch + } + if uniffi_ldk_node_checksum_method_builder_set_scoring_fee_params() != 11588 { + return InitializationResult.apiChecksumMismatch + } if uniffi_ldk_node_checksum_method_builder_set_storage_dir_path() != 59019 { return InitializationResult.apiChecksumMismatch } diff --git a/src/builder.rs b/src/builder.rs index d0e4015b8..729fc6c4e 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -51,8 +51,8 @@ use crate::chain::ChainSource; use crate::config::{ default_user_config, may_announce_channel, AddressType, AddressTypeRuntimeConfig, AnnounceError, AsyncPaymentsRole, BitcoindRestClientConfig, Config, ElectrumSyncConfig, - EsploraSyncConfig, RuntimeSyncIntervals, DEFAULT_ESPLORA_SERVER_URL, DEFAULT_LOG_FILENAME, - DEFAULT_LOG_LEVEL, WALLET_KEYS_SEED_LEN, + EsploraSyncConfig, RuntimeSyncIntervals, ScoringDecayParameters, ScoringFeeParameters, + DEFAULT_ESPLORA_SERVER_URL, DEFAULT_LOG_FILENAME, DEFAULT_LOG_LEVEL, WALLET_KEYS_SEED_LEN, }; use crate::connection::ConnectionManager; use crate::event::EventQueue; @@ -497,6 +497,18 @@ impl NodeBuilder { self } + /// Sets scorer fee parameters used for pathfinding penalties. + pub fn set_scoring_fee_params(&mut self, params: ScoringFeeParameters) -> &mut Self { + self.config.scoring_fee_params = Some(params); + self + } + + /// Sets scorer decay parameters used for liquidity estimate decay. + pub fn set_scoring_decay_params(&mut self, params: ScoringDecayParameters) -> &mut Self { + self.config.scoring_decay_params = Some(params); + self + } + /// Configures the [`Node`] instance to source inbound liquidity from the given /// [bLIP-51 / LSPS1] service. /// @@ -1051,6 +1063,16 @@ impl ArcedNodeBuilder { self.inner.write().unwrap().set_pathfinding_scores_source(url); } + /// Sets scorer fee parameters used for pathfinding penalties. + pub fn set_scoring_fee_params(&self, params: ScoringFeeParameters) { + self.inner.write().unwrap().set_scoring_fee_params(params); + } + + /// Sets scorer decay parameters used for liquidity estimate decay. + pub fn set_scoring_decay_params(&self, params: ScoringDecayParameters) { + self.inner.write().unwrap().set_scoring_decay_params(params); + } + /// Configures the [`Node`] instance to source inbound liquidity from the given /// [bLIP-51 / LSPS1] service. /// @@ -1911,11 +1933,15 @@ fn build_with_store_internal( )); // Deserialize scorer + let scoring_decay_params = config + .scoring_decay_params + .clone() + .map(ProbabilisticScoringDecayParameters::from) + .unwrap_or_else(ProbabilisticScoringDecayParameters::default); let local_scorer = match scorer_data_res { Ok(data) => { - let params = ProbabilisticScoringDecayParameters::default(); let mut reader = Cursor::new(data); - let args = (params, Arc::clone(&network_graph), Arc::clone(&logger)); + let args = (scoring_decay_params, Arc::clone(&network_graph), Arc::clone(&logger)); match ProbabilisticScorer::read(&mut reader, args) { Ok(scorer) => scorer, Err(e) => { @@ -1925,8 +1951,11 @@ fn build_with_store_internal( } }, Err(e) if e.kind() == lightning::io::ErrorKind::NotFound => { - let params = ProbabilisticScoringDecayParameters::default(); - ProbabilisticScorer::new(params, Arc::clone(&network_graph), Arc::clone(&logger)) + ProbabilisticScorer::new( + scoring_decay_params, + Arc::clone(&network_graph), + Arc::clone(&logger), + ) }, Err(e) => { log_error!(logger, "Failed to read scoring data from store: {}", e); @@ -1958,7 +1987,11 @@ fn build_with_store_internal( }, } - let scoring_fee_params = ProbabilisticScoringFeeParameters::default(); + let scoring_fee_params = config + .scoring_fee_params + .clone() + .map(ProbabilisticScoringFeeParameters::from) + .unwrap_or_else(ProbabilisticScoringFeeParameters::default); let router = Arc::new(DefaultRouter::new( Arc::clone(&network_graph), Arc::clone(&logger), @@ -2530,7 +2563,8 @@ mod tests { use lightning::util::ser::Writeable; use super::{ - apply_channel_data_migration, sanitize_alias, BuildError, ChannelDataMigration, NodeAlias, + apply_channel_data_migration, sanitize_alias, BuildError, ChannelDataMigration, Config, + NodeAlias, NodeBuilder, ScoringDecayParameters, ScoringFeeParameters, }; use crate::io::test_utils::InMemoryStore; use crate::logger::Logger; @@ -2573,6 +2607,48 @@ mod tests { assert_eq!(node.err().unwrap(), BuildError::InvalidNodeAlias); } + #[test] + fn set_scoring_params_updates_builder_config() { + let mut builder = NodeBuilder::from_config(Config::default()); + let fee_params = ScoringFeeParameters { + base_penalty_msat: 2_000, + base_penalty_amount_multiplier_msat: 200_000, + liquidity_penalty_multiplier_msat: 1, + liquidity_penalty_amount_multiplier_msat: 2, + historical_liquidity_penalty_multiplier_msat: 20_000, + historical_liquidity_penalty_amount_multiplier_msat: 2_500, + anti_probing_penalty_msat: 500, + considered_impossible_penalty_msat: 999_999, + linear_success_probability: true, + probing_diversity_penalty_msat: 321, + }; + let decay_params = ScoringDecayParameters { + historical_no_updates_half_life_secs: 1_234, + liquidity_offset_half_life_secs: 567, + }; + + builder.set_scoring_fee_params(fee_params.clone()); + builder.set_scoring_decay_params(decay_params.clone()); + + assert_eq!( + builder.config.scoring_fee_params.as_ref().unwrap().base_penalty_msat, + fee_params.base_penalty_msat + ); + assert_eq!( + builder.config.scoring_fee_params.as_ref().unwrap().linear_success_probability, + fee_params.linear_success_probability + ); + assert_eq!( + builder + .config + .scoring_decay_params + .as_ref() + .unwrap() + .historical_no_updates_half_life_secs, + decay_params.historical_no_updates_half_life_secs + ); + } + /// Creates valid serialized (BlockHash, ChannelMonitor) bytes for testing. /// /// Uses LDK's functional test utilities to create a real channel between two diff --git a/src/config.rs b/src/config.rs index 0df143a40..e2fa1aa66 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,6 +14,9 @@ use bitcoin::secp256k1::PublicKey; use bitcoin::Network; use lightning::ln::msgs::SocketAddress; use lightning::routing::gossip::NodeAlias; +use lightning::routing::scoring::{ + ProbabilisticScoringDecayParameters, ProbabilisticScoringFeeParameters, +}; use lightning::routing::router::RouteParametersConfig; use lightning::util::config::{ ChannelConfig as LdkChannelConfig, MaxDustHTLCExposure as LdkMaxDustHTLCExposure, UserConfig, @@ -291,6 +294,14 @@ pub struct Config { /// **Note:** If unset, default parameters will be used, and you will be able to override the /// parameters on a per-payment basis in the corresponding method calls. pub route_parameters: Option, + /// Optional parameters for configuring routing scorer fee penalties. + /// + /// If unset, defaults from [`ProbabilisticScoringFeeParameters::default`] are used. + pub scoring_fee_params: Option, + /// Optional parameters for configuring routing scorer decay behavior. + /// + /// If unset, defaults from [`ProbabilisticScoringDecayParameters::default`] are used. + pub scoring_decay_params: Option, /// Whether to include unconfirmed funds from external sources in spendable balance. /// /// If `true`, [`BalanceDetails::spendable_onchain_balance_sats`] will include @@ -321,6 +332,8 @@ impl Default for Config { probing_liquidity_limit_multiplier: DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER, anchor_channels_config: Some(AnchorChannelsConfig::default()), route_parameters: None, + scoring_fee_params: None, + scoring_decay_params: None, node_alias: None, include_untrusted_pending_in_spendable: false, address_type: AddressType::default(), @@ -329,6 +342,113 @@ impl Default for Config { } } +/// Configuration options for [`ProbabilisticScoringFeeParameters`]. +#[derive(Debug, Clone)] +pub struct ScoringFeeParameters { + /// See [`ProbabilisticScoringFeeParameters::base_penalty_msat`]. + pub base_penalty_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::base_penalty_amount_multiplier_msat`]. + pub base_penalty_amount_multiplier_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat`]. + pub liquidity_penalty_multiplier_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat`]. + pub liquidity_penalty_amount_multiplier_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat`]. + pub historical_liquidity_penalty_multiplier_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat`]. + pub historical_liquidity_penalty_amount_multiplier_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::anti_probing_penalty_msat`]. + pub anti_probing_penalty_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::considered_impossible_penalty_msat`]. + pub considered_impossible_penalty_msat: u64, + /// See [`ProbabilisticScoringFeeParameters::linear_success_probability`]. + pub linear_success_probability: bool, + /// See [`ProbabilisticScoringFeeParameters::probing_diversity_penalty_msat`]. + pub probing_diversity_penalty_msat: u64, +} + +impl Default for ScoringFeeParameters { + fn default() -> Self { + let params = ProbabilisticScoringFeeParameters::default(); + Self::from(params) + } +} + +impl From for ScoringFeeParameters { + fn from(value: ProbabilisticScoringFeeParameters) -> Self { + Self { + base_penalty_msat: value.base_penalty_msat, + base_penalty_amount_multiplier_msat: value.base_penalty_amount_multiplier_msat, + liquidity_penalty_multiplier_msat: value.liquidity_penalty_multiplier_msat, + liquidity_penalty_amount_multiplier_msat: value.liquidity_penalty_amount_multiplier_msat, + historical_liquidity_penalty_multiplier_msat: value + .historical_liquidity_penalty_multiplier_msat, + historical_liquidity_penalty_amount_multiplier_msat: value + .historical_liquidity_penalty_amount_multiplier_msat, + anti_probing_penalty_msat: value.anti_probing_penalty_msat, + considered_impossible_penalty_msat: value.considered_impossible_penalty_msat, + linear_success_probability: value.linear_success_probability, + probing_diversity_penalty_msat: value.probing_diversity_penalty_msat, + } + } +} + +impl From for ProbabilisticScoringFeeParameters { + fn from(value: ScoringFeeParameters) -> Self { + let mut params = ProbabilisticScoringFeeParameters::default(); + params.base_penalty_msat = value.base_penalty_msat; + params.base_penalty_amount_multiplier_msat = value.base_penalty_amount_multiplier_msat; + params.liquidity_penalty_multiplier_msat = value.liquidity_penalty_multiplier_msat; + params.liquidity_penalty_amount_multiplier_msat = + value.liquidity_penalty_amount_multiplier_msat; + params.historical_liquidity_penalty_multiplier_msat = + value.historical_liquidity_penalty_multiplier_msat; + params.historical_liquidity_penalty_amount_multiplier_msat = + value.historical_liquidity_penalty_amount_multiplier_msat; + params.anti_probing_penalty_msat = value.anti_probing_penalty_msat; + params.considered_impossible_penalty_msat = value.considered_impossible_penalty_msat; + params.linear_success_probability = value.linear_success_probability; + params.probing_diversity_penalty_msat = value.probing_diversity_penalty_msat; + params + } +} + +/// Configuration options for [`ProbabilisticScoringDecayParameters`]. +#[derive(Debug, Clone)] +pub struct ScoringDecayParameters { + /// See [`ProbabilisticScoringDecayParameters::historical_no_updates_half_life`]. + pub historical_no_updates_half_life_secs: u64, + /// See [`ProbabilisticScoringDecayParameters::liquidity_offset_half_life`]. + pub liquidity_offset_half_life_secs: u64, +} + +impl Default for ScoringDecayParameters { + fn default() -> Self { + let params = ProbabilisticScoringDecayParameters::default(); + Self::from(params) + } +} + +impl From for ScoringDecayParameters { + fn from(value: ProbabilisticScoringDecayParameters) -> Self { + Self { + historical_no_updates_half_life_secs: value.historical_no_updates_half_life.as_secs(), + liquidity_offset_half_life_secs: value.liquidity_offset_half_life.as_secs(), + } + } +} + +impl From for ProbabilisticScoringDecayParameters { + fn from(value: ScoringDecayParameters) -> Self { + Self { + historical_no_updates_half_life: Duration::from_secs( + value.historical_no_updates_half_life_secs, + ), + liquidity_offset_half_life: Duration::from_secs(value.liquidity_offset_half_life_secs), + } + } +} + /// Configuration options pertaining to 'Anchor' channels, i.e., channels for which the /// `option_anchors_zero_fee_htlc_tx` channel type is negotiated. /// diff --git a/src/ffi/types.rs b/src/ffi/types.rs index 147bde5e4..e439c2cb4 100644 --- a/src/ffi/types.rs +++ b/src/ffi/types.rs @@ -47,7 +47,7 @@ use crate::builder::sanitize_alias; pub use crate::config::{ battery_saving_sync_intervals, default_config, AddressType, AnchorChannelsConfig, BackgroundSyncConfig, ElectrumSyncConfig, EsploraSyncConfig, MaxDustHTLCExposure, - RuntimeSyncIntervals, + RuntimeSyncIntervals, ScoringDecayParameters, ScoringFeeParameters, }; use crate::error::Error; pub use crate::graph::{ChannelInfo, ChannelUpdateInfo, NodeAnnouncementInfo, NodeInfo};