From f2fc642f0de4a572f09498c042e639261a6fbd45 Mon Sep 17 00:00:00 2001 From: Roei Erez Date: Tue, 17 Sep 2024 13:14:21 +0300 Subject: [PATCH] fix notifications code to compile with the new node state properties --- .../main/kotlin/breez_sdk_notification/job/LnurlPayInfo.kt | 4 ++-- .../bindings-swift/Sources/BreezSDK/Task/LnurlPayInfo.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/job/LnurlPayInfo.kt b/libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/job/LnurlPayInfo.kt index 61b575c1b..bffd17ac3 100644 --- a/libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/job/LnurlPayInfo.kt +++ b/libs/sdk-bindings/bindings-android/lib/src/main/kotlin/breez_sdk_notification/job/LnurlPayInfo.kt @@ -71,12 +71,12 @@ class LnurlPayInfoJob( } // Calculate the maximum sendable amount (in millisatoshis) val maxSendable = maxOf( - nodeInfo.inboundLiquidityMsats, + nodeInfo.maxReceivableSinglePaymentAmountMsat, maxReceivableMsatFeeLimit, ) // Get the minimum sendable amount (in millisatoshis), can not be less than 1 or more than maxSendable val minSendable: ULong = - if (nodeInfo.inboundLiquidityMsats < 1000UL) ofp.minMsat else 1000UL + if (nodeInfo.maxReceivableSinglePaymentAmountMsat < 1000UL) ofp.minMsat else 1000UL if (minSendable > maxSendable) { throw InvalidMinSendableException("Minimum sendable amount can't be greater than maximum sendable amount.") } diff --git a/libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Task/LnurlPayInfo.swift b/libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Task/LnurlPayInfo.swift index c7818c7cf..ae44224e4 100644 --- a/libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Task/LnurlPayInfo.swift +++ b/libs/sdk-bindings/bindings-swift/Sources/BreezSDK/Task/LnurlPayInfo.swift @@ -57,9 +57,9 @@ class LnurlPayInfoTask : LnurlPayTask { UInt64(Double(feeLimitMsat) / proportionalPercent) ) : nodeInfo.maxReceivableMsat // Calculate the maximum sendable amount (in millisatoshis) - let maxSendable = max(nodeInfo.inboundLiquidityMsats, maxReceivableMsatFeeLimit) + let maxSendable = max(nodeInfo.maxReceivableSinglePaymentAmountMsat, maxReceivableMsatFeeLimit) // Get the minimum sendable amount (in millisatoshis), can not be less than 1 or more than maxSendable - let minSendable: UInt64 = nodeInfo.inboundLiquidityMsats < UInt64(1000) ? ofp.minMsat : UInt64(1000) + let minSendable: UInt64 = nodeInfo.maxReceivableSinglePaymentAmountMsat < UInt64(1000) ? ofp.minMsat : UInt64(1000) if minSendable > maxSendable { throw InvalidMinSendable.largerThanMaxSendable }