@@ -464,6 +464,41 @@ pub struct Channel {
464464 /// such that the outgoing HTLC is forwardable to this counterparty.
465465 #[ prost( uint32, optional, tag = "25" ) ]
466466 pub counterparty_forwarding_info_cltv_expiry_delta : :: core:: option:: Option < u32 > ,
467+ /// The channel's `short_channel_id`, if we've negotiated the funding transaction with our
468+ /// counterparty already and it's reached the required number of confirmations.
469+ ///
470+ /// Note that if an inbound SCID alias is set, that will be used for invoices and inbound
471+ /// payments instead of this value.
472+ #[ prost( uint64, optional, tag = "26" ) ]
473+ pub short_channel_id : :: core:: option:: Option < u64 > ,
474+ /// An optional `short_channel_id` alias for this channel, randomly generated by us and usable
475+ /// in place of `short_channel_id` to reference the channel in outbound routes when the channel
476+ /// has not yet been confirmed.
477+ #[ prost( uint64, optional, tag = "27" ) ]
478+ pub outbound_scid_alias : :: core:: option:: Option < u64 > ,
479+ /// An optional `short_channel_id` alias for this channel, randomly generated by our
480+ /// counterparty and usable in place of `short_channel_id` in invoice route hints. Our
481+ /// counterparty will recognize the alias provided here in place of the `short_channel_id`
482+ /// when they see a payment to be routed to us.
483+ #[ prost( uint64, optional, tag = "28" ) ]
484+ pub inbound_scid_alias : :: core:: option:: Option < u64 > ,
485+ /// The smallest value HTLC (in msat) we will accept, for this channel.
486+ #[ prost( uint64, tag = "29" ) ]
487+ pub inbound_htlc_minimum_msat : u64 ,
488+ /// The largest value HTLC (in msat) we currently will accept, for this channel.
489+ #[ prost( uint64, optional, tag = "30" ) ]
490+ pub inbound_htlc_maximum_msat : :: core:: option:: Option < u64 > ,
491+ /// The current shutdown state of the channel, if any.
492+ ///
493+ /// Will be unset for objects serialized with LDK Node v0.1 and earlier.
494+ #[ prost( enumeration = "ChannelShutdownState" , optional, tag = "31" ) ]
495+ pub channel_shutdown_state : :: core:: option:: Option < i32 > ,
496+ /// The type of on-chain reserve maintained for this channel.
497+ ///
498+ /// Will be unset until channel negotiation has completed and determined whether this channel
499+ /// uses anchor or legacy reserve behavior.
500+ #[ prost( enumeration = "ReserveType" , optional, tag = "32" ) ]
501+ pub reserve_type : :: core:: option:: Option < i32 > ,
467502}
468503/// ChannelConfig represents the configuration settings for a channel in a Lightning Network node.
469504/// See more: <https://docs.rs/lightning/latest/lightning/util/config/struct.ChannelConfig.html>
@@ -1352,6 +1387,99 @@ impl Network {
13521387 }
13531388 }
13541389}
1390+ /// ChannelShutdownState mirrors LDK's `lightning::ln::channel_state::ChannelShutdownState`,
1391+ /// indicating how far along a channel is in the cooperative close process.
1392+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
1393+ #[ cfg_attr( feature = "serde" , serde( rename_all = "snake_case" ) ) ]
1394+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
1395+ #[ repr( i32 ) ]
1396+ pub enum ChannelShutdownState {
1397+ Unspecified = 0 ,
1398+ /// Channel has not sent or received a shutdown message.
1399+ NotShuttingDown = 1 ,
1400+ /// Local node has sent a shutdown message for this channel.
1401+ ShutdownInitiated = 2 ,
1402+ /// Shutdown message exchanges have concluded and the channels are in the midst of
1403+ /// resolving all existing open HTLCs before closing can continue.
1404+ ResolvingHtlcs = 3 ,
1405+ /// All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee
1406+ /// rates.
1407+ NegotiatingClosingFee = 4 ,
1408+ /// We've successfully negotiated a closing_signed dance. At this point the channel is about
1409+ /// to be dropped.
1410+ ShutdownComplete = 5 ,
1411+ }
1412+ impl ChannelShutdownState {
1413+ /// String value of the enum field names used in the ProtoBuf definition.
1414+ ///
1415+ /// The values are not transformed in any way and thus are considered stable
1416+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1417+ pub fn as_str_name ( & self ) -> & ' static str {
1418+ match self {
1419+ ChannelShutdownState :: Unspecified => "CHANNEL_SHUTDOWN_STATE_UNSPECIFIED" ,
1420+ ChannelShutdownState :: NotShuttingDown => "CHANNEL_SHUTDOWN_STATE_NOT_SHUTTING_DOWN" ,
1421+ ChannelShutdownState :: ShutdownInitiated => "CHANNEL_SHUTDOWN_STATE_SHUTDOWN_INITIATED" ,
1422+ ChannelShutdownState :: ResolvingHtlcs => "CHANNEL_SHUTDOWN_STATE_RESOLVING_HTLCS" ,
1423+ ChannelShutdownState :: NegotiatingClosingFee => {
1424+ "CHANNEL_SHUTDOWN_STATE_NEGOTIATING_CLOSING_FEE"
1425+ } ,
1426+ ChannelShutdownState :: ShutdownComplete => "CHANNEL_SHUTDOWN_STATE_SHUTDOWN_COMPLETE" ,
1427+ }
1428+ }
1429+ /// Creates an enum from field names used in the ProtoBuf definition.
1430+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
1431+ match value {
1432+ "CHANNEL_SHUTDOWN_STATE_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
1433+ "CHANNEL_SHUTDOWN_STATE_NOT_SHUTTING_DOWN" => Some ( Self :: NotShuttingDown ) ,
1434+ "CHANNEL_SHUTDOWN_STATE_SHUTDOWN_INITIATED" => Some ( Self :: ShutdownInitiated ) ,
1435+ "CHANNEL_SHUTDOWN_STATE_RESOLVING_HTLCS" => Some ( Self :: ResolvingHtlcs ) ,
1436+ "CHANNEL_SHUTDOWN_STATE_NEGOTIATING_CLOSING_FEE" => Some ( Self :: NegotiatingClosingFee ) ,
1437+ "CHANNEL_SHUTDOWN_STATE_SHUTDOWN_COMPLETE" => Some ( Self :: ShutdownComplete ) ,
1438+ _ => None ,
1439+ }
1440+ }
1441+ }
1442+ /// ReserveType mirrors LDK Node's `ReserveType`, indicating the kind of on-chain reserve
1443+ /// maintained for a channel, if any has been determined yet.
1444+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
1445+ #[ cfg_attr( feature = "serde" , serde( rename_all = "snake_case" ) ) ]
1446+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
1447+ #[ repr( i32 ) ]
1448+ pub enum ReserveType {
1449+ Unspecified = 0 ,
1450+ /// An anchor outputs channel where we maintain a per-channel on-chain reserve for fee
1451+ /// bumping force-close transactions.
1452+ Adaptive = 1 ,
1453+ /// An anchor outputs channel where we do not maintain any reserve, because the counterparty
1454+ /// is in our trusted_peers_no_reserve list.
1455+ TrustedPeersNoReserve = 2 ,
1456+ /// A legacy (pre-anchor) channel using only option_static_remotekey.
1457+ Legacy = 3 ,
1458+ }
1459+ impl ReserveType {
1460+ /// String value of the enum field names used in the ProtoBuf definition.
1461+ ///
1462+ /// The values are not transformed in any way and thus are considered stable
1463+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1464+ pub fn as_str_name ( & self ) -> & ' static str {
1465+ match self {
1466+ ReserveType :: Unspecified => "RESERVE_TYPE_UNSPECIFIED" ,
1467+ ReserveType :: Adaptive => "RESERVE_TYPE_ADAPTIVE" ,
1468+ ReserveType :: TrustedPeersNoReserve => "RESERVE_TYPE_TRUSTED_PEERS_NO_RESERVE" ,
1469+ ReserveType :: Legacy => "RESERVE_TYPE_LEGACY" ,
1470+ }
1471+ }
1472+ /// Creates an enum from field names used in the ProtoBuf definition.
1473+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
1474+ match value {
1475+ "RESERVE_TYPE_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
1476+ "RESERVE_TYPE_ADAPTIVE" => Some ( Self :: Adaptive ) ,
1477+ "RESERVE_TYPE_TRUSTED_PEERS_NO_RESERVE" => Some ( Self :: TrustedPeersNoReserve ) ,
1478+ "RESERVE_TYPE_LEGACY" => Some ( Self :: Legacy ) ,
1479+ _ => None ,
1480+ }
1481+ }
1482+ }
13551483/// Indicates whether the balance is derived from a cooperative close, a force-close (for holder or counterparty),
13561484/// or whether it is for an HTLC.
13571485#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
0 commit comments