Update auto-generated bindings
[rust-lightning] / lightning-c-bindings / src / ln / msgs.rs
index 6726b9521a6baf2e865a0302a2a628db7bae3f22..dd60efa03c1a480d8cb41d00d6a7d28fb2529462 100644 (file)
@@ -27,7 +27,7 @@ type nativeDecodeError = nativeDecodeErrorImport;
 #[must_use]
 #[repr(C)]
 pub struct DecodeError {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeDecodeError,
        pub is_owned: bool,
@@ -50,13 +50,31 @@ extern "C" fn DecodeError_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl DecodeError {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeDecodeError {
+       pub(crate) fn take_inner(mut self) -> *mut nativeDecodeError {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
+impl Clone for DecodeError {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 DecodeError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDecodeError)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn DecodeError_clone(orig: &DecodeError) -> DecodeError {
+       orig.clone()
+}
 
 use lightning::ln::msgs::Init as nativeInitImport;
 type nativeInit = nativeInitImport;
@@ -65,7 +83,7 @@ type nativeInit = nativeInitImport;
 #[must_use]
 #[repr(C)]
 pub struct Init {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeInit,
        pub is_owned: bool,
@@ -88,13 +106,49 @@ extern "C" fn Init_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl Init {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeInit {
+       pub(crate) fn take_inner(mut self) -> *mut nativeInit {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
+/// The relevant features which the sender supports
+#[no_mangle]
+pub extern "C" fn Init_get_features(this_ptr: &Init) -> crate::ln::features::InitFeatures {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
+       crate::ln::features::InitFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+}
+/// The relevant features which the sender supports
+#[no_mangle]
+pub extern "C" fn Init_set_features(this_ptr: &mut Init, mut val: crate::ln::features::InitFeatures) {
+       unsafe { &mut *this_ptr.inner }.features = *unsafe { Box::from_raw(val.take_inner()) };
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Init_new(mut features_arg: crate::ln::features::InitFeatures) -> Init {
+       Init { inner: Box::into_raw(Box::new(nativeInit {
+               features: *unsafe { Box::from_raw(features_arg.take_inner()) },
+       })), is_owned: true }
+}
+impl Clone for Init {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 Init_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInit)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Init_clone(orig: &Init) -> Init {
+       orig.clone()
+}
 
 use lightning::ln::msgs::ErrorMessage as nativeErrorMessageImport;
 type nativeErrorMessage = nativeErrorMessageImport;
@@ -103,7 +157,7 @@ type nativeErrorMessage = nativeErrorMessageImport;
 #[must_use]
 #[repr(C)]
 pub struct ErrorMessage {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeErrorMessage,
        pub is_owned: bool,
@@ -126,26 +180,13 @@ extern "C" fn ErrorMessage_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl ErrorMessage {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeErrorMessage {
+       pub(crate) fn take_inner(mut self) -> *mut nativeErrorMessage {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for ErrorMessage {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 ErrorMessage_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void
-}
 /// The channel ID involved in the error
 #[no_mangle]
 pub extern "C" fn ErrorMessage_get_channel_id(this_ptr: &ErrorMessage) -> *const [u8; 32] {
@@ -182,6 +223,24 @@ pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwo
                data: String::from_utf8(data_arg.into_rust()).unwrap(),
        })), is_owned: true }
 }
+impl Clone for ErrorMessage {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ErrorMessage_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage {
+       orig.clone()
+}
 
 use lightning::ln::msgs::Ping as nativePingImport;
 type nativePing = nativePingImport;
@@ -190,7 +249,7 @@ type nativePing = nativePingImport;
 #[must_use]
 #[repr(C)]
 pub struct Ping {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativePing,
        pub is_owned: bool,
@@ -213,7 +272,7 @@ extern "C" fn Ping_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl Ping {
-       pub(crate) fn take_ptr(mut self) -> *mut nativePing {
+       pub(crate) fn take_inner(mut self) -> *mut nativePing {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
@@ -252,6 +311,24 @@ pub extern "C" fn Ping_new(mut ponglen_arg: u16, mut byteslen_arg: u16) -> Ping
                byteslen: byteslen_arg,
        })), is_owned: true }
 }
+impl Clone for Ping {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 Ping_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePing)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Ping_clone(orig: &Ping) -> Ping {
+       orig.clone()
+}
 
 use lightning::ln::msgs::Pong as nativePongImport;
 type nativePong = nativePongImport;
@@ -260,7 +337,7 @@ type nativePong = nativePongImport;
 #[must_use]
 #[repr(C)]
 pub struct Pong {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativePong,
        pub is_owned: bool,
@@ -283,7 +360,7 @@ extern "C" fn Pong_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl Pong {
-       pub(crate) fn take_ptr(mut self) -> *mut nativePong {
+       pub(crate) fn take_inner(mut self) -> *mut nativePong {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
@@ -310,6 +387,24 @@ pub extern "C" fn Pong_new(mut byteslen_arg: u16) -> Pong {
                byteslen: byteslen_arg,
        })), is_owned: true }
 }
+impl Clone for Pong {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 Pong_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePong)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Pong_clone(orig: &Pong) -> Pong {
+       orig.clone()
+}
 
 use lightning::ln::msgs::OpenChannel as nativeOpenChannelImport;
 type nativeOpenChannel = nativeOpenChannelImport;
@@ -318,7 +413,7 @@ type nativeOpenChannel = nativeOpenChannelImport;
 #[must_use]
 #[repr(C)]
 pub struct OpenChannel {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeOpenChannel,
        pub is_owned: bool,
@@ -341,26 +436,13 @@ extern "C" fn OpenChannel_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl OpenChannel {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeOpenChannel {
+       pub(crate) fn take_inner(mut self) -> *mut nativeOpenChannel {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for OpenChannel {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 OpenChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void
-}
 /// The genesis hash of the blockchain where the channel is to be opened
 #[no_mangle]
 pub extern "C" fn OpenChannel_get_chain_hash(this_ptr: &OpenChannel) -> *const [u8; 32] {
@@ -559,6 +641,24 @@ pub extern "C" fn OpenChannel_get_channel_flags(this_ptr: &OpenChannel) -> u8 {
 pub extern "C" fn OpenChannel_set_channel_flags(this_ptr: &mut OpenChannel, mut val: u8) {
        unsafe { &mut *this_ptr.inner }.channel_flags = val;
 }
+impl Clone for OpenChannel {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 OpenChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn OpenChannel_clone(orig: &OpenChannel) -> OpenChannel {
+       orig.clone()
+}
 
 use lightning::ln::msgs::AcceptChannel as nativeAcceptChannelImport;
 type nativeAcceptChannel = nativeAcceptChannelImport;
@@ -567,7 +667,7 @@ type nativeAcceptChannel = nativeAcceptChannelImport;
 #[must_use]
 #[repr(C)]
 pub struct AcceptChannel {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeAcceptChannel,
        pub is_owned: bool,
@@ -590,26 +690,13 @@ extern "C" fn AcceptChannel_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl AcceptChannel {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeAcceptChannel {
+       pub(crate) fn take_inner(mut self) -> *mut nativeAcceptChannel {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for AcceptChannel {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 AcceptChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void
-}
 /// A temporary channel ID, until the funding outpoint is announced
 #[no_mangle]
 pub extern "C" fn AcceptChannel_get_temporary_channel_id(this_ptr: &AcceptChannel) -> *const [u8; 32] {
@@ -764,6 +851,24 @@ pub extern "C" fn AcceptChannel_get_first_per_commitment_point(this_ptr: &Accept
 pub extern "C" fn AcceptChannel_set_first_per_commitment_point(this_ptr: &mut AcceptChannel, mut val: crate::c_types::PublicKey) {
        unsafe { &mut *this_ptr.inner }.first_per_commitment_point = val.into_rust();
 }
+impl Clone for AcceptChannel {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 AcceptChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn AcceptChannel_clone(orig: &AcceptChannel) -> AcceptChannel {
+       orig.clone()
+}
 
 use lightning::ln::msgs::FundingCreated as nativeFundingCreatedImport;
 type nativeFundingCreated = nativeFundingCreatedImport;
@@ -772,7 +877,7 @@ type nativeFundingCreated = nativeFundingCreatedImport;
 #[must_use]
 #[repr(C)]
 pub struct FundingCreated {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeFundingCreated,
        pub is_owned: bool,
@@ -795,26 +900,13 @@ extern "C" fn FundingCreated_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl FundingCreated {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeFundingCreated {
+       pub(crate) fn take_inner(mut self) -> *mut nativeFundingCreated {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for FundingCreated {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 FundingCreated_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void
-}
 /// A temporary channel ID, until the funding is established
 #[no_mangle]
 pub extern "C" fn FundingCreated_get_temporary_channel_id(this_ptr: &FundingCreated) -> *const [u8; 32] {
@@ -869,6 +961,24 @@ pub extern "C" fn FundingCreated_new(mut temporary_channel_id_arg: crate::c_type
                signature: signature_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for FundingCreated {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 FundingCreated_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn FundingCreated_clone(orig: &FundingCreated) -> FundingCreated {
+       orig.clone()
+}
 
 use lightning::ln::msgs::FundingSigned as nativeFundingSignedImport;
 type nativeFundingSigned = nativeFundingSignedImport;
@@ -877,7 +987,7 @@ type nativeFundingSigned = nativeFundingSignedImport;
 #[must_use]
 #[repr(C)]
 pub struct FundingSigned {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeFundingSigned,
        pub is_owned: bool,
@@ -900,26 +1010,13 @@ extern "C" fn FundingSigned_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl FundingSigned {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeFundingSigned {
+       pub(crate) fn take_inner(mut self) -> *mut nativeFundingSigned {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for FundingSigned {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 FundingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn FundingSigned_get_channel_id(this_ptr: &FundingSigned) -> *const [u8; 32] {
@@ -950,6 +1047,24 @@ pub extern "C" fn FundingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
                signature: signature_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for FundingSigned {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 FundingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn FundingSigned_clone(orig: &FundingSigned) -> FundingSigned {
+       orig.clone()
+}
 
 use lightning::ln::msgs::FundingLocked as nativeFundingLockedImport;
 type nativeFundingLocked = nativeFundingLockedImport;
@@ -958,7 +1073,7 @@ type nativeFundingLocked = nativeFundingLockedImport;
 #[must_use]
 #[repr(C)]
 pub struct FundingLocked {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeFundingLocked,
        pub is_owned: bool,
@@ -981,26 +1096,13 @@ extern "C" fn FundingLocked_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl FundingLocked {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeFundingLocked {
+       pub(crate) fn take_inner(mut self) -> *mut nativeFundingLocked {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for FundingLocked {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 FundingLocked_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn FundingLocked_get_channel_id(this_ptr: &FundingLocked) -> *const [u8; 32] {
@@ -1031,6 +1133,24 @@ pub extern "C" fn FundingLocked_new(mut channel_id_arg: crate::c_types::ThirtyTw
                next_per_commitment_point: next_per_commitment_point_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for FundingLocked {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 FundingLocked_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn FundingLocked_clone(orig: &FundingLocked) -> FundingLocked {
+       orig.clone()
+}
 
 use lightning::ln::msgs::Shutdown as nativeShutdownImport;
 type nativeShutdown = nativeShutdownImport;
@@ -1039,7 +1159,7 @@ type nativeShutdown = nativeShutdownImport;
 #[must_use]
 #[repr(C)]
 pub struct Shutdown {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeShutdown,
        pub is_owned: bool,
@@ -1062,26 +1182,13 @@ extern "C" fn Shutdown_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl Shutdown {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeShutdown {
+       pub(crate) fn take_inner(mut self) -> *mut nativeShutdown {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for Shutdown {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 Shutdown_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn Shutdown_get_channel_id(this_ptr: &Shutdown) -> *const [u8; 32] {
@@ -1114,6 +1221,24 @@ pub extern "C" fn Shutdown_new(mut channel_id_arg: crate::c_types::ThirtyTwoByte
                scriptpubkey: ::bitcoin::blockdata::script::Script::from(scriptpubkey_arg.into_rust()),
        })), is_owned: true }
 }
+impl Clone for Shutdown {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 Shutdown_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Shutdown_clone(orig: &Shutdown) -> Shutdown {
+       orig.clone()
+}
 
 use lightning::ln::msgs::ClosingSigned as nativeClosingSignedImport;
 type nativeClosingSigned = nativeClosingSignedImport;
@@ -1122,7 +1247,7 @@ type nativeClosingSigned = nativeClosingSignedImport;
 #[must_use]
 #[repr(C)]
 pub struct ClosingSigned {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeClosingSigned,
        pub is_owned: bool,
@@ -1145,26 +1270,13 @@ extern "C" fn ClosingSigned_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl ClosingSigned {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeClosingSigned {
+       pub(crate) fn take_inner(mut self) -> *mut nativeClosingSigned {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for ClosingSigned {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 ClosingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn ClosingSigned_get_channel_id(this_ptr: &ClosingSigned) -> *const [u8; 32] {
@@ -1207,17 +1319,35 @@ pub extern "C" fn ClosingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
                signature: signature_arg.into_rust(),
        })), is_owned: true }
 }
-
-use lightning::ln::msgs::UpdateAddHTLC as nativeUpdateAddHTLCImport;
-type nativeUpdateAddHTLC = nativeUpdateAddHTLCImport;
-
-/// An update_add_htlc message to be sent or received from a peer
-#[must_use]
-#[repr(C)]
-pub struct UpdateAddHTLC {
-       /// Nearly everyhwere, inner must be non-null, however in places where
-       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
-       pub inner: *mut nativeUpdateAddHTLC,
+impl Clone for ClosingSigned {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ClosingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ClosingSigned_clone(orig: &ClosingSigned) -> ClosingSigned {
+       orig.clone()
+}
+
+use lightning::ln::msgs::UpdateAddHTLC as nativeUpdateAddHTLCImport;
+type nativeUpdateAddHTLC = nativeUpdateAddHTLCImport;
+
+/// An update_add_htlc message to be sent or received from a peer
+#[must_use]
+#[repr(C)]
+pub struct UpdateAddHTLC {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeUpdateAddHTLC,
        pub is_owned: bool,
 }
 
@@ -1238,26 +1368,13 @@ extern "C" fn UpdateAddHTLC_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UpdateAddHTLC {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUpdateAddHTLC {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUpdateAddHTLC {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UpdateAddHTLC {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UpdateAddHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn UpdateAddHTLC_get_channel_id(this_ptr: &UpdateAddHTLC) -> *const [u8; 32] {
@@ -1313,6 +1430,24 @@ pub extern "C" fn UpdateAddHTLC_get_cltv_expiry(this_ptr: &UpdateAddHTLC) -> u32
 pub extern "C" fn UpdateAddHTLC_set_cltv_expiry(this_ptr: &mut UpdateAddHTLC, mut val: u32) {
        unsafe { &mut *this_ptr.inner }.cltv_expiry = val;
 }
+impl Clone for UpdateAddHTLC {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UpdateAddHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UpdateAddHTLC_clone(orig: &UpdateAddHTLC) -> UpdateAddHTLC {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UpdateFulfillHTLC as nativeUpdateFulfillHTLCImport;
 type nativeUpdateFulfillHTLC = nativeUpdateFulfillHTLCImport;
@@ -1321,7 +1456,7 @@ type nativeUpdateFulfillHTLC = nativeUpdateFulfillHTLCImport;
 #[must_use]
 #[repr(C)]
 pub struct UpdateFulfillHTLC {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUpdateFulfillHTLC,
        pub is_owned: bool,
@@ -1344,26 +1479,13 @@ extern "C" fn UpdateFulfillHTLC_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UpdateFulfillHTLC {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUpdateFulfillHTLC {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFulfillHTLC {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UpdateFulfillHTLC {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UpdateFulfillHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn UpdateFulfillHTLC_get_channel_id(this_ptr: &UpdateFulfillHTLC) -> *const [u8; 32] {
@@ -1406,6 +1528,24 @@ pub extern "C" fn UpdateFulfillHTLC_new(mut channel_id_arg: crate::c_types::Thir
                payment_preimage: ::lightning::ln::channelmanager::PaymentPreimage(payment_preimage_arg.data),
        })), is_owned: true }
 }
+impl Clone for UpdateFulfillHTLC {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UpdateFulfillHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UpdateFulfillHTLC_clone(orig: &UpdateFulfillHTLC) -> UpdateFulfillHTLC {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UpdateFailHTLC as nativeUpdateFailHTLCImport;
 type nativeUpdateFailHTLC = nativeUpdateFailHTLCImport;
@@ -1414,7 +1554,7 @@ type nativeUpdateFailHTLC = nativeUpdateFailHTLCImport;
 #[must_use]
 #[repr(C)]
 pub struct UpdateFailHTLC {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUpdateFailHTLC,
        pub is_owned: bool,
@@ -1437,26 +1577,13 @@ extern "C" fn UpdateFailHTLC_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UpdateFailHTLC {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUpdateFailHTLC {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFailHTLC {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UpdateFailHTLC {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UpdateFailHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn UpdateFailHTLC_get_channel_id(this_ptr: &UpdateFailHTLC) -> *const [u8; 32] {
@@ -1479,6 +1606,24 @@ pub extern "C" fn UpdateFailHTLC_get_htlc_id(this_ptr: &UpdateFailHTLC) -> u64 {
 pub extern "C" fn UpdateFailHTLC_set_htlc_id(this_ptr: &mut UpdateFailHTLC, mut val: u64) {
        unsafe { &mut *this_ptr.inner }.htlc_id = val;
 }
+impl Clone for UpdateFailHTLC {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UpdateFailHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UpdateFailHTLC_clone(orig: &UpdateFailHTLC) -> UpdateFailHTLC {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UpdateFailMalformedHTLC as nativeUpdateFailMalformedHTLCImport;
 type nativeUpdateFailMalformedHTLC = nativeUpdateFailMalformedHTLCImport;
@@ -1487,7 +1632,7 @@ type nativeUpdateFailMalformedHTLC = nativeUpdateFailMalformedHTLCImport;
 #[must_use]
 #[repr(C)]
 pub struct UpdateFailMalformedHTLC {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUpdateFailMalformedHTLC,
        pub is_owned: bool,
@@ -1510,26 +1655,13 @@ extern "C" fn UpdateFailMalformedHTLC_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UpdateFailMalformedHTLC {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUpdateFailMalformedHTLC {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFailMalformedHTLC {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UpdateFailMalformedHTLC {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UpdateFailMalformedHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn UpdateFailMalformedHTLC_get_channel_id(this_ptr: &UpdateFailMalformedHTLC) -> *const [u8; 32] {
@@ -1563,6 +1695,24 @@ pub extern "C" fn UpdateFailMalformedHTLC_get_failure_code(this_ptr: &UpdateFail
 pub extern "C" fn UpdateFailMalformedHTLC_set_failure_code(this_ptr: &mut UpdateFailMalformedHTLC, mut val: u16) {
        unsafe { &mut *this_ptr.inner }.failure_code = val;
 }
+impl Clone for UpdateFailMalformedHTLC {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UpdateFailMalformedHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UpdateFailMalformedHTLC_clone(orig: &UpdateFailMalformedHTLC) -> UpdateFailMalformedHTLC {
+       orig.clone()
+}
 
 use lightning::ln::msgs::CommitmentSigned as nativeCommitmentSignedImport;
 type nativeCommitmentSigned = nativeCommitmentSignedImport;
@@ -1571,7 +1721,7 @@ type nativeCommitmentSigned = nativeCommitmentSignedImport;
 #[must_use]
 #[repr(C)]
 pub struct CommitmentSigned {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeCommitmentSigned,
        pub is_owned: bool,
@@ -1594,26 +1744,13 @@ extern "C" fn CommitmentSigned_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl CommitmentSigned {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeCommitmentSigned {
+       pub(crate) fn take_inner(mut self) -> *mut nativeCommitmentSigned {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for CommitmentSigned {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 CommitmentSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn CommitmentSigned_get_channel_id(this_ptr: &CommitmentSigned) -> *const [u8; 32] {
@@ -1652,6 +1789,24 @@ pub extern "C" fn CommitmentSigned_new(mut channel_id_arg: crate::c_types::Thirt
                htlc_signatures: local_htlc_signatures_arg,
        })), is_owned: true }
 }
+impl Clone for CommitmentSigned {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 CommitmentSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn CommitmentSigned_clone(orig: &CommitmentSigned) -> CommitmentSigned {
+       orig.clone()
+}
 
 use lightning::ln::msgs::RevokeAndACK as nativeRevokeAndACKImport;
 type nativeRevokeAndACK = nativeRevokeAndACKImport;
@@ -1660,7 +1815,7 @@ type nativeRevokeAndACK = nativeRevokeAndACKImport;
 #[must_use]
 #[repr(C)]
 pub struct RevokeAndACK {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeRevokeAndACK,
        pub is_owned: bool,
@@ -1683,26 +1838,13 @@ extern "C" fn RevokeAndACK_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl RevokeAndACK {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeRevokeAndACK {
+       pub(crate) fn take_inner(mut self) -> *mut nativeRevokeAndACK {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for RevokeAndACK {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 RevokeAndACK_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn RevokeAndACK_get_channel_id(this_ptr: &RevokeAndACK) -> *const [u8; 32] {
@@ -1745,6 +1887,24 @@ pub extern "C" fn RevokeAndACK_new(mut channel_id_arg: crate::c_types::ThirtyTwo
                next_per_commitment_point: next_per_commitment_point_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for RevokeAndACK {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 RevokeAndACK_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn RevokeAndACK_clone(orig: &RevokeAndACK) -> RevokeAndACK {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UpdateFee as nativeUpdateFeeImport;
 type nativeUpdateFee = nativeUpdateFeeImport;
@@ -1753,7 +1913,7 @@ type nativeUpdateFee = nativeUpdateFeeImport;
 #[must_use]
 #[repr(C)]
 pub struct UpdateFee {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUpdateFee,
        pub is_owned: bool,
@@ -1776,26 +1936,13 @@ extern "C" fn UpdateFee_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UpdateFee {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUpdateFee {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUpdateFee {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UpdateFee {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UpdateFee_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn UpdateFee_get_channel_id(this_ptr: &UpdateFee) -> *const [u8; 32] {
@@ -1826,6 +1973,24 @@ pub extern "C" fn UpdateFee_new(mut channel_id_arg: crate::c_types::ThirtyTwoByt
                feerate_per_kw: feerate_per_kw_arg,
        })), is_owned: true }
 }
+impl Clone for UpdateFee {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UpdateFee_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UpdateFee_clone(orig: &UpdateFee) -> UpdateFee {
+       orig.clone()
+}
 
 use lightning::ln::msgs::DataLossProtect as nativeDataLossProtectImport;
 type nativeDataLossProtect = nativeDataLossProtectImport;
@@ -1837,7 +2002,7 @@ type nativeDataLossProtect = nativeDataLossProtectImport;
 #[must_use]
 #[repr(C)]
 pub struct DataLossProtect {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeDataLossProtect,
        pub is_owned: bool,
@@ -1860,26 +2025,13 @@ extern "C" fn DataLossProtect_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl DataLossProtect {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeDataLossProtect {
+       pub(crate) fn take_inner(mut self) -> *mut nativeDataLossProtect {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for DataLossProtect {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 DataLossProtect_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void
-}
 /// Proof that the sender knows the per-commitment secret of a specific commitment transaction
 /// belonging to the recipient
 #[no_mangle]
@@ -1912,6 +2064,24 @@ pub extern "C" fn DataLossProtect_new(mut your_last_per_commitment_secret_arg: c
                my_current_per_commitment_point: my_current_per_commitment_point_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for DataLossProtect {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 DataLossProtect_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn DataLossProtect_clone(orig: &DataLossProtect) -> DataLossProtect {
+       orig.clone()
+}
 
 use lightning::ln::msgs::ChannelReestablish as nativeChannelReestablishImport;
 type nativeChannelReestablish = nativeChannelReestablishImport;
@@ -1920,7 +2090,7 @@ type nativeChannelReestablish = nativeChannelReestablishImport;
 #[must_use]
 #[repr(C)]
 pub struct ChannelReestablish {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeChannelReestablish,
        pub is_owned: bool,
@@ -1943,26 +2113,13 @@ extern "C" fn ChannelReestablish_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl ChannelReestablish {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeChannelReestablish {
+       pub(crate) fn take_inner(mut self) -> *mut nativeChannelReestablish {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for ChannelReestablish {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 ChannelReestablish_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn ChannelReestablish_get_channel_id(this_ptr: &ChannelReestablish) -> *const [u8; 32] {
@@ -1996,19 +2153,37 @@ pub extern "C" fn ChannelReestablish_get_next_remote_commitment_number(this_ptr:
 pub extern "C" fn ChannelReestablish_set_next_remote_commitment_number(this_ptr: &mut ChannelReestablish, mut val: u64) {
        unsafe { &mut *this_ptr.inner }.next_remote_commitment_number = val;
 }
-
-use lightning::ln::msgs::AnnouncementSignatures as nativeAnnouncementSignaturesImport;
-type nativeAnnouncementSignatures = nativeAnnouncementSignaturesImport;
-
-/// An announcement_signatures message to be sent or received from a peer
-#[must_use]
-#[repr(C)]
-pub struct AnnouncementSignatures {
-       /// Nearly everyhwere, inner must be non-null, however in places where
-       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
-       pub inner: *mut nativeAnnouncementSignatures,
-       pub is_owned: bool,
-}
+impl Clone for ChannelReestablish {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ChannelReestablish_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ChannelReestablish_clone(orig: &ChannelReestablish) -> ChannelReestablish {
+       orig.clone()
+}
+
+use lightning::ln::msgs::AnnouncementSignatures as nativeAnnouncementSignaturesImport;
+type nativeAnnouncementSignatures = nativeAnnouncementSignaturesImport;
+
+/// An announcement_signatures message to be sent or received from a peer
+#[must_use]
+#[repr(C)]
+pub struct AnnouncementSignatures {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeAnnouncementSignatures,
+       pub is_owned: bool,
+}
 
 impl Drop for AnnouncementSignatures {
        fn drop(&mut self) {
@@ -2027,26 +2202,13 @@ extern "C" fn AnnouncementSignatures_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl AnnouncementSignatures {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeAnnouncementSignatures {
+       pub(crate) fn take_inner(mut self) -> *mut nativeAnnouncementSignatures {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for AnnouncementSignatures {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 AnnouncementSignatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void
-}
 /// The channel ID
 #[no_mangle]
 pub extern "C" fn AnnouncementSignatures_get_channel_id(this_ptr: &AnnouncementSignatures) -> *const [u8; 32] {
@@ -2101,6 +2263,24 @@ pub extern "C" fn AnnouncementSignatures_new(mut channel_id_arg: crate::c_types:
                bitcoin_signature: bitcoin_signature_arg.into_rust(),
        })), is_owned: true }
 }
+impl Clone for AnnouncementSignatures {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 AnnouncementSignatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn AnnouncementSignatures_clone(orig: &AnnouncementSignatures) -> AnnouncementSignatures {
+       orig.clone()
+}
 /// An address which can be used to connect to a remote peer
 #[must_use]
 #[derive(Clone)]
@@ -2280,6 +2460,20 @@ impl NetAddress {
 }
 #[no_mangle]
 pub extern "C" fn NetAddress_free(this_ptr: NetAddress) { }
+#[no_mangle]
+pub extern "C" fn NetAddress_clone(orig: &NetAddress) -> NetAddress {
+       orig.clone()
+}
+#[no_mangle]
+pub extern "C" fn NetAddress_write(obj: &NetAddress) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(&unsafe { &*obj }.to_native())
+}
+#[no_mangle]
+pub extern "C" fn Result_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CResult_NetAddressu8ZDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { let mut local_res_0 = match o { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::NetAddress::native_into(o) }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { e }).into() }; local_res_0 }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
 
 use lightning::ln::msgs::UnsignedNodeAnnouncement as nativeUnsignedNodeAnnouncementImport;
 type nativeUnsignedNodeAnnouncement = nativeUnsignedNodeAnnouncementImport;
@@ -2288,7 +2482,7 @@ type nativeUnsignedNodeAnnouncement = nativeUnsignedNodeAnnouncementImport;
 #[must_use]
 #[repr(C)]
 pub struct UnsignedNodeAnnouncement {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUnsignedNodeAnnouncement,
        pub is_owned: bool,
@@ -2311,25 +2505,23 @@ extern "C" fn UnsignedNodeAnnouncement_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UnsignedNodeAnnouncement {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUnsignedNodeAnnouncement {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedNodeAnnouncement {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UnsignedNodeAnnouncement {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
-                       is_owned: true,
-               }
-       }
+/// The advertised features
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_get_features(this_ptr: &UnsignedNodeAnnouncement) -> crate::ln::features::NodeFeatures {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
+       crate::ln::features::NodeFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
 }
-#[allow(unused)]
-/// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn UnsignedNodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void
+/// The advertised features
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_set_features(this_ptr: &mut UnsignedNodeAnnouncement, mut val: crate::ln::features::NodeFeatures) {
+       unsafe { &mut *this_ptr.inner }.features = *unsafe { Box::from_raw(val.take_inner()) };
 }
 /// A strictly monotonic announcement counter, with gaps allowed
 #[no_mangle]
@@ -2385,6 +2577,24 @@ pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut Unsigned
        let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item.into_native() }); };
        unsafe { &mut *this_ptr.inner }.addresses = local_val;
 }
+impl Clone for UnsignedNodeAnnouncement {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UnsignedNodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_clone(orig: &UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement {
+       orig.clone()
+}
 
 use lightning::ln::msgs::NodeAnnouncement as nativeNodeAnnouncementImport;
 type nativeNodeAnnouncement = nativeNodeAnnouncementImport;
@@ -2393,7 +2603,7 @@ type nativeNodeAnnouncement = nativeNodeAnnouncementImport;
 #[must_use]
 #[repr(C)]
 pub struct NodeAnnouncement {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeNodeAnnouncement,
        pub is_owned: bool,
@@ -2416,26 +2626,13 @@ extern "C" fn NodeAnnouncement_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl NodeAnnouncement {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeNodeAnnouncement {
+       pub(crate) fn take_inner(mut self) -> *mut nativeNodeAnnouncement {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for NodeAnnouncement {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 NodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void
-}
 /// The signature by the node key
 #[no_mangle]
 pub extern "C" fn NodeAnnouncement_get_signature(this_ptr: &NodeAnnouncement) -> crate::c_types::Signature {
@@ -2456,16 +2653,34 @@ pub extern "C" fn NodeAnnouncement_get_contents(this_ptr: &NodeAnnouncement) ->
 /// The actual content of the announcement
 #[no_mangle]
 pub extern "C" fn NodeAnnouncement_set_contents(this_ptr: &mut NodeAnnouncement, mut val: crate::ln::msgs::UnsignedNodeAnnouncement) {
-       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_ptr()) };
+       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
 }
 #[must_use]
 #[no_mangle]
 pub extern "C" fn NodeAnnouncement_new(mut signature_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedNodeAnnouncement) -> NodeAnnouncement {
        NodeAnnouncement { inner: Box::into_raw(Box::new(nativeNodeAnnouncement {
                signature: signature_arg.into_rust(),
-               contents: *unsafe { Box::from_raw(contents_arg.take_ptr()) },
+               contents: *unsafe { Box::from_raw(contents_arg.take_inner()) },
        })), is_owned: true }
 }
+impl Clone for NodeAnnouncement {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 NodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn NodeAnnouncement_clone(orig: &NodeAnnouncement) -> NodeAnnouncement {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UnsignedChannelAnnouncement as nativeUnsignedChannelAnnouncementImport;
 type nativeUnsignedChannelAnnouncement = nativeUnsignedChannelAnnouncementImport;
@@ -2474,7 +2689,7 @@ type nativeUnsignedChannelAnnouncement = nativeUnsignedChannelAnnouncementImport
 #[must_use]
 #[repr(C)]
 pub struct UnsignedChannelAnnouncement {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUnsignedChannelAnnouncement,
        pub is_owned: bool,
@@ -2497,25 +2712,23 @@ extern "C" fn UnsignedChannelAnnouncement_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UnsignedChannelAnnouncement {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUnsignedChannelAnnouncement {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedChannelAnnouncement {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UnsignedChannelAnnouncement {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
-                       is_owned: true,
-               }
-       }
+/// The advertised channel features
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_get_features(this_ptr: &UnsignedChannelAnnouncement) -> crate::ln::features::ChannelFeatures {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
+       crate::ln::features::ChannelFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
 }
-#[allow(unused)]
-/// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn UnsignedChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void
+/// The advertised channel features
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_set_features(this_ptr: &mut UnsignedChannelAnnouncement, mut val: crate::ln::features::ChannelFeatures) {
+       unsafe { &mut *this_ptr.inner }.features = *unsafe { Box::from_raw(val.take_inner()) };
 }
 /// The genesis hash of the blockchain where the channel is to be opened
 #[no_mangle]
@@ -2583,6 +2796,24 @@ pub extern "C" fn UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr: &Unsig
 pub extern "C" fn UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: &mut UnsignedChannelAnnouncement, mut val: crate::c_types::PublicKey) {
        unsafe { &mut *this_ptr.inner }.bitcoin_key_2 = val.into_rust();
 }
+impl Clone for UnsignedChannelAnnouncement {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UnsignedChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_clone(orig: &UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement {
+       orig.clone()
+}
 
 use lightning::ln::msgs::ChannelAnnouncement as nativeChannelAnnouncementImport;
 type nativeChannelAnnouncement = nativeChannelAnnouncementImport;
@@ -2591,7 +2822,7 @@ type nativeChannelAnnouncement = nativeChannelAnnouncementImport;
 #[must_use]
 #[repr(C)]
 pub struct ChannelAnnouncement {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeChannelAnnouncement,
        pub is_owned: bool,
@@ -2614,26 +2845,13 @@ extern "C" fn ChannelAnnouncement_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl ChannelAnnouncement {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeChannelAnnouncement {
+       pub(crate) fn take_inner(mut self) -> *mut nativeChannelAnnouncement {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for ChannelAnnouncement {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 ChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void
-}
 /// Authentication of the announcement by the first public node
 #[no_mangle]
 pub extern "C" fn ChannelAnnouncement_get_node_signature_1(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
@@ -2687,7 +2905,7 @@ pub extern "C" fn ChannelAnnouncement_get_contents(this_ptr: &ChannelAnnouncemen
 /// The actual announcement
 #[no_mangle]
 pub extern "C" fn ChannelAnnouncement_set_contents(this_ptr: &mut ChannelAnnouncement, mut val: crate::ln::msgs::UnsignedChannelAnnouncement) {
-       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_ptr()) };
+       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
 }
 #[must_use]
 #[no_mangle]
@@ -2697,9 +2915,27 @@ pub extern "C" fn ChannelAnnouncement_new(mut node_signature_1_arg: crate::c_typ
                node_signature_2: node_signature_2_arg.into_rust(),
                bitcoin_signature_1: bitcoin_signature_1_arg.into_rust(),
                bitcoin_signature_2: bitcoin_signature_2_arg.into_rust(),
-               contents: *unsafe { Box::from_raw(contents_arg.take_ptr()) },
+               contents: *unsafe { Box::from_raw(contents_arg.take_inner()) },
        })), is_owned: true }
 }
+impl Clone for ChannelAnnouncement {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ChannelAnnouncement_clone(orig: &ChannelAnnouncement) -> ChannelAnnouncement {
+       orig.clone()
+}
 
 use lightning::ln::msgs::UnsignedChannelUpdate as nativeUnsignedChannelUpdateImport;
 type nativeUnsignedChannelUpdate = nativeUnsignedChannelUpdateImport;
@@ -2708,7 +2944,7 @@ type nativeUnsignedChannelUpdate = nativeUnsignedChannelUpdateImport;
 #[must_use]
 #[repr(C)]
 pub struct UnsignedChannelUpdate {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeUnsignedChannelUpdate,
        pub is_owned: bool,
@@ -2731,26 +2967,13 @@ extern "C" fn UnsignedChannelUpdate_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl UnsignedChannelUpdate {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeUnsignedChannelUpdate {
+       pub(crate) fn take_inner(mut self) -> *mut nativeUnsignedChannelUpdate {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for UnsignedChannelUpdate {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 UnsignedChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void
-}
 /// The genesis hash of the blockchain where the channel is to be opened
 #[no_mangle]
 pub extern "C" fn UnsignedChannelUpdate_get_chain_hash(this_ptr: &UnsignedChannelUpdate) -> *const [u8; 32] {
@@ -2806,54 +3029,565 @@ pub extern "C" fn UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr: &Unsigne
 pub extern "C" fn UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr: &mut UnsignedChannelUpdate, mut val: u16) {
        unsafe { &mut *this_ptr.inner }.cltv_expiry_delta = val;
 }
-/// The minimum HTLC size incoming to sender, in milli-satoshi
+/// The minimum HTLC size incoming to sender, in milli-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr: &UnsignedChannelUpdate) -> u64 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_minimum_msat;
+       (*inner_val)
+}
+/// The minimum HTLC size incoming to sender, in milli-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr: &mut UnsignedChannelUpdate, mut val: u64) {
+       unsafe { &mut *this_ptr.inner }.htlc_minimum_msat = val;
+}
+/// The base HTLC fee charged by sender, in milli-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_get_fee_base_msat(this_ptr: &UnsignedChannelUpdate) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_base_msat;
+       (*inner_val)
+}
+/// The base HTLC fee charged by sender, in milli-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_set_fee_base_msat(this_ptr: &mut UnsignedChannelUpdate, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.fee_base_msat = val;
+}
+/// The amount to fee multiplier, in micro-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr: &UnsignedChannelUpdate) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_proportional_millionths;
+       (*inner_val)
+}
+/// The amount to fee multiplier, in micro-satoshi
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr: &mut UnsignedChannelUpdate, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.fee_proportional_millionths = val;
+}
+impl Clone for UnsignedChannelUpdate {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 UnsignedChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_clone(orig: &UnsignedChannelUpdate) -> UnsignedChannelUpdate {
+       orig.clone()
+}
+
+use lightning::ln::msgs::ChannelUpdate as nativeChannelUpdateImport;
+type nativeChannelUpdate = nativeChannelUpdateImport;
+
+/// A channel_update message to be sent or received from a peer
+#[must_use]
+#[repr(C)]
+pub struct ChannelUpdate {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeChannelUpdate,
+       pub is_owned: bool,
+}
+
+impl Drop for ChannelUpdate {
+       fn drop(&mut self) {
+               if self.is_owned && !self.inner.is_null() {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_free(this_ptr: ChannelUpdate) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn ChannelUpdate_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelUpdate); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl ChannelUpdate {
+       pub(crate) fn take_inner(mut self) -> *mut nativeChannelUpdate {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// A signature of the channel update
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_get_signature(this_ptr: &ChannelUpdate) -> crate::c_types::Signature {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
+       crate::c_types::Signature::from_rust(&(*inner_val))
+}
+/// A signature of the channel update
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_set_signature(this_ptr: &mut ChannelUpdate, mut val: crate::c_types::Signature) {
+       unsafe { &mut *this_ptr.inner }.signature = val.into_rust();
+}
+/// The actual channel update
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_get_contents(this_ptr: &ChannelUpdate) -> crate::ln::msgs::UnsignedChannelUpdate {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.contents;
+       crate::ln::msgs::UnsignedChannelUpdate { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+}
+/// The actual channel update
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_set_contents(this_ptr: &mut ChannelUpdate, mut val: crate::ln::msgs::UnsignedChannelUpdate) {
+       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_inner()) };
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedChannelUpdate) -> ChannelUpdate {
+       ChannelUpdate { inner: Box::into_raw(Box::new(nativeChannelUpdate {
+               signature: signature_arg.into_rust(),
+               contents: *unsafe { Box::from_raw(contents_arg.take_inner()) },
+       })), is_owned: true }
+}
+impl Clone for ChannelUpdate {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_clone(orig: &ChannelUpdate) -> ChannelUpdate {
+       orig.clone()
+}
+
+use lightning::ln::msgs::QueryChannelRange as nativeQueryChannelRangeImport;
+type nativeQueryChannelRange = nativeQueryChannelRangeImport;
+
+/// A query_channel_range message is used to query a peer for channel
+/// UTXOs in a range of blocks. The recipient of a query makes a best
+/// effort to reply to the query using one or more reply_channel_range
+/// messages.
+#[must_use]
+#[repr(C)]
+pub struct QueryChannelRange {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeQueryChannelRange,
+       pub is_owned: bool,
+}
+
+impl Drop for QueryChannelRange {
+       fn drop(&mut self) {
+               if self.is_owned && !self.inner.is_null() {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_free(this_ptr: QueryChannelRange) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn QueryChannelRange_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeQueryChannelRange); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl QueryChannelRange {
+       pub(crate) fn take_inner(mut self) -> *mut nativeQueryChannelRange {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_get_chain_hash(this_ptr: &QueryChannelRange) -> *const [u8; 32] {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
+       (*inner_val).as_inner()
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_set_chain_hash(this_ptr: &mut QueryChannelRange, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
+}
+/// The height of the first block for the channel UTXOs being queried
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_get_first_blocknum(this_ptr: &QueryChannelRange) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum;
+       (*inner_val)
+}
+/// The height of the first block for the channel UTXOs being queried
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_set_first_blocknum(this_ptr: &mut QueryChannelRange, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.first_blocknum = val;
+}
+/// The number of blocks to include in the query results
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_get_number_of_blocks(this_ptr: &QueryChannelRange) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks;
+       (*inner_val)
+}
+/// The number of blocks to include in the query results
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_set_number_of_blocks(this_ptr: &mut QueryChannelRange, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.number_of_blocks = val;
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32) -> QueryChannelRange {
+       QueryChannelRange { inner: Box::into_raw(Box::new(nativeQueryChannelRange {
+               chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(),
+               first_blocknum: first_blocknum_arg,
+               number_of_blocks: number_of_blocks_arg,
+       })), is_owned: true }
+}
+impl Clone for QueryChannelRange {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 QueryChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryChannelRange)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_clone(orig: &QueryChannelRange) -> QueryChannelRange {
+       orig.clone()
+}
+
+use lightning::ln::msgs::ReplyChannelRange as nativeReplyChannelRangeImport;
+type nativeReplyChannelRange = nativeReplyChannelRangeImport;
+
+/// A reply_channel_range message is a reply to a query_channel_range
+/// message. Multiple reply_channel_range messages can be sent in reply
+/// to a single query_channel_range message. The query recipient makes a
+/// best effort to respond based on their local network view which may
+/// not be a perfect view of the network. The short_channel_ids in the
+/// reply are encoded. We only support encoding_type=0 uncompressed
+/// serialization and do not support encoding_type=1 zlib serialization.
+#[must_use]
+#[repr(C)]
+pub struct ReplyChannelRange {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeReplyChannelRange,
+       pub is_owned: bool,
+}
+
+impl Drop for ReplyChannelRange {
+       fn drop(&mut self) {
+               if self.is_owned && !self.inner.is_null() {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_free(this_ptr: ReplyChannelRange) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn ReplyChannelRange_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeReplyChannelRange); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl ReplyChannelRange {
+       pub(crate) fn take_inner(mut self) -> *mut nativeReplyChannelRange {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_get_chain_hash(this_ptr: &ReplyChannelRange) -> *const [u8; 32] {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
+       (*inner_val).as_inner()
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_set_chain_hash(this_ptr: &mut ReplyChannelRange, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
+}
+/// The height of the first block in the range of the reply
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_get_first_blocknum(this_ptr: &ReplyChannelRange) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum;
+       (*inner_val)
+}
+/// The height of the first block in the range of the reply
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_set_first_blocknum(this_ptr: &mut ReplyChannelRange, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.first_blocknum = val;
+}
+/// The number of blocks included in the range of the reply
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_get_number_of_blocks(this_ptr: &ReplyChannelRange) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks;
+       (*inner_val)
+}
+/// The number of blocks included in the range of the reply
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_set_number_of_blocks(this_ptr: &mut ReplyChannelRange, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.number_of_blocks = val;
+}
+/// True when this is the final reply for a query
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_get_sync_complete(this_ptr: &ReplyChannelRange) -> bool {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.sync_complete;
+       (*inner_val)
+}
+/// True when this is the final reply for a query
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_set_sync_complete(this_ptr: &mut ReplyChannelRange, mut val: bool) {
+       unsafe { &mut *this_ptr.inner }.sync_complete = val;
+}
+/// The short_channel_ids in the channel range
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_set_short_channel_ids(this_ptr: &mut ReplyChannelRange, mut val: crate::c_types::derived::CVec_u64Z) {
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
+       unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val;
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32, mut sync_complete_arg: bool, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> ReplyChannelRange {
+       let mut local_short_channel_ids_arg = Vec::new(); for mut item in short_channel_ids_arg.into_rust().drain(..) { local_short_channel_ids_arg.push( { item }); };
+       ReplyChannelRange { inner: Box::into_raw(Box::new(nativeReplyChannelRange {
+               chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(),
+               first_blocknum: first_blocknum_arg,
+               number_of_blocks: number_of_blocks_arg,
+               sync_complete: sync_complete_arg,
+               short_channel_ids: local_short_channel_ids_arg,
+       })), is_owned: true }
+}
+impl Clone for ReplyChannelRange {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ReplyChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyChannelRange)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_clone(orig: &ReplyChannelRange) -> ReplyChannelRange {
+       orig.clone()
+}
+
+use lightning::ln::msgs::QueryShortChannelIds as nativeQueryShortChannelIdsImport;
+type nativeQueryShortChannelIds = nativeQueryShortChannelIdsImport;
+
+/// A query_short_channel_ids message is used to query a peer for
+/// routing gossip messages related to one or more short_channel_ids.
+/// The query recipient will reply with the latest, if available,
+/// channel_announcement, channel_update and node_announcement messages
+/// it maintains for the requested short_channel_ids followed by a
+/// reply_short_channel_ids_end message. The short_channel_ids sent in
+/// this query are encoded. We only support encoding_type=0 uncompressed
+/// serialization and do not support encoding_type=1 zlib serialization.
+#[must_use]
+#[repr(C)]
+pub struct QueryShortChannelIds {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeQueryShortChannelIds,
+       pub is_owned: bool,
+}
+
+impl Drop for QueryShortChannelIds {
+       fn drop(&mut self) {
+               if self.is_owned && !self.inner.is_null() {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_free(this_ptr: QueryShortChannelIds) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn QueryShortChannelIds_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeQueryShortChannelIds); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl QueryShortChannelIds {
+       pub(crate) fn take_inner(mut self) -> *mut nativeQueryShortChannelIds {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_get_chain_hash(this_ptr: &QueryShortChannelIds) -> *const [u8; 32] {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
+       (*inner_val).as_inner()
+}
+/// The genesis hash of the blockchain being queried
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_set_chain_hash(this_ptr: &mut QueryShortChannelIds, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
+}
+/// The short_channel_ids that are being queried
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_set_short_channel_ids(this_ptr: &mut QueryShortChannelIds, mut val: crate::c_types::derived::CVec_u64Z) {
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); };
+       unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val;
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> QueryShortChannelIds {
+       let mut local_short_channel_ids_arg = Vec::new(); for mut item in short_channel_ids_arg.into_rust().drain(..) { local_short_channel_ids_arg.push( { item }); };
+       QueryShortChannelIds { inner: Box::into_raw(Box::new(nativeQueryShortChannelIds {
+               chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(),
+               short_channel_ids: local_short_channel_ids_arg,
+       })), is_owned: true }
+}
+impl Clone for QueryShortChannelIds {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 QueryShortChannelIds_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryShortChannelIds)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_clone(orig: &QueryShortChannelIds) -> QueryShortChannelIds {
+       orig.clone()
+}
+
+use lightning::ln::msgs::ReplyShortChannelIdsEnd as nativeReplyShortChannelIdsEndImport;
+type nativeReplyShortChannelIdsEnd = nativeReplyShortChannelIdsEndImport;
+
+/// A reply_short_channel_ids_end message is sent as a reply to a
+/// query_short_channel_ids message. The query recipient makes a best
+/// effort to respond based on their local network view which may not be
+/// a perfect view of the network.
+#[must_use]
+#[repr(C)]
+pub struct ReplyShortChannelIdsEnd {
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeReplyShortChannelIdsEnd,
+       pub is_owned: bool,
+}
+
+impl Drop for ReplyShortChannelIdsEnd {
+       fn drop(&mut self) {
+               if self.is_owned && !self.inner.is_null() {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+#[no_mangle]
+pub extern "C" fn ReplyShortChannelIdsEnd_free(this_ptr: ReplyShortChannelIdsEnd) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn ReplyShortChannelIdsEnd_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeReplyShortChannelIdsEnd); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl ReplyShortChannelIdsEnd {
+       pub(crate) fn take_inner(mut self) -> *mut nativeReplyShortChannelIdsEnd {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// The genesis hash of the blockchain that was queried
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr: &UnsignedChannelUpdate) -> u64 {
-       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_minimum_msat;
-       (*inner_val)
+pub extern "C" fn ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: &ReplyShortChannelIdsEnd) -> *const [u8; 32] {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
+       (*inner_val).as_inner()
 }
-/// The minimum HTLC size incoming to sender, in milli-satoshi
+/// The genesis hash of the blockchain that was queried
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr: &mut UnsignedChannelUpdate, mut val: u64) {
-       unsafe { &mut *this_ptr.inner }.htlc_minimum_msat = val;
+pub extern "C" fn ReplyShortChannelIdsEnd_set_chain_hash(this_ptr: &mut ReplyShortChannelIdsEnd, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
 }
-/// The base HTLC fee charged by sender, in milli-satoshi
+/// Indicates if the query recipient maintains up-to-date channel
+/// information for the chain_hash
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_get_fee_base_msat(this_ptr: &UnsignedChannelUpdate) -> u32 {
-       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_base_msat;
+pub extern "C" fn ReplyShortChannelIdsEnd_get_full_information(this_ptr: &ReplyShortChannelIdsEnd) -> bool {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.full_information;
        (*inner_val)
 }
-/// The base HTLC fee charged by sender, in milli-satoshi
+/// Indicates if the query recipient maintains up-to-date channel
+/// information for the chain_hash
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_set_fee_base_msat(this_ptr: &mut UnsignedChannelUpdate, mut val: u32) {
-       unsafe { &mut *this_ptr.inner }.fee_base_msat = val;
+pub extern "C" fn ReplyShortChannelIdsEnd_set_full_information(this_ptr: &mut ReplyShortChannelIdsEnd, mut val: bool) {
+       unsafe { &mut *this_ptr.inner }.full_information = val;
 }
-/// The amount to fee multiplier, in micro-satoshi
+#[must_use]
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr: &UnsignedChannelUpdate) -> u32 {
-       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.fee_proportional_millionths;
-       (*inner_val)
+pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut full_information_arg: bool) -> ReplyShortChannelIdsEnd {
+       ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(nativeReplyShortChannelIdsEnd {
+               chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(),
+               full_information: full_information_arg,
+       })), is_owned: true }
+}
+impl Clone for ReplyShortChannelIdsEnd {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 ReplyShortChannelIdsEnd_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyShortChannelIdsEnd)).clone() })) as *mut c_void
 }
-/// The amount to fee multiplier, in micro-satoshi
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr: &mut UnsignedChannelUpdate, mut val: u32) {
-       unsafe { &mut *this_ptr.inner }.fee_proportional_millionths = val;
+pub extern "C" fn ReplyShortChannelIdsEnd_clone(orig: &ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd {
+       orig.clone()
 }
 
-use lightning::ln::msgs::ChannelUpdate as nativeChannelUpdateImport;
-type nativeChannelUpdate = nativeChannelUpdateImport;
+use lightning::ln::msgs::GossipTimestampFilter as nativeGossipTimestampFilterImport;
+type nativeGossipTimestampFilter = nativeGossipTimestampFilterImport;
 
-/// A channel_update message to be sent or received from a peer
+/// A gossip_timestamp_filter message is used by a node to request
+/// gossip relay for messages in the requested time range when the
+/// gossip_queries feature has been negotiated.
 #[must_use]
 #[repr(C)]
-pub struct ChannelUpdate {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+pub struct GossipTimestampFilter {
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
-       pub inner: *mut nativeChannelUpdate,
+       pub inner: *mut nativeGossipTimestampFilter,
        pub is_owned: bool,
 }
 
-impl Drop for ChannelUpdate {
+impl Drop for GossipTimestampFilter {
        fn drop(&mut self) {
                if self.is_owned && !self.inner.is_null() {
                        let _ = unsafe { Box::from_raw(self.inner) };
@@ -2861,65 +3595,82 @@ impl Drop for ChannelUpdate {
        }
 }
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_free(this_ptr: ChannelUpdate) { }
+pub extern "C" fn GossipTimestampFilter_free(this_ptr: GossipTimestampFilter) { }
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
-extern "C" fn ChannelUpdate_free_void(this_ptr: *mut c_void) {
-       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeChannelUpdate); }
+extern "C" fn GossipTimestampFilter_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeGossipTimestampFilter); }
 }
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
-impl ChannelUpdate {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeChannelUpdate {
+impl GossipTimestampFilter {
+       pub(crate) fn take_inner(mut self) -> *mut nativeGossipTimestampFilter {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for ChannelUpdate {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
-                       is_owned: true,
-               }
-       }
+/// The genesis hash of the blockchain for channel and node information
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_get_chain_hash(this_ptr: &GossipTimestampFilter) -> *const [u8; 32] {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash;
+       (*inner_val).as_inner()
 }
-#[allow(unused)]
-/// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn ChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void
+/// The genesis hash of the blockchain for channel and node information
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_set_chain_hash(this_ptr: &mut GossipTimestampFilter, mut val: crate::c_types::ThirtyTwoBytes) {
+       unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap();
 }
-/// A signature of the channel update
+/// The starting unix timestamp
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_get_signature(this_ptr: &ChannelUpdate) -> crate::c_types::Signature {
-       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.signature;
-       crate::c_types::Signature::from_rust(&(*inner_val))
+pub extern "C" fn GossipTimestampFilter_get_first_timestamp(this_ptr: &GossipTimestampFilter) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_timestamp;
+       (*inner_val)
 }
-/// A signature of the channel update
+/// The starting unix timestamp
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_set_signature(this_ptr: &mut ChannelUpdate, mut val: crate::c_types::Signature) {
-       unsafe { &mut *this_ptr.inner }.signature = val.into_rust();
+pub extern "C" fn GossipTimestampFilter_set_first_timestamp(this_ptr: &mut GossipTimestampFilter, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.first_timestamp = val;
 }
-/// The actual channel update
+/// The range of information in seconds
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_get_contents(this_ptr: &ChannelUpdate) -> crate::ln::msgs::UnsignedChannelUpdate {
-       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.contents;
-       crate::ln::msgs::UnsignedChannelUpdate { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+pub extern "C" fn GossipTimestampFilter_get_timestamp_range(this_ptr: &GossipTimestampFilter) -> u32 {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.timestamp_range;
+       (*inner_val)
 }
-/// The actual channel update
+/// The range of information in seconds
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_set_contents(this_ptr: &mut ChannelUpdate, mut val: crate::ln::msgs::UnsignedChannelUpdate) {
-       unsafe { &mut *this_ptr.inner }.contents = *unsafe { Box::from_raw(val.take_ptr()) };
+pub extern "C" fn GossipTimestampFilter_set_timestamp_range(this_ptr: &mut GossipTimestampFilter, mut val: u32) {
+       unsafe { &mut *this_ptr.inner }.timestamp_range = val;
 }
 #[must_use]
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature, mut contents_arg: crate::ln::msgs::UnsignedChannelUpdate) -> ChannelUpdate {
-       ChannelUpdate { inner: Box::into_raw(Box::new(nativeChannelUpdate {
-               signature: signature_arg.into_rust(),
-               contents: *unsafe { Box::from_raw(contents_arg.take_ptr()) },
+pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_timestamp_arg: u32, mut timestamp_range_arg: u32) -> GossipTimestampFilter {
+       GossipTimestampFilter { inner: Box::into_raw(Box::new(nativeGossipTimestampFilter {
+               chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(),
+               first_timestamp: first_timestamp_arg,
+               timestamp_range: timestamp_range_arg,
        })), is_owned: true }
 }
+impl Clone for GossipTimestampFilter {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 GossipTimestampFilter_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeGossipTimestampFilter)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_clone(orig: &GossipTimestampFilter) -> GossipTimestampFilter {
+       orig.clone()
+}
 /// Used to put an error message in a LightningError
 #[must_use]
 #[derive(Clone)]
@@ -2943,7 +3694,7 @@ impl ErrorAction {
                match self {
                        ErrorAction::DisconnectPeer {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
-                               let mut local_msg_nonref = if msg_nonref.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg_nonref.take_ptr()) } }) };
+                               let mut local_msg_nonref = if msg_nonref.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg_nonref.take_inner()) } }) };
                                nativeErrorAction::DisconnectPeer {
                                        msg: local_msg_nonref,
                                }
@@ -2952,7 +3703,7 @@ impl ErrorAction {
                        ErrorAction::SendErrorMessage {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
                                nativeErrorAction::SendErrorMessage {
-                                       msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+                                       msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
                                }
                        },
                }
@@ -2961,7 +3712,7 @@ impl ErrorAction {
        pub(crate) fn into_native(self) -> nativeErrorAction {
                match self {
                        ErrorAction::DisconnectPeer {mut msg, } => {
-                               let mut local_msg = if msg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg.take_ptr()) } }) };
+                               let mut local_msg = if msg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(msg.take_inner()) } }) };
                                nativeErrorAction::DisconnectPeer {
                                        msg: local_msg,
                                }
@@ -2969,7 +3720,7 @@ impl ErrorAction {
                        ErrorAction::IgnoreError => nativeErrorAction::IgnoreError,
                        ErrorAction::SendErrorMessage {mut msg, } => {
                                nativeErrorAction::SendErrorMessage {
-                                       msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+                                       msg: *unsafe { Box::from_raw(msg.take_inner()) },
                                }
                        },
                }
@@ -3013,6 +3764,10 @@ impl ErrorAction {
 }
 #[no_mangle]
 pub extern "C" fn ErrorAction_free(this_ptr: ErrorAction) { }
+#[no_mangle]
+pub extern "C" fn ErrorAction_clone(orig: &ErrorAction) -> ErrorAction {
+       orig.clone()
+}
 
 use lightning::ln::msgs::LightningError as nativeLightningErrorImport;
 type nativeLightningError = nativeLightningErrorImport;
@@ -3021,7 +3776,7 @@ type nativeLightningError = nativeLightningErrorImport;
 #[must_use]
 #[repr(C)]
 pub struct LightningError {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeLightningError,
        pub is_owned: bool,
@@ -3044,7 +3799,7 @@ extern "C" fn LightningError_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl LightningError {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeLightningError {
+       pub(crate) fn take_inner(mut self) -> *mut nativeLightningError {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
@@ -3081,6 +3836,24 @@ pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::derived::CVec_
                action: action_arg.into_native(),
        })), is_owned: true }
 }
+impl Clone for LightningError {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 LightningError_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeLightningError)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn LightningError_clone(orig: &LightningError) -> LightningError {
+       orig.clone()
+}
 
 use lightning::ln::msgs::CommitmentUpdate as nativeCommitmentUpdateImport;
 type nativeCommitmentUpdate = nativeCommitmentUpdateImport;
@@ -3090,7 +3863,7 @@ type nativeCommitmentUpdate = nativeCommitmentUpdateImport;
 #[must_use]
 #[repr(C)]
 pub struct CommitmentUpdate {
-       /// Nearly everyhwere, inner must be non-null, however in places where
+       /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
        pub inner: *mut nativeCommitmentUpdate,
        pub is_owned: bool,
@@ -3113,48 +3886,35 @@ extern "C" fn CommitmentUpdate_free_void(this_ptr: *mut c_void) {
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
 impl CommitmentUpdate {
-       pub(crate) fn take_ptr(mut self) -> *mut nativeCommitmentUpdate {
+       pub(crate) fn take_inner(mut self) -> *mut nativeCommitmentUpdate {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-impl Clone for CommitmentUpdate {
-       fn clone(&self) -> Self {
-               Self {
-                       inner: Box::into_raw(Box::new(unsafe { &*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 CommitmentUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void
-}
 /// update_add_htlc messages which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_update_add_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateAddHTLCZ) {
-       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
        unsafe { &mut *this_ptr.inner }.update_add_htlcs = local_val;
 }
 /// update_fulfill_htlc messages which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_update_fulfill_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateFulfillHTLCZ) {
-       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
        unsafe { &mut *this_ptr.inner }.update_fulfill_htlcs = local_val;
 }
 /// update_fail_htlc messages which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_update_fail_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateFailHTLCZ) {
-       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
        unsafe { &mut *this_ptr.inner }.update_fail_htlcs = local_val;
 }
 /// update_fail_malformed_htlc messages which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateFailMalformedHTLCZ) {
-       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
+       let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
        unsafe { &mut *this_ptr.inner }.update_fail_malformed_htlcs = local_val;
 }
 /// An update_fee message which should be sent
@@ -3167,7 +3927,7 @@ pub extern "C" fn CommitmentUpdate_get_update_fee(this_ptr: &CommitmentUpdate) -
 /// An update_fee message which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_update_fee(this_ptr: &mut CommitmentUpdate, mut val: crate::ln::msgs::UpdateFee) {
-       let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_ptr()) } }) };
+       let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) };
        unsafe { &mut *this_ptr.inner }.update_fee = local_val;
 }
 /// Finally, the commitment_signed message which should be sent
@@ -3179,25 +3939,43 @@ pub extern "C" fn CommitmentUpdate_get_commitment_signed(this_ptr: &CommitmentUp
 /// Finally, the commitment_signed message which should be sent
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_set_commitment_signed(this_ptr: &mut CommitmentUpdate, mut val: crate::ln::msgs::CommitmentSigned) {
-       unsafe { &mut *this_ptr.inner }.commitment_signed = *unsafe { Box::from_raw(val.take_ptr()) };
+       unsafe { &mut *this_ptr.inner }.commitment_signed = *unsafe { Box::from_raw(val.take_inner()) };
 }
 #[must_use]
 #[no_mangle]
 pub extern "C" fn CommitmentUpdate_new(mut update_add_htlcs_arg: crate::c_types::derived::CVec_UpdateAddHTLCZ, mut update_fulfill_htlcs_arg: crate::c_types::derived::CVec_UpdateFulfillHTLCZ, mut update_fail_htlcs_arg: crate::c_types::derived::CVec_UpdateFailHTLCZ, mut update_fail_malformed_htlcs_arg: crate::c_types::derived::CVec_UpdateFailMalformedHTLCZ, mut update_fee_arg: crate::ln::msgs::UpdateFee, mut commitment_signed_arg: crate::ln::msgs::CommitmentSigned) -> CommitmentUpdate {
-       let mut local_update_add_htlcs_arg = Vec::new(); for mut item in update_add_htlcs_arg.into_rust().drain(..) { local_update_add_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
-       let mut local_update_fulfill_htlcs_arg = Vec::new(); for mut item in update_fulfill_htlcs_arg.into_rust().drain(..) { local_update_fulfill_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
-       let mut local_update_fail_htlcs_arg = Vec::new(); for mut item in update_fail_htlcs_arg.into_rust().drain(..) { local_update_fail_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
-       let mut local_update_fail_malformed_htlcs_arg = Vec::new(); for mut item in update_fail_malformed_htlcs_arg.into_rust().drain(..) { local_update_fail_malformed_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
-       let mut local_update_fee_arg = if update_fee_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(update_fee_arg.take_ptr()) } }) };
+       let mut local_update_add_htlcs_arg = Vec::new(); for mut item in update_add_htlcs_arg.into_rust().drain(..) { local_update_add_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
+       let mut local_update_fulfill_htlcs_arg = Vec::new(); for mut item in update_fulfill_htlcs_arg.into_rust().drain(..) { local_update_fulfill_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
+       let mut local_update_fail_htlcs_arg = Vec::new(); for mut item in update_fail_htlcs_arg.into_rust().drain(..) { local_update_fail_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
+       let mut local_update_fail_malformed_htlcs_arg = Vec::new(); for mut item in update_fail_malformed_htlcs_arg.into_rust().drain(..) { local_update_fail_malformed_htlcs_arg.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
+       let mut local_update_fee_arg = if update_fee_arg.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(update_fee_arg.take_inner()) } }) };
        CommitmentUpdate { inner: Box::into_raw(Box::new(nativeCommitmentUpdate {
                update_add_htlcs: local_update_add_htlcs_arg,
                update_fulfill_htlcs: local_update_fulfill_htlcs_arg,
                update_fail_htlcs: local_update_fail_htlcs_arg,
                update_fail_malformed_htlcs: local_update_fail_malformed_htlcs_arg,
                update_fee: local_update_fee_arg,
-               commitment_signed: *unsafe { Box::from_raw(commitment_signed_arg.take_ptr()) },
+               commitment_signed: *unsafe { Box::from_raw(commitment_signed_arg.take_inner()) },
        })), is_owned: true }
 }
+impl Clone for CommitmentUpdate {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*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 CommitmentUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn CommitmentUpdate_clone(orig: &CommitmentUpdate) -> CommitmentUpdate {
+       orig.clone()
+}
 /// The information we received from a peer along the route of a payment we originated. This is
 /// returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
 /// RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
@@ -3228,7 +4006,7 @@ impl HTLCFailChannelUpdate {
                        HTLCFailChannelUpdate::ChannelUpdateMessage {ref msg, } => {
                                let mut msg_nonref = (*msg).clone();
                                nativeHTLCFailChannelUpdate::ChannelUpdateMessage {
-                                       msg: *unsafe { Box::from_raw(msg_nonref.take_ptr()) },
+                                       msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
                                }
                        },
                        HTLCFailChannelUpdate::ChannelClosed {ref short_channel_id, ref is_permanent, } => {
@@ -3254,7 +4032,7 @@ impl HTLCFailChannelUpdate {
                match self {
                        HTLCFailChannelUpdate::ChannelUpdateMessage {mut msg, } => {
                                nativeHTLCFailChannelUpdate::ChannelUpdateMessage {
-                                       msg: *unsafe { Box::from_raw(msg.take_ptr()) },
+                                       msg: *unsafe { Box::from_raw(msg.take_inner()) },
                                }
                        },
                        HTLCFailChannelUpdate::ChannelClosed {mut short_channel_id, mut is_permanent, } => {
@@ -3323,6 +4101,10 @@ impl HTLCFailChannelUpdate {
 }
 #[no_mangle]
 pub extern "C" fn HTLCFailChannelUpdate_free(this_ptr: HTLCFailChannelUpdate) { }
+#[no_mangle]
+pub extern "C" fn HTLCFailChannelUpdate_clone(orig: &HTLCFailChannelUpdate) -> HTLCFailChannelUpdate {
+       orig.clone()
+}
 /// A trait to describe an object which can receive channel messages.
 ///
 /// Messages MAY be called in parallel when they originate from different their_node_ids, however
@@ -3462,6 +4244,12 @@ impl Drop for ChannelMessageHandler {
        }
 }
 /// A trait to describe an object which can receive routing messages.
+///
+/// # Implementor DoS Warnings
+///
+/// For `gossip_queries` messages there are potential DoS vectors when handling
+/// inbound queries. Implementors using an on-disk network graph should be aware of
+/// repeated disk I/O for queries accessing different parts of the network graph.
 #[repr(C)]
 pub struct RoutingMessageHandler {
        pub this_arg: *mut c_void,
@@ -3490,29 +4278,55 @@ pub struct RoutingMessageHandler {
        /// If None is provided for starting_point, we start at the first node.
        #[must_use]
        pub get_next_node_announcements: extern "C" fn (this_arg: *const c_void, starting_point: crate::c_types::PublicKey, batch_amount: u8) -> crate::c_types::derived::CVec_NodeAnnouncementZ,
-       /// Returns whether a full sync should be requested from a peer.
+       /// Called when a connection is established with a peer. This can be used to
+       /// perform routing table synchronization using a strategy defined by the
+       /// implementor.
+       pub sync_routing_table: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, init: &crate::ln::msgs::Init),
+       /// Handles the reply of a query we initiated to learn about channels
+       /// for a given range of blocks. We can expect to receive one or more
+       /// replies to a single query.
+       #[must_use]
+       pub handle_reply_channel_range: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::ReplyChannelRange) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
+       /// Handles the reply of a query we initiated asking for routing gossip
+       /// messages for a list of channels. We should receive this message when
+       /// a node has completed its best effort to send us the pertaining routing
+       /// gossip messages.
        #[must_use]
-       pub should_request_full_sync: extern "C" fn (this_arg: *const c_void, node_id: crate::c_types::PublicKey) -> bool,
+       pub handle_reply_short_channel_ids_end: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::ReplyShortChannelIdsEnd) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
+       /// Handles when a peer asks us to send a list of short_channel_ids
+       /// for the requested range of blocks.
+       #[must_use]
+       pub handle_query_channel_range: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::QueryChannelRange) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
+       /// Handles when a peer asks us to send routing gossip messages for a
+       /// list of short_channel_ids.
+       #[must_use]
+       pub handle_query_short_channel_ids: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::QueryShortChannelIds) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
+       pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider,
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for RoutingMessageHandler {}
 unsafe impl Sync for RoutingMessageHandler {}
+impl lightning::util::events::MessageSendEventsProvider for RoutingMessageHandler {
+       fn get_and_clear_pending_msg_events(&self) -> Vec<lightning::util::events::MessageSendEvent> {
+               <crate::util::events::MessageSendEventsProvider as lightning::util::events::MessageSendEventsProvider>::get_and_clear_pending_msg_events(&self.MessageSendEventsProvider)
+       }
+}
 
 use lightning::ln::msgs::RoutingMessageHandler as rustRoutingMessageHandler;
 impl rustRoutingMessageHandler for RoutingMessageHandler {
        fn handle_node_announcement(&self, msg: &lightning::ln::msgs::NodeAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
                let mut ret = (self.handle_node_announcement)(self.this_arg, &crate::ln::msgs::NodeAnnouncement { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
-               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).take_ptr()) } })};
+               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
                local_ret
        }
        fn handle_channel_announcement(&self, msg: &lightning::ln::msgs::ChannelAnnouncement) -> Result<bool, lightning::ln::msgs::LightningError> {
                let mut ret = (self.handle_channel_announcement)(self.this_arg, &crate::ln::msgs::ChannelAnnouncement { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
-               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).take_ptr()) } })};
+               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
                local_ret
        }
        fn handle_channel_update(&self, msg: &lightning::ln::msgs::ChannelUpdate) -> Result<bool, lightning::ln::msgs::LightningError> {
                let mut ret = (self.handle_channel_update)(self.this_arg, &crate::ln::msgs::ChannelUpdate { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false });
-               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).take_ptr()) } })};
+               let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) }) }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
                local_ret
        }
        fn handle_htlc_fail_channel_update(&self, update: &lightning::ln::msgs::HTLCFailChannelUpdate) {
@@ -3520,18 +4334,37 @@ impl rustRoutingMessageHandler for RoutingMessageHandler {
        }
        fn get_next_channel_announcements(&self, starting_point: u64, batch_amount: u8) -> Vec<(lightning::ln::msgs::ChannelAnnouncement, Option<lightning::ln::msgs::ChannelUpdate>, Option<lightning::ln::msgs::ChannelUpdate>)> {
                let mut ret = (self.get_next_channel_announcements)(self.this_arg, starting_point, batch_amount);
-               let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1, mut orig_ret_0_2) = item.to_rust(); let mut local_orig_ret_0_1 = if orig_ret_0_1.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_1.take_ptr()) } }) }; let mut local_orig_ret_0_2 = if orig_ret_0_2.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_2.take_ptr()) } }) }; let mut local_ret_0 = (*unsafe { Box::from_raw(orig_ret_0_0.take_ptr()) }, local_orig_ret_0_1, local_orig_ret_0_2); local_ret_0 }); };
+               let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1, mut orig_ret_0_2) = item.to_rust(); let mut local_orig_ret_0_1 = if orig_ret_0_1.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_1.take_inner()) } }) }; let mut local_orig_ret_0_2 = if orig_ret_0_2.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(orig_ret_0_2.take_inner()) } }) }; let mut local_ret_0 = (*unsafe { Box::from_raw(orig_ret_0_0.take_inner()) }, local_orig_ret_0_1, local_orig_ret_0_2); local_ret_0 }); };
                local_ret
        }
        fn get_next_node_announcements(&self, starting_point: Option<&bitcoin::secp256k1::key::PublicKey>, batch_amount: u8) -> Vec<lightning::ln::msgs::NodeAnnouncement> {
                let mut local_starting_point = if starting_point.is_none() { crate::c_types::PublicKey::null() } else {  { crate::c_types::PublicKey::from_rust(&(starting_point.unwrap())) } };
                let mut ret = (self.get_next_node_announcements)(self.this_arg, local_starting_point, batch_amount);
-               let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { *unsafe { Box::from_raw(item.take_ptr()) } }); };
+               let mut local_ret = Vec::new(); for mut item in ret.into_rust().drain(..) { local_ret.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
                local_ret
        }
-       fn should_request_full_sync(&self, node_id: &bitcoin::secp256k1::key::PublicKey) -> bool {
-               let mut ret = (self.should_request_full_sync)(self.this_arg, crate::c_types::PublicKey::from_rust(&node_id));
-               ret
+       fn sync_routing_table(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, init: &lightning::ln::msgs::Init) {
+               (self.sync_routing_table)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::Init { inner: unsafe { (init as *const _) as *mut _ }, is_owned: false })
+       }
+       fn handle_reply_channel_range(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::ReplyChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
+               let mut ret = (self.handle_reply_channel_range)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true });
+               let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
+               local_ret
+       }
+       fn handle_reply_short_channel_ids_end(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::ReplyShortChannelIdsEnd) -> Result<(), lightning::ln::msgs::LightningError> {
+               let mut ret = (self.handle_reply_short_channel_ids_end)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::ln::msgs::ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(msg)), is_owned: true });
+               let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
+               local_ret
+       }
+       fn handle_query_channel_range(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::QueryChannelRange) -> Result<(), lightning::ln::msgs::LightningError> {
+               let mut ret = (self.handle_query_channel_range)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::ln::msgs::QueryChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true });
+               let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
+               local_ret
+       }
+       fn handle_query_short_channel_ids(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: lightning::ln::msgs::QueryShortChannelIds) -> Result<(), lightning::ln::msgs::LightningError> {
+               let mut ret = (self.handle_query_short_channel_ids)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg)), is_owned: true });
+               let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.result)) })*/ }), false => Err( { *unsafe { Box::from_raw((*unsafe { Box::from_raw(<*mut _>::take_ptr(&mut ret.contents.err)) }).take_inner()) } })};
+               local_ret
        }
 }
 
@@ -3554,314 +4387,436 @@ impl Drop for RoutingMessageHandler {
        }
 }
 #[no_mangle]
-pub extern "C" fn AcceptChannel_write(obj: *const AcceptChannel) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn AcceptChannel_write(obj: &AcceptChannel) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> AcceptChannel {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               AcceptChannel { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               AcceptChannel { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn AcceptChannel_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAcceptChannel) })
 }
 #[no_mangle]
-pub extern "C" fn AnnouncementSignatures_write(obj: *const AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn AcceptChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AcceptChannelDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AcceptChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> AnnouncementSignatures {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               AnnouncementSignatures { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               AnnouncementSignatures { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn AnnouncementSignatures_write(obj: &AnnouncementSignatures) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn ChannelReestablish_write(obj: *const ChannelReestablish) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn AnnouncementSignatures_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeAnnouncementSignatures) })
 }
 #[no_mangle]
-pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> ChannelReestablish {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               ChannelReestablish { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               ChannelReestablish { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn AnnouncementSignatures_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_AnnouncementSignaturesDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::AnnouncementSignatures { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn ClosingSigned_write(obj: *const ClosingSigned) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn ChannelReestablish_write(obj: &ChannelReestablish) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> ClosingSigned {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               ClosingSigned { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               ClosingSigned { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn ChannelReestablish_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelReestablish) })
 }
 #[no_mangle]
-pub extern "C" fn CommitmentSigned_write(obj: *const CommitmentSigned) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn ChannelReestablish_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelReestablishDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelReestablish { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> CommitmentSigned {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               CommitmentSigned { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               CommitmentSigned { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn ClosingSigned_write(obj: &ClosingSigned) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn FundingCreated_write(obj: *const FundingCreated) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn ClosingSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeClosingSigned) })
 }
 #[no_mangle]
-pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> FundingCreated {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               FundingCreated { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               FundingCreated { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn ClosingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ClosingSignedDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ClosingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn FundingSigned_write(obj: *const FundingSigned) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn CommitmentSigned_write(obj: &CommitmentSigned) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> FundingSigned {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               FundingSigned { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               FundingSigned { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn CommitmentSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeCommitmentSigned) })
 }
 #[no_mangle]
-pub extern "C" fn FundingLocked_write(obj: *const FundingLocked) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn CommitmentSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_CommitmentSignedDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::CommitmentSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> FundingLocked {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               FundingLocked { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               FundingLocked { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn FundingCreated_write(obj: &FundingCreated) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn Init_write(obj: *const Init) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn FundingCreated_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingCreated) })
 }
 #[no_mangle]
-pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> Init {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               Init { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               Init { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn FundingCreated_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingCreatedDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingCreated { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn OpenChannel_write(obj: *const OpenChannel) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn FundingSigned_write(obj: &FundingSigned) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> OpenChannel {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               OpenChannel { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               OpenChannel { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn FundingSigned_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingSigned) })
 }
 #[no_mangle]
-pub extern "C" fn RevokeAndACK_write(obj: *const RevokeAndACK) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn FundingSigned_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingSignedDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingSigned { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> RevokeAndACK {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               RevokeAndACK { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               RevokeAndACK { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn FundingLocked_write(obj: &FundingLocked) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn Shutdown_write(obj: *const Shutdown) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn FundingLocked_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeFundingLocked) })
 }
 #[no_mangle]
-pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> Shutdown {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               Shutdown { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               Shutdown { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn FundingLocked_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_FundingLockedDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::FundingLocked { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UpdateFailHTLC_write(obj: *const UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn Init_write(obj: &Init) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> UpdateFailHTLC {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UpdateFailHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UpdateFailHTLC { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn Init_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeInit) })
 }
 #[no_mangle]
-pub extern "C" fn UpdateFailMalformedHTLC_write(obj: *const UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn Init_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_InitDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Init { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> UpdateFailMalformedHTLC {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UpdateFailMalformedHTLC { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn OpenChannel_write(obj: &OpenChannel) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn UpdateFee_write(obj: *const UpdateFee) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn OpenChannel_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOpenChannel) })
 }
 #[no_mangle]
-pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> UpdateFee {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UpdateFee { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UpdateFee { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn OpenChannel_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OpenChannelDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::OpenChannel { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UpdateFulfillHTLC_write(obj: *const UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn RevokeAndACK_write(obj: &RevokeAndACK) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> UpdateFulfillHTLC {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UpdateFulfillHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UpdateFulfillHTLC { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn RevokeAndACK_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeRevokeAndACK) })
 }
 #[no_mangle]
-pub extern "C" fn UpdateAddHTLC_write(obj: *const UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn RevokeAndACK_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_RevokeAndACKDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::RevokeAndACK { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> UpdateAddHTLC {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UpdateAddHTLC { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UpdateAddHTLC { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn Shutdown_write(obj: &Shutdown) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn Ping_write(obj: *const Ping) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn Shutdown_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeShutdown) })
 }
 #[no_mangle]
-pub extern "C" fn Ping_read(ser: crate::c_types::u8slice) -> Ping {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               Ping { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               Ping { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn Shutdown_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ShutdownDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Shutdown { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn Pong_write(obj: *const Pong) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateFailHTLC_write(obj: &UpdateFailHTLC) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn Pong_read(ser: crate::c_types::u8slice) -> Pong {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               Pong { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               Pong { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn UpdateFailHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailHTLC) })
 }
 #[no_mangle]
-pub extern "C" fn UnsignedChannelAnnouncement_write(obj: *const UnsignedChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateFailHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailHTLCDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) -> UnsignedChannelAnnouncement {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UnsignedChannelAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UnsignedChannelAnnouncement { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn UpdateFailMalformedHTLC_write(obj: &UpdateFailMalformedHTLC) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn ChannelAnnouncement_write(obj: *const ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn UpdateFailMalformedHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFailMalformedHTLC) })
 }
 #[no_mangle]
-pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> ChannelAnnouncement {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               ChannelAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               ChannelAnnouncement { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn UpdateFailMalformedHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFailMalformedHTLCDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_write(obj: *const UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateFee_write(obj: &UpdateFee) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> UnsignedChannelUpdate {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UnsignedChannelUpdate { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UnsignedChannelUpdate { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn UpdateFee_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFee) })
 }
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_write(obj: *const ChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateFee_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFeeDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFee { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> ChannelUpdate {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               ChannelUpdate { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               ChannelUpdate { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn UpdateFulfillHTLC_write(obj: &UpdateFulfillHTLC) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn ErrorMessage_write(obj: *const ErrorMessage) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub(crate) extern "C" fn UpdateFulfillHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateFulfillHTLC) })
 }
 #[no_mangle]
-pub extern "C" fn ErrorMessage_read(ser: crate::c_types::u8slice) -> ErrorMessage {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               ErrorMessage { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               ErrorMessage { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn UpdateFulfillHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateFulfillHTLCDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateFulfillHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn UnsignedNodeAnnouncement_write(obj: *const UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateAddHTLC_write(obj: &UpdateAddHTLC) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
 }
 #[no_mangle]
-pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> UnsignedNodeAnnouncement {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               UnsignedNodeAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               UnsignedNodeAnnouncement { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub(crate) extern "C" fn UpdateAddHTLC_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUpdateAddHTLC) })
 }
 #[no_mangle]
-pub extern "C" fn NodeAnnouncement_write(obj: *const NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
-       crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
+pub extern "C" fn UpdateAddHTLC_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UpdateAddHTLCDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UpdateAddHTLC { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
 }
 #[no_mangle]
-pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> NodeAnnouncement {
-       if let Ok(res) = crate::c_types::deserialize_obj(ser) {
-               NodeAnnouncement { inner: Box::into_raw(Box::new(res)), is_owned: true }
-       } else {
-               NodeAnnouncement { inner: std::ptr::null_mut(), is_owned: true }
-       }
+pub extern "C" fn Ping_write(obj: &Ping) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn Ping_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePing) })
+}
+#[no_mangle]
+pub extern "C" fn Ping_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PingDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Ping { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn Pong_write(obj: &Pong) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn Pong_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativePong) })
+}
+#[no_mangle]
+pub extern "C" fn Pong_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_PongDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::Pong { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_write(obj: &UnsignedChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn UnsignedChannelAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedChannelAnnouncement) })
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelAnnouncementDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedChannelAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn ChannelAnnouncement_write(obj: &ChannelAnnouncement) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn ChannelAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelAnnouncement) })
+}
+#[no_mangle]
+pub extern "C" fn ChannelAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelAnnouncementDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_write(obj: &UnsignedChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn UnsignedChannelUpdate_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedChannelUpdate) })
+}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedChannelUpdateDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedChannelUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_write(obj: &ChannelUpdate) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn ChannelUpdate_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeChannelUpdate) })
+}
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ChannelUpdateDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn ErrorMessage_write(obj: &ErrorMessage) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn ErrorMessage_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeErrorMessage) })
+}
+#[no_mangle]
+pub extern "C" fn ErrorMessage_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ErrorMessageDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ErrorMessage { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_write(obj: &UnsignedNodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn UnsignedNodeAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeUnsignedNodeAnnouncement) })
+}
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_UnsignedNodeAnnouncementDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::UnsignedNodeAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn NodeAnnouncement_write(obj: &NodeAnnouncement) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn NodeAnnouncement_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeNodeAnnouncement) })
+}
+#[no_mangle]
+pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_NodeAnnouncementDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::NodeAnnouncement { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryShortChannelIdsDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_write(obj: &QueryShortChannelIds) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn QueryShortChannelIds_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeQueryShortChannelIds) })
+}
+#[no_mangle]
+pub extern "C" fn ReplyShortChannelIdsEnd_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyShortChannelIdsEndDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: &ReplyShortChannelIdsEnd) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn ReplyShortChannelIdsEnd_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReplyShortChannelIdsEnd) })
+}
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_QueryChannelRangeDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::QueryChannelRange { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_write(obj: &QueryChannelRange) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn QueryChannelRange_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeQueryChannelRange) })
+}
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_ReplyChannelRangeDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_write(obj: &ReplyChannelRange) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn ReplyChannelRange_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeReplyChannelRange) })
+}
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_GossipTimestampFilterDecodeErrorZ {
+       let res = crate::c_types::deserialize_obj(ser);
+       let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::msgs::GossipTimestampFilter { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::ln::msgs::DecodeError { inner: Box::into_raw(Box::new(e)), is_owned: true } }).into() };
+       local_res
+}
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_write(obj: &GossipTimestampFilter) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*unsafe { &*obj }.inner })
+}
+#[no_mangle]
+pub(crate) extern "C" fn GossipTimestampFilter_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+       crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeGossipTimestampFilter) })
 }