diff --git a/libs/sdk-bindings/src/breez_sdk.udl b/libs/sdk-bindings/src/breez_sdk.udl index ec583a2e6..3234f8631 100644 --- a/libs/sdk-bindings/src/breez_sdk.udl +++ b/libs/sdk-bindings/src/breez_sdk.udl @@ -188,7 +188,7 @@ dictionary NodeState { u64 max_chan_reserve_msats; sequence connected_peers; u64 max_receivable_single_payment_amount_msat; - u64 inbound_liquidity_msats; + u64 total_inbound_liquidity_msats; }; dictionary ConfigureNodeRequest { diff --git a/libs/sdk-core/src/breez_services.rs b/libs/sdk-core/src/breez_services.rs index 51423af0d..dd72f585b 100644 --- a/libs/sdk-core/src/breez_services.rs +++ b/libs/sdk-core/src/breez_services.rs @@ -3275,7 +3275,7 @@ pub(crate) mod tests { max_chan_reserve_msats: 0, connected_peers: vec!["1111".to_string()], max_receivable_single_payment_amount_msat: 2_000, - inbound_liquidity_msats: 10_000, + total_inbound_liquidity_msats: 10_000, } } } diff --git a/libs/sdk-core/src/bridge_generated.rs b/libs/sdk-core/src/bridge_generated.rs index 89c5230c1..fe54e5a91 100644 --- a/libs/sdk-core/src/bridge_generated.rs +++ b/libs/sdk-core/src/bridge_generated.rs @@ -2061,7 +2061,9 @@ impl support::IntoDart for NodeState { self.max_receivable_single_payment_amount_msat .into_into_dart() .into_dart(), - self.inbound_liquidity_msats.into_into_dart().into_dart(), + self.total_inbound_liquidity_msats + .into_into_dart() + .into_dart(), ] .into_dart() } diff --git a/libs/sdk-core/src/greenlight/node_api.rs b/libs/sdk-core/src/greenlight/node_api.rs index bc9b95c50..29ffa1d0c 100644 --- a/libs/sdk-core/src/greenlight/node_api.rs +++ b/libs/sdk-core/src/greenlight/node_api.rs @@ -943,7 +943,7 @@ impl NodeAPI for Greenlight { // calculate payment limits and inbound liquidity let mut max_payable: u64 = 0; let mut max_receivable_single_channel: u64 = 0; - let mut inbound_liquidity_msats: u64 = 0; + let mut total_inbound_liquidity_msats: u64 = 0; opened_channels.iter().try_for_each(|c| -> Result<()> { max_payable += c .spendable_msat @@ -955,7 +955,7 @@ impl NodeAPI for Greenlight { .as_ref() .map(|a| a.msat) .unwrap_or_default(); - inbound_liquidity_msats += receivable_amount; + total_inbound_liquidity_msats += receivable_amount; if receivable_amount > max_receivable_single_channel { max_receivable_single_channel = receivable_amount; } @@ -979,7 +979,7 @@ impl NodeAPI for Greenlight { max_chan_reserve_msats: channels_balance - min(max_payable, channels_balance), connected_peers, max_receivable_single_payment_amount_msat: max_receivable_single_channel, - inbound_liquidity_msats, + total_inbound_liquidity_msats, }; let mut htlc_list: Vec = Vec::new(); for channel in all_channel_models.clone() { diff --git a/libs/sdk-core/src/models.rs b/libs/sdk-core/src/models.rs index 9664cab6f..60f0c87ce 100644 --- a/libs/sdk-core/src/models.rs +++ b/libs/sdk-core/src/models.rs @@ -634,7 +634,7 @@ pub struct NodeState { pub max_receivable_single_payment_amount_msat: u64, /// Total receivable on all available channels - pub inbound_liquidity_msats: u64, + pub total_inbound_liquidity_msats: u64, } /// Internal response to a [crate::node_api::NodeAPI::pull_changed] call diff --git a/libs/sdk-flutter/lib/bridge_generated.dart b/libs/sdk-flutter/lib/bridge_generated.dart index f01741b64..467cd1248 100644 --- a/libs/sdk-flutter/lib/bridge_generated.dart +++ b/libs/sdk-flutter/lib/bridge_generated.dart @@ -1124,7 +1124,7 @@ class NodeState { final int maxReceivableSinglePaymentAmountMsat; /// Total receivable on all available channels - final int inboundLiquidityMsats; + final int totalInboundLiquidityMsats; const NodeState({ required this.id, @@ -1139,7 +1139,7 @@ class NodeState { required this.maxChanReserveMsats, required this.connectedPeers, required this.maxReceivableSinglePaymentAmountMsat, - required this.inboundLiquidityMsats, + required this.totalInboundLiquidityMsats, }); } @@ -3769,7 +3769,7 @@ class BreezSdkCoreImpl implements BreezSdkCore { maxChanReserveMsats: _wire2api_u64(arr[9]), connectedPeers: _wire2api_StringList(arr[10]), maxReceivableSinglePaymentAmountMsat: _wire2api_u64(arr[11]), - inboundLiquidityMsats: _wire2api_u64(arr[12]), + totalInboundLiquidityMsats: _wire2api_u64(arr[12]), ); } diff --git a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt index 3b97e3e30..6fe004123 100644 --- a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt +++ b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt @@ -1756,7 +1756,7 @@ fun asNodeState(nodeState: ReadableMap): NodeState? { "maxChanReserveMsats", "connectedPeers", "maxReceivableSinglePaymentAmountMsat", - "inboundLiquidityMsats", + "totalInboundLiquidityMsats", ), ) ) { @@ -1774,7 +1774,7 @@ fun asNodeState(nodeState: ReadableMap): NodeState? { val maxChanReserveMsats = nodeState.getDouble("maxChanReserveMsats").toULong() val connectedPeers = nodeState.getArray("connectedPeers")?.let { asStringList(it) }!! val maxReceivableSinglePaymentAmountMsat = nodeState.getDouble("maxReceivableSinglePaymentAmountMsat").toULong() - val inboundLiquidityMsats = nodeState.getDouble("inboundLiquidityMsats").toULong() + val totalInboundLiquidityMsats = nodeState.getDouble("totalInboundLiquidityMsats").toULong() return NodeState( id, blockHeight, @@ -1788,7 +1788,7 @@ fun asNodeState(nodeState: ReadableMap): NodeState? { maxChanReserveMsats, connectedPeers, maxReceivableSinglePaymentAmountMsat, - inboundLiquidityMsats, + totalInboundLiquidityMsats, ) } @@ -1806,7 +1806,7 @@ fun readableMapOf(nodeState: NodeState): ReadableMap = "maxChanReserveMsats" to nodeState.maxChanReserveMsats, "connectedPeers" to readableArrayOf(nodeState.connectedPeers), "maxReceivableSinglePaymentAmountMsat" to nodeState.maxReceivableSinglePaymentAmountMsat, - "inboundLiquidityMsats" to nodeState.inboundLiquidityMsats, + "totalInboundLiquidityMsats" to nodeState.totalInboundLiquidityMsats, ) fun asNodeStateList(arr: ReadableArray): List { diff --git a/libs/sdk-react-native/ios/BreezSDKMapper.swift b/libs/sdk-react-native/ios/BreezSDKMapper.swift index 73cdc76c8..3031b3c9f 100644 --- a/libs/sdk-react-native/ios/BreezSDKMapper.swift +++ b/libs/sdk-react-native/ios/BreezSDKMapper.swift @@ -2024,8 +2024,8 @@ enum BreezSDKMapper { guard let maxReceivableSinglePaymentAmountMsat = nodeState["maxReceivableSinglePaymentAmountMsat"] as? UInt64 else { throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "maxReceivableSinglePaymentAmountMsat", typeName: "NodeState")) } - guard let inboundLiquidityMsats = nodeState["inboundLiquidityMsats"] as? UInt64 else { - throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "inboundLiquidityMsats", typeName: "NodeState")) + guard let totalInboundLiquidityMsats = nodeState["totalInboundLiquidityMsats"] as? UInt64 else { + throw SdkError.Generic(message: errMissingMandatoryField(fieldName: "totalInboundLiquidityMsats", typeName: "NodeState")) } return NodeState( @@ -2041,7 +2041,7 @@ enum BreezSDKMapper { maxChanReserveMsats: maxChanReserveMsats, connectedPeers: connectedPeers, maxReceivableSinglePaymentAmountMsat: maxReceivableSinglePaymentAmountMsat, - inboundLiquidityMsats: inboundLiquidityMsats + totalInboundLiquidityMsats: totalInboundLiquidityMsats ) } @@ -2059,7 +2059,7 @@ enum BreezSDKMapper { "maxChanReserveMsats": nodeState.maxChanReserveMsats, "connectedPeers": nodeState.connectedPeers, "maxReceivableSinglePaymentAmountMsat": nodeState.maxReceivableSinglePaymentAmountMsat, - "inboundLiquidityMsats": nodeState.inboundLiquidityMsats, + "totalInboundLiquidityMsats": nodeState.totalInboundLiquidityMsats, ] } diff --git a/libs/sdk-react-native/src/index.ts b/libs/sdk-react-native/src/index.ts index 44dfe73f5..cfcf50f2c 100644 --- a/libs/sdk-react-native/src/index.ts +++ b/libs/sdk-react-native/src/index.ts @@ -292,7 +292,7 @@ export interface NodeState { maxChanReserveMsats: number connectedPeers: string[] maxReceivableSinglePaymentAmountMsat: number - inboundLiquidityMsats: number + totalInboundLiquidityMsats: number } export interface OnchainPaymentLimitsResponse {