diff --git a/bindings/ldk_node.udl b/bindings/ldk_node.udl index 155c34ffb..a9ed4ff5b 100644 --- a/bindings/ldk_node.udl +++ b/bindings/ldk_node.udl @@ -411,6 +411,9 @@ dictionary ChannelDetails { ChannelId channel_id; PublicKey counterparty_node_id; OutPoint? funding_txo; + u64? short_channel_id; + u64? outbound_scid_alias; + u64? inbound_scid_alias; u64 channel_value_sats; u64? unspendable_punishment_reserve; UserChannelId user_channel_id; diff --git a/src/types.rs b/src/types.rs index 4d0e892fe..2b350be63 100644 --- a/src/types.rs +++ b/src/types.rs @@ -184,6 +184,39 @@ pub struct ChannelDetails { /// The channel's funding transaction output, if we've negotiated the funding transaction with /// our counterparty already. pub funding_txo: Option, + /// The position of the funding transaction in the chain. None if the funding transaction has + /// not yet been confirmed and the channel fully opened. + /// + /// Note that if [`inbound_scid_alias`] is set, it will be used for invoices and inbound + /// payments instead of this. + /// + /// For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may + /// be used in place of this in outbound routes. + /// + /// [`inbound_scid_alias`]: Self::inbound_scid_alias + /// [`outbound_scid_alias`]: Self::outbound_scid_alias + /// [`confirmations_required`]: Self::confirmations_required + pub short_channel_id: Option, + /// An optional [`short_channel_id`] alias for this channel, randomly generated by us and + /// usable in place of [`short_channel_id`] to reference the channel in outbound routes when + /// the channel has not yet been confirmed (as long as [`confirmations_required`] is + /// `Some(0)`). + /// + /// This will be `None` as long as the channel is not available for routing outbound payments. + /// + /// [`short_channel_id`]: Self::short_channel_id + /// [`confirmations_required`]: Self::confirmations_required + pub outbound_scid_alias: Option, + /// An optional [`short_channel_id`] alias for this channel, randomly generated by our + /// counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our + /// counterparty will recognize the alias provided here in place of the [`short_channel_id`] + /// when they see a payment to be routed to us. + /// + /// Our counterparty may choose to rotate this value at any time, though will always recognize + /// previous values for inbound payment forwarding. + /// + /// [`short_channel_id`]: Self::short_channel_id + pub inbound_scid_alias: Option, /// The value, in satoshis, of this channel as it appears in the funding output. pub channel_value_sats: u64, /// The value, in satoshis, that must always be held as a reserve in the channel for us. This @@ -295,6 +328,9 @@ impl From for ChannelDetails { channel_id: value.channel_id, counterparty_node_id: value.counterparty.node_id, funding_txo: value.funding_txo.map(|o| o.into_bitcoin_outpoint()), + short_channel_id: value.short_channel_id, + outbound_scid_alias: value.outbound_scid_alias, + inbound_scid_alias: value.inbound_scid_alias, channel_value_sats: value.channel_value_satoshis, unspendable_punishment_reserve: value.unspendable_punishment_reserve, user_channel_id: UserChannelId(value.user_channel_id),