+pub extern "C" fn ChannelCounterparty_get_forwarding_info(this_ptr: &ChannelCounterparty) -> crate::lightning::ln::channelmanager::CounterpartyForwardingInfo {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().forwarding_info;
+ let mut local_inner_val = crate::lightning::ln::channelmanager::CounterpartyForwardingInfo { inner: unsafe { (if inner_val.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (inner_val.as_ref().unwrap()) }) } as *const lightning::ln::channelmanager::CounterpartyForwardingInfo<>) as *mut _ }, is_owned: false };
+ local_inner_val
+}
+/// Information on the fees and requirements that the counterparty requires when forwarding
+/// payments to us through this channel.
+///
+/// Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_set_forwarding_info(this_ptr: &mut ChannelCounterparty, mut val: crate::lightning::ln::channelmanager::CounterpartyForwardingInfo) {
+ let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.forwarding_info = local_val;
+}
+/// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+/// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+/// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_get_outbound_htlc_minimum_msat(this_ptr: &ChannelCounterparty) -> crate::c_types::derived::COption_u64Z {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().outbound_htlc_minimum_msat;
+ let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_u64Z::None } else { crate::c_types::derived::COption_u64Z::Some( { inner_val.unwrap() }) };
+ local_inner_val
+}
+/// The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
+/// is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
+/// from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_set_outbound_htlc_minimum_msat(this_ptr: &mut ChannelCounterparty, mut val: crate::c_types::derived::COption_u64Z) {
+ let mut local_val = if val.is_some() { Some( { val.take() }) } else { None };
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.outbound_htlc_minimum_msat = local_val;
+}
+/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_get_outbound_htlc_maximum_msat(this_ptr: &ChannelCounterparty) -> crate::c_types::derived::COption_u64Z {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().outbound_htlc_maximum_msat;
+ let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_u64Z::None } else { crate::c_types::derived::COption_u64Z::Some( { inner_val.unwrap() }) };
+ local_inner_val
+}
+/// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_set_outbound_htlc_maximum_msat(this_ptr: &mut ChannelCounterparty, mut val: crate::c_types::derived::COption_u64Z) {
+ let mut local_val = if val.is_some() { Some( { val.take() }) } else { None };
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.outbound_htlc_maximum_msat = local_val;
+}
+/// Constructs a new ChannelCounterparty given each field
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelCounterparty_new(mut node_id_arg: crate::c_types::PublicKey, mut features_arg: crate::lightning::ln::features::InitFeatures, mut unspendable_punishment_reserve_arg: u64, mut forwarding_info_arg: crate::lightning::ln::channelmanager::CounterpartyForwardingInfo, mut outbound_htlc_minimum_msat_arg: crate::c_types::derived::COption_u64Z, mut outbound_htlc_maximum_msat_arg: crate::c_types::derived::COption_u64Z) -> ChannelCounterparty {
+ let mut local_forwarding_info_arg = if forwarding_info_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(forwarding_info_arg.take_inner()) } }) };
+ let mut local_outbound_htlc_minimum_msat_arg = if outbound_htlc_minimum_msat_arg.is_some() { Some( { outbound_htlc_minimum_msat_arg.take() }) } else { None };
+ let mut local_outbound_htlc_maximum_msat_arg = if outbound_htlc_maximum_msat_arg.is_some() { Some( { outbound_htlc_maximum_msat_arg.take() }) } else { None };
+ ChannelCounterparty { inner: ObjOps::heap_alloc(nativeChannelCounterparty {
+ node_id: node_id_arg.into_rust(),
+ features: *unsafe { Box::from_raw(features_arg.take_inner()) },
+ unspendable_punishment_reserve: unspendable_punishment_reserve_arg,
+ forwarding_info: local_forwarding_info_arg,
+ outbound_htlc_minimum_msat: local_outbound_htlc_minimum_msat_arg,
+ outbound_htlc_maximum_msat: local_outbound_htlc_maximum_msat_arg,
+ }), is_owned: true }
+}
+impl Clone for ChannelCounterparty {
+ fn clone(&self) -> Self {
+ Self {
+ inner: if <*mut nativeChannelCounterparty>::is_null(self.inner) { core::ptr::null_mut() } else {
+ ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelCounterparty_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelCounterparty)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the ChannelCounterparty
+pub extern "C" fn ChannelCounterparty_clone(orig: &ChannelCounterparty) -> ChannelCounterparty {
+ orig.clone()
+}