-pub extern "C" fn OpenChannelV2_set_dust_limit_satoshis(this_ptr: &mut OpenChannelV2, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.dust_limit_satoshis = val;
-}
-/// The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_max_htlc_value_in_flight_msat(this_ptr: &OpenChannelV2) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().max_htlc_value_in_flight_msat;
- *inner_val
-}
-/// The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_max_htlc_value_in_flight_msat(this_ptr: &mut OpenChannelV2, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.max_htlc_value_in_flight_msat = val;
-}
-/// The minimum HTLC size incoming to channel initiator, in milli-satoshi
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_htlc_minimum_msat(this_ptr: &OpenChannelV2) -> u64 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().htlc_minimum_msat;
- *inner_val
-}
-/// The minimum HTLC size incoming to channel initiator, in milli-satoshi
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_htlc_minimum_msat(this_ptr: &mut OpenChannelV2, mut val: u64) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.htlc_minimum_msat = val;
-}
-/// The number of blocks which the counterparty will have to wait to claim on-chain funds if they
-/// broadcast a commitment transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_to_self_delay(this_ptr: &OpenChannelV2) -> u16 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().to_self_delay;
- *inner_val
-}
-/// The number of blocks which the counterparty will have to wait to claim on-chain funds if they
-/// broadcast a commitment transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_to_self_delay(this_ptr: &mut OpenChannelV2, mut val: u16) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.to_self_delay = val;
-}
-/// The maximum number of inbound HTLCs towards channel initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_max_accepted_htlcs(this_ptr: &OpenChannelV2) -> u16 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().max_accepted_htlcs;
- *inner_val
-}
-/// The maximum number of inbound HTLCs towards channel initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_max_accepted_htlcs(this_ptr: &mut OpenChannelV2, mut val: u16) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.max_accepted_htlcs = val;
-}
-/// The locktime for the funding transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_locktime(this_ptr: &OpenChannelV2) -> u32 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().locktime;
- *inner_val
-}
-/// The locktime for the funding transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_locktime(this_ptr: &mut OpenChannelV2, mut val: u32) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.locktime = val;
-}
-/// The channel initiator's key controlling the funding transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_funding_pubkey(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().funding_pubkey;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// The channel initiator's key controlling the funding transaction
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_funding_pubkey(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.funding_pubkey = val.into_rust();
-}
-/// Used to derive a revocation key for transactions broadcast by counterparty
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_revocation_basepoint(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().revocation_basepoint;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// Used to derive a revocation key for transactions broadcast by counterparty
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_revocation_basepoint(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.revocation_basepoint = val.into_rust();
-}
-/// A payment key to channel initiator for transactions broadcast by counterparty
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_payment_basepoint(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().payment_basepoint;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// A payment key to channel initiator for transactions broadcast by counterparty
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_payment_basepoint(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.payment_basepoint = val.into_rust();
-}
-/// Used to derive a payment key to channel initiator for transactions broadcast by channel
-/// initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_delayed_payment_basepoint(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().delayed_payment_basepoint;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// Used to derive a payment key to channel initiator for transactions broadcast by channel
-/// initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_delayed_payment_basepoint(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.delayed_payment_basepoint = val.into_rust();
-}
-/// Used to derive an HTLC payment key to channel initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_htlc_basepoint(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().htlc_basepoint;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// Used to derive an HTLC payment key to channel initiator
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_htlc_basepoint(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.htlc_basepoint = val.into_rust();
-}
-/// The first to-be-broadcast-by-channel-initiator transaction's per commitment point
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_first_per_commitment_point(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().first_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// The first to-be-broadcast-by-channel-initiator transaction's per commitment point
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_first_per_commitment_point(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.first_per_commitment_point = val.into_rust();
-}
-/// The second to-be-broadcast-by-channel-initiator transaction's per commitment point
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_second_per_commitment_point(this_ptr: &OpenChannelV2) -> crate::c_types::PublicKey {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().second_per_commitment_point;
- crate::c_types::PublicKey::from_rust(&inner_val)
-}
-/// The second to-be-broadcast-by-channel-initiator transaction's per commitment point
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_second_per_commitment_point(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::PublicKey) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.second_per_commitment_point = val.into_rust();
-}
-/// Channel flags
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_channel_flags(this_ptr: &OpenChannelV2) -> u8 {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_flags;
- *inner_val
-}
-/// Channel flags
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_channel_flags(this_ptr: &mut OpenChannelV2, mut val: u8) {
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.channel_flags = val;
-}
-/// Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
-/// collaboratively close
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_shutdown_scriptpubkey(this_ptr: &OpenChannelV2) -> crate::c_types::derived::COption_CVec_u8ZZ {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().shutdown_scriptpubkey;
- let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_CVec_u8ZZ::None } else { crate::c_types::derived::COption_CVec_u8ZZ::Some(/* WARNING: CLONING CONVERSION HERE! &Option<Enum> is otherwise un-expressable. */ { (*inner_val.as_ref().unwrap()).clone().to_bytes().into() }) };
- local_inner_val
-}
-/// Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
-/// collaboratively close
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_shutdown_scriptpubkey(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::derived::COption_CVec_u8ZZ) {
- let mut local_val = { /*val*/ let val_opt = val; if val_opt.is_none() { None } else { Some({ { ::bitcoin::blockdata::script::ScriptBuf::from({ val_opt.take() }.into_rust()) }})} };
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.shutdown_scriptpubkey = local_val;
-}
-/// The channel type that this channel will represent. If none is set, we derive the channel
-/// type from the intersection of our feature bits with our counterparty's feature bits from
-/// the Init message.
-///
-/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_channel_type(this_ptr: &OpenChannelV2) -> crate::lightning::ln::features::ChannelTypeFeatures {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().channel_type;
- let mut local_inner_val = crate::lightning::ln::features::ChannelTypeFeatures { 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::features::ChannelTypeFeatures<>) as *mut _ }, is_owned: false };
- local_inner_val
-}
-/// The channel type that this channel will represent. If none is set, we derive the channel
-/// type from the intersection of our feature bits with our counterparty's feature bits from
-/// the Init message.
-///
-/// Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_channel_type(this_ptr: &mut OpenChannelV2, mut val: crate::lightning::ln::features::ChannelTypeFeatures) {
- 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) }.channel_type = local_val;
-}
-/// Optionally, a requirement that only confirmed inputs can be added
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_get_require_confirmed_inputs(this_ptr: &OpenChannelV2) -> crate::c_types::derived::COption_NoneZ {
- let mut inner_val = &mut this_ptr.get_native_mut_ref().require_confirmed_inputs;
- let mut local_inner_val = if inner_val.is_none() { crate::c_types::derived::COption_NoneZ::None } else { crate::c_types::derived::COption_NoneZ::Some /* { () /**/ } */ };
- local_inner_val
-}
-/// Optionally, a requirement that only confirmed inputs can be added
-#[no_mangle]
-pub extern "C" fn OpenChannelV2_set_require_confirmed_inputs(this_ptr: &mut OpenChannelV2, mut val: crate::c_types::derived::COption_NoneZ) {
- let mut local_val = if val.is_some() { Some( { () /*val.take()*/ }) } else { None };
- unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.require_confirmed_inputs = local_val;