]> git.bitcoin.ninja Git - ldk-c-bindings/blobdiff - lightning-c-bindings/src/lightning_invoice/mod.rs
Add missing `rustc` `metadata` override for `lightning_types`
[ldk-c-bindings] / lightning-c-bindings / src / lightning_invoice / mod.rs
index 34025a2f35ac225882e6c41566beb07faa2756aa..25f6a63c0a46bef4629917e1df58f5e411cd9822 100644 (file)
@@ -26,8 +26,6 @@ use crate::c_types::*;
 #[cfg(feature="no-std")]
 use alloc::{vec::Vec, boxed::Box};
 
 #[cfg(feature="no-std")]
 use alloc::{vec::Vec, boxed::Box};
 
-pub mod payment;
-pub mod utils;
 pub mod constants;
 mod de {
 
 pub mod constants;
 mod de {
 
@@ -166,18 +164,6 @@ use crate::c_types::*;
 #[cfg(feature="no-std")]
 use alloc::{vec::Vec, boxed::Box};
 
 #[cfg(feature="no-std")]
 use alloc::{vec::Vec, boxed::Box};
 
-}
-mod sync {
-
-use alloc::str::FromStr;
-use alloc::string::String;
-use core::ffi::c_void;
-use core::convert::Infallible;
-use bitcoin::hashes::Hash;
-use crate::c_types::*;
-#[cfg(feature="no-std")]
-use alloc::{vec::Vec, boxed::Box};
-
 }
 /// Errors that indicate what is wrong with the invoice. They have some granularity for debug
 /// reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
 }
 /// Errors that indicate what is wrong with the invoice. They have some granularity for debug
 /// reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
