+/// Set to announce the channel publicly and notify all nodes that they can route via this
+/// channel.
+///
+/// This should only be set to true for nodes which expect to be online reliably.
+///
+/// As the node which funds a channel picks this value this will only apply for new outbound
+/// channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
+///
+/// Default value: false.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_get_announced_channel(this_ptr: &ChannelHandshakeConfig) -> bool {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().announced_channel;
+ *inner_val
+}
+/// Set to announce the channel publicly and notify all nodes that they can route via this
+/// channel.
+///
+/// This should only be set to true for nodes which expect to be online reliably.
+///
+/// As the node which funds a channel picks this value this will only apply for new outbound
+/// channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
+///
+/// Default value: false.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_set_announced_channel(this_ptr: &mut ChannelHandshakeConfig, mut val: bool) {
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.announced_channel = val;
+}
+/// When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
+/// supports it, they will then enforce the mutual-close output to us matches what we provided
+/// at intialization, preventing us from closing to an alternate pubkey.
+///
+/// This is set to true by default to provide a slight increase in security, though ultimately
+/// any attacker who is able to take control of a channel can just as easily send the funds via
+/// lightning payments, so we never require that our counterparties support this option.
+///
+/// The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
+///
+/// Default value: true.
+///
+/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(this_ptr: &ChannelHandshakeConfig) -> bool {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().commit_upfront_shutdown_pubkey;
+ *inner_val
+}
+/// When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
+/// supports it, they will then enforce the mutual-close output to us matches what we provided
+/// at intialization, preventing us from closing to an alternate pubkey.
+///
+/// This is set to true by default to provide a slight increase in security, though ultimately
+/// any attacker who is able to take control of a channel can just as easily send the funds via
+/// lightning payments, so we never require that our counterparties support this option.
+///
+/// The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
+///
+/// Default value: true.
+///
+/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(this_ptr: &mut ChannelHandshakeConfig, mut val: bool) {
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.commit_upfront_shutdown_pubkey = val;
+}
+/// The Proportion of the channel value to configure as counterparty's channel reserve,
+/// i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
+///
+/// `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
+/// on their side, at all times.
+/// This ensures that if our counterparty broadcasts a revoked state, we can punish them by
+/// claiming at least this value on chain.
+///
+/// Channel reserve values greater than 30% could be considered highly unreasonable, since that
+/// amount can never be used for payments.
+/// Also, if our selected channel reserve for counterparty and counterparty's selected
+/// channel reserve for us sum up to equal or greater than channel value, channel negotiations
+/// will fail.
+///
+/// Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
+/// other than the default value.
+///
+/// Default value: 1% of channel value, i.e., configured as 10,000 millionths.
+/// Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
+/// as 1000 sats instead, which is a safe implementation-specific lower bound.
+/// Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
+/// instead, although channel negotiations will fail in that case.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(this_ptr: &ChannelHandshakeConfig) -> u32 {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().their_channel_reserve_proportional_millionths;
+ *inner_val
+}
+/// The Proportion of the channel value to configure as counterparty's channel reserve,
+/// i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
+///
+/// `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
+/// on their side, at all times.
+/// This ensures that if our counterparty broadcasts a revoked state, we can punish them by
+/// claiming at least this value on chain.
+///
+/// Channel reserve values greater than 30% could be considered highly unreasonable, since that
+/// amount can never be used for payments.
+/// Also, if our selected channel reserve for counterparty and counterparty's selected
+/// channel reserve for us sum up to equal or greater than channel value, channel negotiations
+/// will fail.
+///
+/// Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
+/// other than the default value.
+///
+/// Default value: 1% of channel value, i.e., configured as 10,000 millionths.
+/// Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
+/// as 1000 sats instead, which is a safe implementation-specific lower bound.
+/// Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
+/// instead, although channel negotiations will fail in that case.
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(this_ptr: &mut ChannelHandshakeConfig, mut val: u32) {
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.their_channel_reserve_proportional_millionths = val;
+}