@@ -307,7 +293,8 @@ impl Bolt11ParseError {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeBolt11ParseError) -> Self {
+       pub(crate) fn from_native(native: &Bolt11ParseErrorImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeBolt11ParseError) };
                match native {
                        nativeBolt11ParseError::Bech32Error (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                match native {
                        nativeBolt11ParseError::Bech32Error (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
@@ -406,6 +393,16 @@ pub extern "C" fn Bolt11ParseError_free(this_ptr: Bolt11ParseError) { }
 pub extern "C" fn Bolt11ParseError_clone(orig: &Bolt11ParseError) -> Bolt11ParseError {
        orig.clone()
 }
 pub extern "C" fn Bolt11ParseError_clone(orig: &Bolt11ParseError) -> Bolt11ParseError {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Bolt11ParseError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Bolt11ParseError)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Bolt11ParseError_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut Bolt11ParseError) };
+}
 #[no_mangle]
 /// Utility method to constructs a new Bech32Error-variant Bolt11ParseError
 pub extern "C" fn Bolt11ParseError_bech32_error(a: crate::c_types::Bech32Error) -> Bolt11ParseError {
 #[no_mangle]
 /// Utility method to constructs a new Bech32Error-variant Bolt11ParseError
 pub extern "C" fn Bolt11ParseError_bech32_error(a: crate::c_types::Bech32Error) -> Bolt11ParseError {
@@ -489,6 +486,9 @@ pub extern "C" fn Bolt11ParseError_skip() -> Bolt11ParseError {
 pub extern "C" fn Bolt11ParseError_eq(a: &Bolt11ParseError, b: &Bolt11ParseError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn Bolt11ParseError_eq(a: &Bolt11ParseError, b: &Bolt11ParseError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a Bolt11ParseError object
+pub extern "C" fn Bolt11ParseError_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Bolt11ParseError }).into()}
 /// Indicates that something went wrong while parsing or validating the invoice. Parsing errors
 /// should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
 /// like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
 /// Indicates that something went wrong while parsing or validating the invoice. Parsing errors
 /// should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
 /// like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
@@ -540,7 +540,8 @@ impl ParseOrSemanticError {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeParseOrSemanticError) -> Self {
+       pub(crate) fn from_native(native: &ParseOrSemanticErrorImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeParseOrSemanticError) };
                match native {
                        nativeParseOrSemanticError::ParseError (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                match native {
                        nativeParseOrSemanticError::ParseError (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
@@ -580,6 +581,16 @@ pub extern "C" fn ParseOrSemanticError_free(this_ptr: ParseOrSemanticError) { }
 pub extern "C" fn ParseOrSemanticError_clone(orig: &ParseOrSemanticError) -> ParseOrSemanticError {
        orig.clone()
 }
 pub extern "C" fn ParseOrSemanticError_clone(orig: &ParseOrSemanticError) -> ParseOrSemanticError {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ParseOrSemanticError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const ParseOrSemanticError)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ParseOrSemanticError_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut ParseOrSemanticError) };
+}
 #[no_mangle]
 /// Utility method to constructs a new ParseError-variant ParseOrSemanticError
 pub extern "C" fn ParseOrSemanticError_parse_error(a: crate::lightning_invoice::Bolt11ParseError) -> ParseOrSemanticError {
 #[no_mangle]
 /// Utility method to constructs a new ParseError-variant ParseOrSemanticError
 pub extern "C" fn ParseOrSemanticError_parse_error(a: crate::lightning_invoice::Bolt11ParseError) -> ParseOrSemanticError {
@@ -596,6 +607,9 @@ pub extern "C" fn ParseOrSemanticError_semantic_error(a: crate::lightning_invoic
 pub extern "C" fn ParseOrSemanticError_eq(a: &ParseOrSemanticError, b: &ParseOrSemanticError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn ParseOrSemanticError_eq(a: &ParseOrSemanticError, b: &ParseOrSemanticError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a ParseOrSemanticError object
+pub extern "C" fn ParseOrSemanticError_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::ParseOrSemanticError }).into()}
 /// The maximum timestamp as [`Duration::as_secs`] since the Unix epoch allowed by [`BOLT 11`].
 ///
 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
 /// The maximum timestamp as [`Duration::as_secs`] since the Unix epoch allowed by [`BOLT 11`].
 ///
 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
@@ -610,11 +624,9 @@ pub static MAX_TIMESTAMP: u64 = lightning_invoice::MAX_TIMESTAMP;
 pub static DEFAULT_EXPIRY_TIME: u64 = lightning_invoice::DEFAULT_EXPIRY_TIME;
 /// Default minimum final CLTV expiry as defined by [BOLT 11].
 ///
 pub static DEFAULT_EXPIRY_TIME: u64 = lightning_invoice::DEFAULT_EXPIRY_TIME;
 /// Default minimum final CLTV expiry as defined by [BOLT 11].
 ///
-/// Note that this is *not* the same value as rust-lightning's minimum CLTV expiry, which is
-/// provided in [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
+/// Note that this is *not* the same value as rust-lightning's minimum CLTV expiry.
 ///
 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
 ///
 /// [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md
-/// [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
 
 #[no_mangle]
 pub static DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = lightning_invoice::DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
 
 #[no_mangle]
 pub static DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA: u64 = lightning_invoice::DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
@@ -645,6 +657,12 @@ pub struct Bolt11Invoice {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for Bolt11Invoice {
+       type Target = nativeBolt11Invoice;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for Bolt11Invoice { }
+unsafe impl core::marker::Sync for Bolt11Invoice { }
 impl Drop for Bolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeBolt11Invoice>::is_null(self.inner) {
 impl Drop for Bolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeBolt11Invoice>::is_null(self.inner) {
@@ -675,6 +693,9 @@ impl Bolt11Invoice {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 /// Checks if two Bolt11Invoices contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
 }
 /// Checks if two Bolt11Invoices contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
@@ -685,6 +706,9 @@ pub extern "C" fn Bolt11Invoice_eq(a: &Bolt11Invoice, b: &Bolt11Invoice) -> bool
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Get a string which allows debug introspection of a Bolt11Invoice object
+pub extern "C" fn Bolt11Invoice_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Bolt11Invoice }).into()}
 impl Clone for Bolt11Invoice {
        fn clone(&self) -> Self {
                Self {
 impl Clone for Bolt11Invoice {
        fn clone(&self) -> Self {
                Self {
@@ -697,7 +721,7 @@ impl Clone for Bolt11Invoice {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt11Invoice)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11Invoice)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Bolt11Invoice
 }
 #[no_mangle]
 /// Creates a copy of the Bolt11Invoice
@@ -738,6 +762,12 @@ pub struct SignedRawBolt11Invoice {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for SignedRawBolt11Invoice {
+       type Target = nativeSignedRawBolt11Invoice;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for SignedRawBolt11Invoice { }
+unsafe impl core::marker::Sync for SignedRawBolt11Invoice { }
 impl Drop for SignedRawBolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeSignedRawBolt11Invoice>::is_null(self.inner) {
 impl Drop for SignedRawBolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeSignedRawBolt11Invoice>::is_null(self.inner) {
@@ -768,6 +798,9 @@ impl SignedRawBolt11Invoice {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 /// Checks if two SignedRawBolt11Invoices contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
 }
 /// Checks if two SignedRawBolt11Invoices contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
@@ -778,6 +811,9 @@ pub extern "C" fn SignedRawBolt11Invoice_eq(a: &SignedRawBolt11Invoice, b: &Sign
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Get a string which allows debug introspection of a SignedRawBolt11Invoice object
+pub extern "C" fn SignedRawBolt11Invoice_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::SignedRawBolt11Invoice }).into()}
 impl Clone for SignedRawBolt11Invoice {
        fn clone(&self) -> Self {
                Self {
 impl Clone for SignedRawBolt11Invoice {
        fn clone(&self) -> Self {
                Self {
@@ -790,7 +826,7 @@ impl Clone for SignedRawBolt11Invoice {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn SignedRawBolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn SignedRawBolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeSignedRawBolt11Invoice)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeSignedRawBolt11Invoice)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the SignedRawBolt11Invoice
 }
 #[no_mangle]
 /// Creates a copy of the SignedRawBolt11Invoice
@@ -831,6 +867,12 @@ pub struct RawBolt11Invoice {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for RawBolt11Invoice {
+       type Target = nativeRawBolt11Invoice;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for RawBolt11Invoice { }
+unsafe impl core::marker::Sync for RawBolt11Invoice { }
 impl Drop for RawBolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeRawBolt11Invoice>::is_null(self.inner) {
 impl Drop for RawBolt11Invoice {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeRawBolt11Invoice>::is_null(self.inner) {
@@ -861,6 +903,9 @@ impl RawBolt11Invoice {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 /// data part
 #[no_mangle]
 }
 /// data part
 #[no_mangle]
@@ -882,6 +927,9 @@ pub extern "C" fn RawBolt11Invoice_eq(a: &RawBolt11Invoice, b: &RawBolt11Invoice
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Get a string which allows debug introspection of a RawBolt11Invoice object
+pub extern "C" fn RawBolt11Invoice_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::RawBolt11Invoice }).into()}
 impl Clone for RawBolt11Invoice {
        fn clone(&self) -> Self {
                Self {
 impl Clone for RawBolt11Invoice {
        fn clone(&self) -> Self {
                Self {
@@ -894,7 +942,7 @@ impl Clone for RawBolt11Invoice {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn RawBolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn RawBolt11Invoice_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRawBolt11Invoice)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeRawBolt11Invoice)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the RawBolt11Invoice
 }
 #[no_mangle]
 /// Creates a copy of the RawBolt11Invoice
@@ -931,6 +979,12 @@ pub struct RawDataPart {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for RawDataPart {
+       type Target = nativeRawDataPart;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for RawDataPart { }
+unsafe impl core::marker::Sync for RawDataPart { }
 impl Drop for RawDataPart {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeRawDataPart>::is_null(self.inner) {
 impl Drop for RawDataPart {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeRawDataPart>::is_null(self.inner) {
@@ -961,6 +1015,9 @@ impl RawDataPart {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 /// generation time of the invoice
 #[no_mangle]
 }
 /// generation time of the invoice
 #[no_mangle]
@@ -982,6 +1039,9 @@ pub extern "C" fn RawDataPart_eq(a: &RawDataPart, b: &RawDataPart) -> bool {
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Get a string which allows debug introspection of a RawDataPart object
+pub extern "C" fn RawDataPart_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::RawDataPart }).into()}
 impl Clone for RawDataPart {
        fn clone(&self) -> Self {
                Self {
 impl Clone for RawDataPart {
        fn clone(&self) -> Self {
                Self {
@@ -994,7 +1054,7 @@ impl Clone for RawDataPart {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn RawDataPart_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn RawDataPart_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRawDataPart)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeRawDataPart)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the RawDataPart
 }
 #[no_mangle]
 /// Creates a copy of the RawDataPart
@@ -1036,6 +1096,12 @@ pub struct PositiveTimestamp {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for PositiveTimestamp {
+       type Target = nativePositiveTimestamp;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for PositiveTimestamp { }
+unsafe impl core::marker::Sync for PositiveTimestamp { }
 impl Drop for PositiveTimestamp {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePositiveTimestamp>::is_null(self.inner) {
 impl Drop for PositiveTimestamp {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePositiveTimestamp>::is_null(self.inner) {
@@ -1066,6 +1132,9 @@ impl PositiveTimestamp {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 /// Checks if two PositiveTimestamps contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
 }
 /// Checks if two PositiveTimestamps contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
@@ -1076,6 +1145,9 @@ pub extern "C" fn PositiveTimestamp_eq(a: &PositiveTimestamp, b: &PositiveTimest
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if a.get_native_ref() == b.get_native_ref() { true } else { false }
 }
+/// Get a string which allows debug introspection of a PositiveTimestamp object
+pub extern "C" fn PositiveTimestamp_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::PositiveTimestamp }).into()}
 impl Clone for PositiveTimestamp {
        fn clone(&self) -> Self {
                Self {
 impl Clone for PositiveTimestamp {
        fn clone(&self) -> Self {
                Self {
@@ -1088,7 +1160,7 @@ impl Clone for PositiveTimestamp {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PositiveTimestamp_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PositiveTimestamp_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePositiveTimestamp)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativePositiveTimestamp)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the PositiveTimestamp
 }
 #[no_mangle]
 /// Creates a copy of the PositiveTimestamp
@@ -1142,7 +1214,8 @@ impl SiPrefix {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeSiPrefix) -> Self {
+       pub(crate) fn from_native(native: &SiPrefixImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeSiPrefix) };
                match native {
                        nativeSiPrefix::Milli => SiPrefix::Milli,
                        nativeSiPrefix::Micro => SiPrefix::Micro,
                match native {
                        nativeSiPrefix::Milli => SiPrefix::Milli,
                        nativeSiPrefix::Micro => SiPrefix::Micro,
@@ -1165,6 +1238,16 @@ impl SiPrefix {
 pub extern "C" fn SiPrefix_clone(orig: &SiPrefix) -> SiPrefix {
        orig.clone()
 }
 pub extern "C" fn SiPrefix_clone(orig: &SiPrefix) -> SiPrefix {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn SiPrefix_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const SiPrefix)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn SiPrefix_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut SiPrefix) };
+}
 #[no_mangle]
 /// Utility method to constructs a new Milli-variant SiPrefix
 pub extern "C" fn SiPrefix_milli() -> SiPrefix {
 #[no_mangle]
 /// Utility method to constructs a new Milli-variant SiPrefix
 pub extern "C" fn SiPrefix_milli() -> SiPrefix {
@@ -1187,6 +1270,9 @@ pub extern "C" fn SiPrefix_pico() -> SiPrefix {
 pub extern "C" fn SiPrefix_eq(a: &SiPrefix, b: &SiPrefix) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn SiPrefix_eq(a: &SiPrefix, b: &SiPrefix) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a SiPrefix object
+pub extern "C" fn SiPrefix_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::SiPrefix }).into()}
 /// Generates a non-cryptographic 64-bit hash of the SiPrefix.
 #[no_mangle]
 pub extern "C" fn SiPrefix_hash(o: &SiPrefix) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the SiPrefix.
 #[no_mangle]
 pub extern "C" fn SiPrefix_hash(o: &SiPrefix) -> u64 {
@@ -1246,7 +1332,8 @@ impl Currency {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeCurrency) -> Self {
+       pub(crate) fn from_native(native: &CurrencyImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeCurrency) };
                match native {
                        nativeCurrency::Bitcoin => Currency::Bitcoin,
                        nativeCurrency::BitcoinTestnet => Currency::BitcoinTestnet,
                match native {
                        nativeCurrency::Bitcoin => Currency::Bitcoin,
                        nativeCurrency::BitcoinTestnet => Currency::BitcoinTestnet,
@@ -1271,6 +1358,16 @@ impl Currency {
 pub extern "C" fn Currency_clone(orig: &Currency) -> Currency {
        orig.clone()
 }
 pub extern "C" fn Currency_clone(orig: &Currency) -> Currency {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Currency_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Currency)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Currency_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut Currency) };
+}
 #[no_mangle]
 /// Utility method to constructs a new Bitcoin-variant Currency
 pub extern "C" fn Currency_bitcoin() -> Currency {
 #[no_mangle]
 /// Utility method to constructs a new Bitcoin-variant Currency
 pub extern "C" fn Currency_bitcoin() -> Currency {
@@ -1291,6 +1388,9 @@ pub extern "C" fn Currency_simnet() -> Currency {
 /// Utility method to constructs a new Signet-variant Currency
 pub extern "C" fn Currency_signet() -> Currency {
        Currency::Signet}
 /// Utility method to constructs a new Signet-variant Currency
 pub extern "C" fn Currency_signet() -> Currency {
        Currency::Signet}
+/// Get a string which allows debug introspection of a Currency object
+pub extern "C" fn Currency_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Currency }).into()}
 /// Generates a non-cryptographic 64-bit hash of the Currency.
 #[no_mangle]
 pub extern "C" fn Currency_hash(o: &Currency) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the Currency.
 #[no_mangle]
 pub extern "C" fn Currency_hash(o: &Currency) -> u64 {
@@ -1326,6 +1426,12 @@ pub struct Sha256 {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for Sha256 {
+       type Target = nativeSha256;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for Sha256 { }
+unsafe impl core::marker::Sync for Sha256 { }
 impl Drop for Sha256 {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeSha256>::is_null(self.inner) {
 impl Drop for Sha256 {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeSha256>::is_null(self.inner) {
@@ -1356,6 +1462,9 @@ impl Sha256 {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 impl Clone for Sha256 {
        fn clone(&self) -> Self {
 }
 impl Clone for Sha256 {
        fn clone(&self) -> Self {
@@ -1369,13 +1478,16 @@ impl Clone for Sha256 {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Sha256_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Sha256_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeSha256)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeSha256)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Sha256
 pub extern "C" fn Sha256_clone(orig: &Sha256) -> Sha256 {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the Sha256
 pub extern "C" fn Sha256_clone(orig: &Sha256) -> Sha256 {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a Sha256 object
+pub extern "C" fn Sha256_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Sha256 }).into()}
 /// Generates a non-cryptographic 64-bit hash of the Sha256.
 #[no_mangle]
 pub extern "C" fn Sha256_hash(o: &Sha256) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the Sha256.
 #[no_mangle]
 pub extern "C" fn Sha256_hash(o: &Sha256) -> u64 {
@@ -1427,6 +1539,12 @@ pub struct Description {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for Description {
+       type Target = nativeDescription;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for Description { }
+unsafe impl core::marker::Sync for Description { }
 impl Drop for Description {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeDescription>::is_null(self.inner) {
 impl Drop for Description {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeDescription>::is_null(self.inner) {
@@ -1457,6 +1575,9 @@ impl Description {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 impl Clone for Description {
        fn clone(&self) -> Self {
 }
 impl Clone for Description {
        fn clone(&self) -> Self {
@@ -1470,13 +1591,16 @@ impl Clone for Description {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Description_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Description_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDescription)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeDescription)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Description
 pub extern "C" fn Description_clone(orig: &Description) -> Description {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the Description
 pub extern "C" fn Description_clone(orig: &Description) -> Description {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a Description object
+pub extern "C" fn Description_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Description }).into()}
 /// Generates a non-cryptographic 64-bit hash of the Description.
 #[no_mangle]
 pub extern "C" fn Description_hash(o: &Description) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the Description.
 #[no_mangle]
 pub extern "C" fn Description_hash(o: &Description) -> u64 {
@@ -1516,6 +1640,12 @@ pub struct PayeePubKey {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for PayeePubKey {
+       type Target = nativePayeePubKey;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for PayeePubKey { }
+unsafe impl core::marker::Sync for PayeePubKey { }
 impl Drop for PayeePubKey {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePayeePubKey>::is_null(self.inner) {
 impl Drop for PayeePubKey {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePayeePubKey>::is_null(self.inner) {
@@ -1546,6 +1676,9 @@ impl PayeePubKey {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 #[no_mangle]
 pub extern "C" fn PayeePubKey_get_a(this_ptr: &PayeePubKey) -> crate::c_types::PublicKey {
 }
 #[no_mangle]
 pub extern "C" fn PayeePubKey_get_a(this_ptr: &PayeePubKey) -> crate::c_types::PublicKey {
@@ -1576,13 +1709,16 @@ impl Clone for PayeePubKey {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PayeePubKey_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PayeePubKey_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePayeePubKey)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativePayeePubKey)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the PayeePubKey
 pub extern "C" fn PayeePubKey_clone(orig: &PayeePubKey) -> PayeePubKey {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the PayeePubKey
 pub extern "C" fn PayeePubKey_clone(orig: &PayeePubKey) -> PayeePubKey {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a PayeePubKey object
+pub extern "C" fn PayeePubKey_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::PayeePubKey }).into()}
 /// Generates a non-cryptographic 64-bit hash of the PayeePubKey.
 #[no_mangle]
 pub extern "C" fn PayeePubKey_hash(o: &PayeePubKey) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the PayeePubKey.
 #[no_mangle]
 pub extern "C" fn PayeePubKey_hash(o: &PayeePubKey) -> u64 {
@@ -1623,6 +1759,12 @@ pub struct ExpiryTime {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for ExpiryTime {
+       type Target = nativeExpiryTime;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for ExpiryTime { }
+unsafe impl core::marker::Sync for ExpiryTime { }
 impl Drop for ExpiryTime {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeExpiryTime>::is_null(self.inner) {
 impl Drop for ExpiryTime {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeExpiryTime>::is_null(self.inner) {
@@ -1653,6 +1795,9 @@ impl ExpiryTime {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 impl Clone for ExpiryTime {
        fn clone(&self) -> Self {
 }
 impl Clone for ExpiryTime {
        fn clone(&self) -> Self {
@@ -1666,13 +1811,16 @@ impl Clone for ExpiryTime {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn ExpiryTime_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn ExpiryTime_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeExpiryTime)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeExpiryTime)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the ExpiryTime
 pub extern "C" fn ExpiryTime_clone(orig: &ExpiryTime) -> ExpiryTime {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the ExpiryTime
 pub extern "C" fn ExpiryTime_clone(orig: &ExpiryTime) -> ExpiryTime {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a ExpiryTime object
+pub extern "C" fn ExpiryTime_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::ExpiryTime }).into()}
 /// Generates a non-cryptographic 64-bit hash of the ExpiryTime.
 #[no_mangle]
 pub extern "C" fn ExpiryTime_hash(o: &ExpiryTime) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the ExpiryTime.
 #[no_mangle]
 pub extern "C" fn ExpiryTime_hash(o: &ExpiryTime) -> u64 {
@@ -1712,6 +1860,12 @@ pub struct MinFinalCltvExpiryDelta {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for MinFinalCltvExpiryDelta {
+       type Target = nativeMinFinalCltvExpiryDelta;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for MinFinalCltvExpiryDelta { }
+unsafe impl core::marker::Sync for MinFinalCltvExpiryDelta { }
 impl Drop for MinFinalCltvExpiryDelta {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeMinFinalCltvExpiryDelta>::is_null(self.inner) {
 impl Drop for MinFinalCltvExpiryDelta {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeMinFinalCltvExpiryDelta>::is_null(self.inner) {
@@ -1742,6 +1896,9 @@ impl MinFinalCltvExpiryDelta {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 #[no_mangle]
 pub extern "C" fn MinFinalCltvExpiryDelta_get_a(this_ptr: &MinFinalCltvExpiryDelta) -> u64 {
 }
 #[no_mangle]
 pub extern "C" fn MinFinalCltvExpiryDelta_get_a(this_ptr: &MinFinalCltvExpiryDelta) -> u64 {
@@ -1772,13 +1929,16 @@ impl Clone for MinFinalCltvExpiryDelta {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn MinFinalCltvExpiryDelta_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn MinFinalCltvExpiryDelta_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeMinFinalCltvExpiryDelta)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeMinFinalCltvExpiryDelta)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the MinFinalCltvExpiryDelta
 pub extern "C" fn MinFinalCltvExpiryDelta_clone(orig: &MinFinalCltvExpiryDelta) -> MinFinalCltvExpiryDelta {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the MinFinalCltvExpiryDelta
 pub extern "C" fn MinFinalCltvExpiryDelta_clone(orig: &MinFinalCltvExpiryDelta) -> MinFinalCltvExpiryDelta {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a MinFinalCltvExpiryDelta object
+pub extern "C" fn MinFinalCltvExpiryDelta_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::MinFinalCltvExpiryDelta }).into()}
 /// Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
 #[no_mangle]
 pub extern "C" fn MinFinalCltvExpiryDelta_hash(o: &MinFinalCltvExpiryDelta) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
 #[no_mangle]
 pub extern "C" fn MinFinalCltvExpiryDelta_hash(o: &MinFinalCltvExpiryDelta) -> u64 {
@@ -1831,13 +1991,13 @@ impl Fallback {
                        Fallback::PubKeyHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                nativeFallback::PubKeyHash (
                        Fallback::PubKeyHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                nativeFallback::PubKeyHash (
-                                       bitcoin::hash_types::PubkeyHash::from_hash(bitcoin::hashes::Hash::from_inner(a_nonref.data)),
+                                       bitcoin::PubkeyHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(a_nonref.data)),
                                )
                        },
                        Fallback::ScriptHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                nativeFallback::ScriptHash (
                                )
                        },
                        Fallback::ScriptHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                nativeFallback::ScriptHash (
-                                       bitcoin::hash_types::ScriptHash::from_hash(bitcoin::hashes::Hash::from_inner(a_nonref.data)),
+                                       bitcoin::ScriptHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(a_nonref.data)),
                                )
                        },
                }
                                )
                        },
                }
@@ -1854,18 +2014,19 @@ impl Fallback {
                        },
                        Fallback::PubKeyHash (mut a, ) => {
                                nativeFallback::PubKeyHash (
                        },
                        Fallback::PubKeyHash (mut a, ) => {
                                nativeFallback::PubKeyHash (
-                                       bitcoin::hash_types::PubkeyHash::from_hash(bitcoin::hashes::Hash::from_inner(a.data)),
+                                       bitcoin::PubkeyHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(a.data)),
                                )
                        },
                        Fallback::ScriptHash (mut a, ) => {
                                nativeFallback::ScriptHash (
                                )
                        },
                        Fallback::ScriptHash (mut a, ) => {
                                nativeFallback::ScriptHash (
-                                       bitcoin::hash_types::ScriptHash::from_hash(bitcoin::hashes::Hash::from_inner(a.data)),
+                                       bitcoin::ScriptHash::from_raw_hash(bitcoin::hashes::Hash::from_byte_array(a.data)),
                                )
                        },
                }
        }
        #[allow(unused)]
                                )
                        },
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeFallback) -> Self {
+       pub(crate) fn from_native(native: &FallbackImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeFallback) };
                match native {
                        nativeFallback::SegWitProgram {ref version, ref program, } => {
                                let mut version_nonref = Clone::clone(version);
                match native {
                        nativeFallback::SegWitProgram {ref version, ref program, } => {
                                let mut version_nonref = Clone::clone(version);
@@ -1879,13 +2040,13 @@ impl Fallback {
                        nativeFallback::PubKeyHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                Fallback::PubKeyHash (
                        nativeFallback::PubKeyHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                Fallback::PubKeyHash (
-                                       crate::c_types::TwentyBytes { data: a_nonref.as_hash().into_inner() },
+                                       crate::c_types::TwentyBytes { data: *a_nonref.as_ref() },
                                )
                        },
                        nativeFallback::ScriptHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                Fallback::ScriptHash (
                                )
                        },
                        nativeFallback::ScriptHash (ref a, ) => {
                                let mut a_nonref = Clone::clone(a);
                                Fallback::ScriptHash (
-                                       crate::c_types::TwentyBytes { data: a_nonref.as_hash().into_inner() },
+                                       crate::c_types::TwentyBytes { data: *a_nonref.as_ref() },
                                )
                        },
                }
                                )
                        },
                }
@@ -1902,12 +2063,12 @@ impl Fallback {
                        },
                        nativeFallback::PubKeyHash (mut a, ) => {
                                Fallback::PubKeyHash (
                        },
                        nativeFallback::PubKeyHash (mut a, ) => {
                                Fallback::PubKeyHash (
-                                       crate::c_types::TwentyBytes { data: a.as_hash().into_inner() },
+                                       crate::c_types::TwentyBytes { data: *a.as_ref() },
                                )
                        },
                        nativeFallback::ScriptHash (mut a, ) => {
                                Fallback::ScriptHash (
                                )
                        },
                        nativeFallback::ScriptHash (mut a, ) => {
                                Fallback::ScriptHash (
-                                       crate::c_types::TwentyBytes { data: a.as_hash().into_inner() },
+                                       crate::c_types::TwentyBytes { data: *a.as_ref() },
                                )
                        },
                }
                                )
                        },
                }
@@ -1921,6 +2082,16 @@ pub extern "C" fn Fallback_free(this_ptr: Fallback) { }
 pub extern "C" fn Fallback_clone(orig: &Fallback) -> Fallback {
        orig.clone()
 }
 pub extern "C" fn Fallback_clone(orig: &Fallback) -> Fallback {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Fallback_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Fallback)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Fallback_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut Fallback) };
+}
 #[no_mangle]
 /// Utility method to constructs a new SegWitProgram-variant Fallback
 pub extern "C" fn Fallback_seg_wit_program(version: crate::c_types::WitnessVersion, program: crate::c_types::derived::CVec_u8Z) -> Fallback {
 #[no_mangle]
 /// Utility method to constructs a new SegWitProgram-variant Fallback
 pub extern "C" fn Fallback_seg_wit_program(version: crate::c_types::WitnessVersion, program: crate::c_types::derived::CVec_u8Z) -> Fallback {
@@ -1939,6 +2110,9 @@ pub extern "C" fn Fallback_pub_key_hash(a: crate::c_types::TwentyBytes) -> Fallb
 pub extern "C" fn Fallback_script_hash(a: crate::c_types::TwentyBytes) -> Fallback {
        Fallback::ScriptHash(a, )
 }
 pub extern "C" fn Fallback_script_hash(a: crate::c_types::TwentyBytes) -> Fallback {
        Fallback::ScriptHash(a, )
 }
+/// Get a string which allows debug introspection of a Fallback object
+pub extern "C" fn Fallback_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Fallback }).into()}
 /// Generates a non-cryptographic 64-bit hash of the Fallback.
 #[no_mangle]
 pub extern "C" fn Fallback_hash(o: &Fallback) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the Fallback.
 #[no_mangle]
 pub extern "C" fn Fallback_hash(o: &Fallback) -> u64 {
@@ -1974,6 +2148,12 @@ pub struct Bolt11InvoiceSignature {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for Bolt11InvoiceSignature {
+       type Target = nativeBolt11InvoiceSignature;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for Bolt11InvoiceSignature { }
+unsafe impl core::marker::Sync for Bolt11InvoiceSignature { }
 impl Drop for Bolt11InvoiceSignature {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeBolt11InvoiceSignature>::is_null(self.inner) {
 impl Drop for Bolt11InvoiceSignature {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativeBolt11InvoiceSignature>::is_null(self.inner) {
@@ -2004,6 +2184,26 @@ impl Bolt11InvoiceSignature {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
+}
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceSignature_get_a(this_ptr: &Bolt11InvoiceSignature) -> crate::c_types::RecoverableSignature {
+       let mut inner_val = &mut this_ptr.get_native_mut_ref().0;
+       crate::c_types::RecoverableSignature::from_rust(&inner_val)
+}
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceSignature_set_a(this_ptr: &mut Bolt11InvoiceSignature, mut val: crate::c_types::RecoverableSignature) {
+       unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.0 = val.into_rust();
+}
+/// Constructs a new Bolt11InvoiceSignature given each field
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Bolt11InvoiceSignature_new(mut a_arg: crate::c_types::RecoverableSignature) -> Bolt11InvoiceSignature {
+       Bolt11InvoiceSignature { inner: ObjOps::heap_alloc(lightning_invoice::Bolt11InvoiceSignature (
+               a_arg.into_rust(),
+       )), is_owned: true }
 }
 impl Clone for Bolt11InvoiceSignature {
        fn clone(&self) -> Self {
 }
 impl Clone for Bolt11InvoiceSignature {
        fn clone(&self) -> Self {
@@ -2017,13 +2217,16 @@ impl Clone for Bolt11InvoiceSignature {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt11InvoiceSignature_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn Bolt11InvoiceSignature_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeBolt11InvoiceSignature)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeBolt11InvoiceSignature)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the Bolt11InvoiceSignature
 pub extern "C" fn Bolt11InvoiceSignature_clone(orig: &Bolt11InvoiceSignature) -> Bolt11InvoiceSignature {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the Bolt11InvoiceSignature
 pub extern "C" fn Bolt11InvoiceSignature_clone(orig: &Bolt11InvoiceSignature) -> Bolt11InvoiceSignature {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a Bolt11InvoiceSignature object
+pub extern "C" fn Bolt11InvoiceSignature_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Bolt11InvoiceSignature }).into()}
 /// Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
 #[no_mangle]
 pub extern "C" fn Bolt11InvoiceSignature_hash(o: &Bolt11InvoiceSignature) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
 #[no_mangle]
 pub extern "C" fn Bolt11InvoiceSignature_hash(o: &Bolt11InvoiceSignature) -> u64 {
@@ -2067,6 +2270,12 @@ pub struct PrivateRoute {
        pub is_owned: bool,
 }
 
        pub is_owned: bool,
 }
 
+impl core::ops::Deref for PrivateRoute {
+       type Target = nativePrivateRoute;
+       fn deref(&self) -> &Self::Target { unsafe { &*ObjOps::untweak_ptr(self.inner) } }
+}
+unsafe impl core::marker::Send for PrivateRoute { }
+unsafe impl core::marker::Sync for PrivateRoute { }
 impl Drop for PrivateRoute {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePrivateRoute>::is_null(self.inner) {
 impl Drop for PrivateRoute {
        fn drop(&mut self) {
                if self.is_owned && !<*mut nativePrivateRoute>::is_null(self.inner) {
@@ -2097,6 +2306,9 @@ impl PrivateRoute {
                self.inner = core::ptr::null_mut();
                ret
        }
                self.inner = core::ptr::null_mut();
                ret
        }
+       pub(crate) fn as_ref_to(&self) -> Self {
+               Self { inner: self.inner, is_owned: false }
+       }
 }
 impl Clone for PrivateRoute {
        fn clone(&self) -> Self {
 }
 impl Clone for PrivateRoute {
        fn clone(&self) -> Self {
@@ -2110,13 +2322,16 @@ impl Clone for PrivateRoute {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PrivateRoute_clone_void(this_ptr: *const c_void) -> *mut c_void {
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
 pub(crate) extern "C" fn PrivateRoute_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePrivateRoute)).clone() })) as *mut c_void
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativePrivateRoute)).clone() })) as *mut c_void
 }
 #[no_mangle]
 /// Creates a copy of the PrivateRoute
 pub extern "C" fn PrivateRoute_clone(orig: &PrivateRoute) -> PrivateRoute {
        orig.clone()
 }
 }
 #[no_mangle]
 /// Creates a copy of the PrivateRoute
 pub extern "C" fn PrivateRoute_clone(orig: &PrivateRoute) -> PrivateRoute {
        orig.clone()
 }
+/// Get a string which allows debug introspection of a PrivateRoute object
+pub extern "C" fn PrivateRoute_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::PrivateRoute }).into()}
 /// Generates a non-cryptographic 64-bit hash of the PrivateRoute.
 #[no_mangle]
 pub extern "C" fn PrivateRoute_hash(o: &PrivateRoute) -> u64 {
 /// Generates a non-cryptographic 64-bit hash of the PrivateRoute.
 #[no_mangle]
 pub extern "C" fn PrivateRoute_hash(o: &PrivateRoute) -> u64 {
@@ -2278,9 +2493,9 @@ pub extern "C" fn RawBolt11Invoice_payment_metadata(this_arg: &crate::lightning_
 /// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
 #[must_use]
 #[no_mangle]
 /// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
 #[must_use]
 #[no_mangle]
-pub extern "C" fn RawBolt11Invoice_features(this_arg: &crate::lightning_invoice::RawBolt11Invoice) -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
+pub extern "C" fn RawBolt11Invoice_features(this_arg: &crate::lightning_invoice::RawBolt11Invoice) -> crate::lightning_types::features::Bolt11InvoiceFeatures {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.features();
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.features();
-       let mut local_ret = crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: unsafe { (if ret.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (ret.unwrap()) }) } as *const lightning::ln::features::Bolt11InvoiceFeatures<>) as *mut _ }, is_owned: false };
+       let mut local_ret = crate::lightning_types::features::Bolt11InvoiceFeatures { inner: unsafe { (if ret.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (ret.unwrap()) }) } as *const lightning_types::features::Bolt11InvoiceFeatures<>) as *mut _ }, is_owned: false };
        local_ret
 }
 
        local_ret
 }
 
@@ -2292,6 +2507,7 @@ pub extern "C" fn RawBolt11Invoice_private_routes(this_arg: &crate::lightning_in
        local_ret.into()
 }
 
        local_ret.into()
 }
 
+/// Returns `None` if no amount is set or on overflow.
 #[must_use]
 #[no_mangle]
 pub extern "C" fn RawBolt11Invoice_amount_pico_btc(this_arg: &crate::lightning_invoice::RawBolt11Invoice) -> crate::c_types::derived::COption_u64Z {
 #[must_use]
 #[no_mangle]
 pub extern "C" fn RawBolt11Invoice_amount_pico_btc(this_arg: &crate::lightning_invoice::RawBolt11Invoice) -> crate::c_types::derived::COption_u64Z {
@@ -2444,7 +2660,7 @@ pub extern "C" fn Bolt11Invoice_duration_since_epoch(this_arg: &crate::lightning
 #[no_mangle]
 pub extern "C" fn Bolt11Invoice_payment_hash(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> *const [u8; 32] {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.payment_hash();
 #[no_mangle]
 pub extern "C" fn Bolt11Invoice_payment_hash(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> *const [u8; 32] {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.payment_hash();
-       ret.as_inner()
+       ret.as_ref()
 }
 
 /// Get the payee's public key if one was included in the invoice
 }
 
 /// Get the payee's public key if one was included in the invoice
@@ -2480,9 +2696,9 @@ pub extern "C" fn Bolt11Invoice_payment_metadata(this_arg: &crate::lightning_inv
 /// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
 #[must_use]
 #[no_mangle]
 /// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
 #[must_use]
 #[no_mangle]
-pub extern "C" fn Bolt11Invoice_features(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::lightning::ln::features::Bolt11InvoiceFeatures {
+pub extern "C" fn Bolt11Invoice_features(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::lightning_types::features::Bolt11InvoiceFeatures {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.features();
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.features();
-       let mut local_ret = crate::lightning::ln::features::Bolt11InvoiceFeatures { inner: unsafe { (if ret.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (ret.unwrap()) }) } as *const lightning::ln::features::Bolt11InvoiceFeatures<>) as *mut _ }, is_owned: false };
+       let mut local_ret = crate::lightning_types::features::Bolt11InvoiceFeatures { inner: unsafe { (if ret.is_none() { core::ptr::null() } else { ObjOps::nonnull_ptr_to_inner( { (ret.unwrap()) }) } as *const lightning_types::features::Bolt11InvoiceFeatures<>) as *mut _ }, is_owned: false };
        local_ret
 }
 
        local_ret
 }
 
@@ -2494,6 +2710,15 @@ pub extern "C" fn Bolt11Invoice_recover_payee_pub_key(this_arg: &crate::lightnin
        crate::c_types::PublicKey::from_rust(&ret)
 }
 
        crate::c_types::PublicKey::from_rust(&ret)
 }
 
+/// Recover the payee's public key if one was included in the invoice, otherwise return the
+/// recovered public key from the signature
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Bolt11Invoice_get_payee_pub_key(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::c_types::PublicKey {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.get_payee_pub_key();
+       crate::c_types::PublicKey::from_rust(&ret)
+}
+
 /// Returns the Duration since the Unix epoch at which the invoice expires.
 /// Returning None if overflow occurred.
 #[must_use]
 /// Returns the Duration since the Unix epoch at which the invoice expires.
 /// Returning None if overflow occurred.
 #[must_use]
@@ -2578,7 +2803,7 @@ pub extern "C" fn Bolt11Invoice_private_routes(this_arg: &crate::lightning_invoi
 #[no_mangle]
 pub extern "C" fn Bolt11Invoice_route_hints(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::c_types::derived::CVec_RouteHintZ {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.route_hints();
 #[no_mangle]
 pub extern "C" fn Bolt11Invoice_route_hints(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::c_types::derived::CVec_RouteHintZ {
        let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.route_hints();
-       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning::routing::router::RouteHint { inner: ObjOps::heap_alloc(item), is_owned: true } }); };
+       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning_types::routing::RouteHint { inner: ObjOps::heap_alloc(item), is_owned: true } }); };
        local_ret.into()
 }
 
        local_ret.into()
 }
 
@@ -2599,8 +2824,8 @@ pub extern "C" fn Bolt11Invoice_amount_milli_satoshis(this_arg: &crate::lightnin
        local_ret
 }
 
        local_ret
 }
 
-/// Creates a new `Description` if `description` is at most 1023 __bytes__ long,
-/// returns [`CreationError::DescriptionTooLong`] otherwise
+/// Creates a new `Description` if `description` is at most 1023 * 5 bits (i.e., 639 bytes)
+/// long, and returns [`CreationError::DescriptionTooLong`] otherwise.
 ///
 /// Please note that single characters may use more than one byte due to UTF8 encoding.
 #[must_use]
 ///
 /// Please note that single characters may use more than one byte due to UTF8 encoding.
 #[must_use]
@@ -2611,14 +2836,27 @@ pub extern "C" fn Description_new(mut description: crate::c_types::Str) -> crate
        local_ret
 }
 
        local_ret
 }
 
-/// Returns the underlying description [`String`]
+/// Returns the underlying description [`UntrustedString`]
 #[must_use]
 #[no_mangle]
 #[must_use]
 #[no_mangle]
-pub extern "C" fn Description_into_inner(mut this_arg: crate::lightning_invoice::Description) -> crate::c_types::Str {
+pub extern "C" fn Description_into_inner(mut this_arg: crate::lightning_invoice::Description) -> crate::lightning_types::string::UntrustedString {
        let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).into_inner();
        let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).into_inner();
-       ret.into()
+       crate::lightning_types::string::UntrustedString { inner: ObjOps::heap_alloc(ret), is_owned: true }
 }
 
 }
 
+/// Get a reference to the underlying description [`UntrustedString`]
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Description_as_inner(this_arg: &crate::lightning_invoice::Description) -> crate::lightning_types::string::UntrustedString {
+       let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.as_inner();
+       crate::lightning_types::string::UntrustedString { inner: unsafe { ObjOps::nonnull_ptr_to_inner((ret as *const lightning_types::string::UntrustedString<>) as *mut _) }, is_owned: false }
+}
+
+#[no_mangle]
+/// Get the string representation of a Description object
+pub extern "C" fn Description_to_str(o: &crate::lightning_invoice::Description) -> Str {
+       alloc::format!("{}", o.get_native_ref()).into()
+}
 /// Construct an `ExpiryTime` from seconds.
 #[must_use]
 #[no_mangle]
 /// Construct an `ExpiryTime` from seconds.
 #[must_use]
 #[no_mangle]
@@ -2654,7 +2892,7 @@ pub extern "C" fn ExpiryTime_as_duration(this_arg: &crate::lightning_invoice::Ex
 /// Creates a new (partial) route from a list of hops
 #[must_use]
 #[no_mangle]
 /// Creates a new (partial) route from a list of hops
 #[must_use]
 #[no_mangle]
-pub extern "C" fn PrivateRoute_new(mut hops: crate::lightning::routing::router::RouteHint) -> crate::c_types::derived::CResult_PrivateRouteCreationErrorZ {
+pub extern "C" fn PrivateRoute_new(mut hops: crate::lightning_types::routing::RouteHint) -> crate::c_types::derived::CResult_PrivateRouteCreationErrorZ {
        let mut ret = lightning_invoice::PrivateRoute::new(*unsafe { Box::from_raw(hops.take_inner()) });
        let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning_invoice::PrivateRoute { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_invoice::CreationError::native_into(e) }).into() };
        local_ret
        let mut ret = lightning_invoice::PrivateRoute::new(*unsafe { Box::from_raw(hops.take_inner()) });
        let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning_invoice::PrivateRoute { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_invoice::CreationError::native_into(e) }).into() };
        local_ret
@@ -2663,9 +2901,9 @@ pub extern "C" fn PrivateRoute_new(mut hops: crate::lightning::routing::router::
 /// Returns the underlying list of hops
 #[must_use]
 #[no_mangle]
 /// Returns the underlying list of hops
 #[must_use]
 #[no_mangle]
-pub extern "C" fn PrivateRoute_into_inner(mut this_arg: crate::lightning_invoice::PrivateRoute) -> crate::lightning::routing::router::RouteHint {
+pub extern "C" fn PrivateRoute_into_inner(mut this_arg: crate::lightning_invoice::PrivateRoute) -> crate::lightning_types::routing::RouteHint {
        let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).into_inner();
        let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).into_inner();
-       crate::lightning::routing::router::RouteHint { inner: ObjOps::heap_alloc(ret), is_owned: true }
+       crate::lightning_types::routing::RouteHint { inner: ObjOps::heap_alloc(ret), is_owned: true }
 }
 
 /// Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
 }
 
 /// Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
@@ -2681,14 +2919,9 @@ pub enum CreationError {
        TimestampOutOfBounds,
        /// The supplied millisatoshi amount was greater than the total bitcoin supply.
        InvalidAmount,
        TimestampOutOfBounds,
        /// The supplied millisatoshi amount was greater than the total bitcoin supply.
        InvalidAmount,
-       /// Route hints were required for this invoice and were missing. Applies to
-       /// [phantom invoices].
-       ///
-       /// [phantom invoices]: crate::utils::create_phantom_invoice
+       /// Route hints were required for this invoice and were missing.
        MissingRouteHints,
        MissingRouteHints,
-       /// The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
-       ///
-       /// [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
+       /// The provided `min_final_cltv_expiry_delta` was less than rust-lightning's minimum.
        MinFinalCltvExpiryDeltaTooShort,
 }
 use lightning_invoice::CreationError as CreationErrorImport;
        MinFinalCltvExpiryDeltaTooShort,
 }
 use lightning_invoice::CreationError as CreationErrorImport;
@@ -2718,7 +2951,8 @@ impl CreationError {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeCreationError) -> Self {
+       pub(crate) fn from_native(native: &CreationErrorImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeCreationError) };
                match native {
                        nativeCreationError::DescriptionTooLong => CreationError::DescriptionTooLong,
                        nativeCreationError::RouteTooLong => CreationError::RouteTooLong,
                match native {
                        nativeCreationError::DescriptionTooLong => CreationError::DescriptionTooLong,
                        nativeCreationError::RouteTooLong => CreationError::RouteTooLong,
@@ -2745,6 +2979,16 @@ impl CreationError {
 pub extern "C" fn CreationError_clone(orig: &CreationError) -> CreationError {
        orig.clone()
 }
 pub extern "C" fn CreationError_clone(orig: &CreationError) -> CreationError {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn CreationError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const CreationError)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn CreationError_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut CreationError) };
+}
 #[no_mangle]
 /// Utility method to constructs a new DescriptionTooLong-variant CreationError
 pub extern "C" fn CreationError_description_too_long() -> CreationError {
 #[no_mangle]
 /// Utility method to constructs a new DescriptionTooLong-variant CreationError
 pub extern "C" fn CreationError_description_too_long() -> CreationError {
@@ -2775,6 +3019,9 @@ pub extern "C" fn CreationError_min_final_cltv_expiry_delta_too_short() -> Creat
 pub extern "C" fn CreationError_eq(a: &CreationError, b: &CreationError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn CreationError_eq(a: &CreationError, b: &CreationError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a CreationError object
+pub extern "C" fn CreationError_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::CreationError }).into()}
 #[no_mangle]
 /// Get the string representation of a CreationError object
 pub extern "C" fn CreationError_to_str(o: &crate::lightning_invoice::CreationError) -> Str {
 #[no_mangle]
 /// Get the string representation of a CreationError object
 pub extern "C" fn CreationError_to_str(o: &crate::lightning_invoice::CreationError) -> Str {
@@ -2843,7 +3090,8 @@ impl Bolt11SemanticError {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeBolt11SemanticError) -> Self {
+       pub(crate) fn from_native(native: &Bolt11SemanticErrorImport) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeBolt11SemanticError) };
                match native {
                        nativeBolt11SemanticError::NoPaymentHash => Bolt11SemanticError::NoPaymentHash,
                        nativeBolt11SemanticError::MultiplePaymentHashes => Bolt11SemanticError::MultiplePaymentHashes,
                match native {
                        nativeBolt11SemanticError::NoPaymentHash => Bolt11SemanticError::NoPaymentHash,
                        nativeBolt11SemanticError::MultiplePaymentHashes => Bolt11SemanticError::MultiplePaymentHashes,
@@ -2878,6 +3126,16 @@ impl Bolt11SemanticError {
 pub extern "C" fn Bolt11SemanticError_clone(orig: &Bolt11SemanticError) -> Bolt11SemanticError {
        orig.clone()
 }
 pub extern "C" fn Bolt11SemanticError_clone(orig: &Bolt11SemanticError) -> Bolt11SemanticError {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Bolt11SemanticError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const Bolt11SemanticError)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Bolt11SemanticError_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut Bolt11SemanticError) };
+}
 #[no_mangle]
 /// Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
 pub extern "C" fn Bolt11SemanticError_no_payment_hash() -> Bolt11SemanticError {
 #[no_mangle]
 /// Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
 pub extern "C" fn Bolt11SemanticError_no_payment_hash() -> Bolt11SemanticError {
@@ -2924,6 +3182,9 @@ pub extern "C" fn Bolt11SemanticError_imprecise_amount() -> Bolt11SemanticError
 pub extern "C" fn Bolt11SemanticError_eq(a: &Bolt11SemanticError, b: &Bolt11SemanticError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn Bolt11SemanticError_eq(a: &Bolt11SemanticError, b: &Bolt11SemanticError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a Bolt11SemanticError object
+pub extern "C" fn Bolt11SemanticError_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::Bolt11SemanticError }).into()}
 #[no_mangle]
 /// Get the string representation of a Bolt11SemanticError object
 pub extern "C" fn Bolt11SemanticError_to_str(o: &crate::lightning_invoice::Bolt11SemanticError) -> Str {
 #[no_mangle]
 /// Get the string representation of a Bolt11SemanticError object
 pub extern "C" fn Bolt11SemanticError_to_str(o: &crate::lightning_invoice::Bolt11SemanticError) -> Str {
@@ -2977,7 +3238,8 @@ impl SignOrCreationError {
                }
        }
        #[allow(unused)]
                }
        }
        #[allow(unused)]
-       pub(crate) fn from_native(native: &nativeSignOrCreationError) -> Self {
+       pub(crate) fn from_native(native: &SignOrCreationErrorImport<>) -> Self {
+               let native = unsafe { &*(native as *const _ as *const c_void as *const nativeSignOrCreationError) };
                match native {
                        nativeSignOrCreationError::SignError (ref a, ) => {
                                SignOrCreationError::SignError                  },
                match native {
                        nativeSignOrCreationError::SignError (ref a, ) => {
                                SignOrCreationError::SignError                  },
@@ -3010,6 +3272,16 @@ pub extern "C" fn SignOrCreationError_free(this_ptr: SignOrCreationError) { }
 pub extern "C" fn SignOrCreationError_clone(orig: &SignOrCreationError) -> SignOrCreationError {
        orig.clone()
 }
 pub extern "C" fn SignOrCreationError_clone(orig: &SignOrCreationError) -> SignOrCreationError {
        orig.clone()
 }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn SignOrCreationError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *const SignOrCreationError)).clone() })) as *mut c_void
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn SignOrCreationError_free_void(this_ptr: *mut c_void) {
+       let _ = unsafe { Box::from_raw(this_ptr as *mut SignOrCreationError) };
+}
 #[no_mangle]
 /// Utility method to constructs a new SignError-variant SignOrCreationError
 pub extern "C" fn SignOrCreationError_sign_error() -> SignOrCreationError {
 #[no_mangle]
 /// Utility method to constructs a new SignError-variant SignOrCreationError
 pub extern "C" fn SignOrCreationError_sign_error() -> SignOrCreationError {
@@ -3026,6 +3298,9 @@ pub extern "C" fn SignOrCreationError_creation_error(a: crate::lightning_invoice
 pub extern "C" fn SignOrCreationError_eq(a: &SignOrCreationError, b: &SignOrCreationError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
 pub extern "C" fn SignOrCreationError_eq(a: &SignOrCreationError, b: &SignOrCreationError) -> bool {
        if &a.to_native() == &b.to_native() { true } else { false }
 }
+/// Get a string which allows debug introspection of a SignOrCreationError object
+pub extern "C" fn SignOrCreationError_debug_str_void(o: *const c_void) -> Str {
+       alloc::format!("{:?}", unsafe { o as *const crate::lightning_invoice::SignOrCreationError }).into()}
 #[no_mangle]
 /// Get the string representation of a SignOrCreationError object
 pub extern "C" fn SignOrCreationError_to_str(o: &crate::lightning_invoice::SignOrCreationError) -> Str {
 #[no_mangle]
 /// Get the string representation of a SignOrCreationError object
 pub extern "C" fn SignOrCreationError_to_str(o: &crate::lightning_invoice::SignOrCreationError) -> Str {