+use lightning::offers::offer::OfferId as nativeOfferIdImport;
+pub(crate) type nativeOfferId = nativeOfferIdImport;
+
+/// An identifier for an [`Offer`] built using [`DerivedMetadata`].
+#[must_use]
+#[repr(C)]
+pub struct OfferId {
+ /// A pointer to the opaque Rust object.
+
+ /// 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 nativeOfferId,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for OfferId {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeOfferId>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+ }
+ }
+}
+/// Frees any resources used by the OfferId, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn OfferId_free(this_obj: OfferId) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferId_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferId) };
+}
+#[allow(unused)]
+impl OfferId {
+ pub(crate) fn get_native_ref(&self) -> &'static nativeOfferId {
+ unsafe { &*ObjOps::untweak_ptr(self.inner) }
+ }
+ pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferId {
+ unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
+ }
+ /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+ pub(crate) fn take_inner(mut self) -> *mut nativeOfferId {
+ assert!(self.is_owned);
+ let ret = ObjOps::untweak_ptr(self.inner);
+ self.inner = core::ptr::null_mut();
+ ret
+ }
+}
+#[no_mangle]
+pub extern "C" fn OfferId_get_a(this_ptr: &OfferId) -> *const [u8; 32] {
+ let mut inner_val = &mut this_ptr.get_native_mut_ref().0;
+ inner_val
+}
+#[no_mangle]
+pub extern "C" fn OfferId_set_a(this_ptr: &mut OfferId, mut val: crate::c_types::ThirtyTwoBytes) {
+ unsafe { &mut *ObjOps::untweak_ptr(this_ptr.inner) }.0 = val.data;
+}
+/// Constructs a new OfferId given each field
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferId_new(mut a_arg: crate::c_types::ThirtyTwoBytes) -> OfferId {
+ OfferId { inner: ObjOps::heap_alloc(lightning::offers::offer::OfferId (
+ a_arg.data,
+ )), is_owned: true }
+}
+impl Clone for OfferId {
+ fn clone(&self) -> Self {
+ Self {
+ inner: if <*mut nativeOfferId>::is_null(self.inner) { core::ptr::null_mut() } else {
+ ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferId_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferId)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the OfferId
+pub extern "C" fn OfferId_clone(orig: &OfferId) -> OfferId {
+ orig.clone()
+}
+/// Get a string which allows debug introspection of a OfferId object
+pub extern "C" fn OfferId_debug_str_void(o: *const c_void) -> Str {
+ alloc::format!("{:?}", unsafe { o as *const crate::lightning::offers::offer::OfferId }).into()}
+/// Checks if two OfferIds contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+/// Two objects with NULL inner values will be considered "equal" here.
+#[no_mangle]
+pub extern "C" fn OfferId_eq(a: &OfferId, b: &OfferId) -> bool {
+ if a.inner == b.inner { return true; }
+ if a.inner.is_null() || b.inner.is_null() { return false; }
+ if a.get_native_ref() == b.get_native_ref() { true } else { false }
+}
+#[no_mangle]
+/// Serialize the OfferId object into a byte array which can be read by OfferId_read
+pub extern "C" fn OfferId_write(obj: &crate::lightning::offers::offer::OfferId) -> crate::c_types::derived::CVec_u8Z {
+ crate::c_types::serialize_obj(unsafe { &*obj }.get_native_ref())
+}
+#[allow(unused)]
+pub(crate) extern "C" fn OfferId_write_void(obj: *const c_void) -> crate::c_types::derived::CVec_u8Z {
+ crate::c_types::serialize_obj(unsafe { &*(obj as *const nativeOfferId) })
+}
+#[no_mangle]
+/// Read a OfferId from a byte array, created by OfferId_write
+pub extern "C" fn OfferId_read(ser: crate::c_types::u8slice) -> crate::c_types::derived::CResult_OfferIdDecodeErrorZ {
+ let res: Result<lightning::offers::offer::OfferId, lightning::ln::msgs::DecodeError> = crate::c_types::deserialize_obj(ser);
+ let mut local_res = match res { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::offers::offer::OfferId { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::ln::msgs::DecodeError::native_into(e) }).into() };
+ local_res
+}
+
+use lightning::offers::offer::OfferWithExplicitMetadataBuilder as nativeOfferWithExplicitMetadataBuilderImport;
+pub(crate) type nativeOfferWithExplicitMetadataBuilder = nativeOfferWithExplicitMetadataBuilderImport<'static, >;
+
+/// Builds an [`Offer`] for the \"offer to be paid\" flow.
+///
+/// See [module-level documentation] for usage.
+///
+/// [module-level documentation]: self
+#[must_use]
+#[repr(C)]
+pub struct OfferWithExplicitMetadataBuilder {
+ /// A pointer to the opaque Rust object.
+
+ /// 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 nativeOfferWithExplicitMetadataBuilder,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for OfferWithExplicitMetadataBuilder {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeOfferWithExplicitMetadataBuilder>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+ }
+ }
+}
+/// Frees any resources used by the OfferWithExplicitMetadataBuilder, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_free(this_obj: OfferWithExplicitMetadataBuilder) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferWithExplicitMetadataBuilder_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferWithExplicitMetadataBuilder) };
+}
+#[allow(unused)]
+impl OfferWithExplicitMetadataBuilder {
+ pub(crate) fn get_native_ref(&self) -> &'static nativeOfferWithExplicitMetadataBuilder {
+ unsafe { &*ObjOps::untweak_ptr(self.inner) }
+ }
+ pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferWithExplicitMetadataBuilder {
+ unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
+ }
+ /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+ pub(crate) fn take_inner(mut self) -> *mut nativeOfferWithExplicitMetadataBuilder {
+ assert!(self.is_owned);
+ let ret = ObjOps::untweak_ptr(self.inner);
+ self.inner = core::ptr::null_mut();
+ ret
+ }
+}
+impl Clone for OfferWithExplicitMetadataBuilder {
+ fn clone(&self) -> Self {
+ Self {
+ inner: if <*mut nativeOfferWithExplicitMetadataBuilder>::is_null(self.inner) { core::ptr::null_mut() } else {
+ ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferWithExplicitMetadataBuilder_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferWithExplicitMetadataBuilder)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the OfferWithExplicitMetadataBuilder
+pub extern "C" fn OfferWithExplicitMetadataBuilder_clone(orig: &OfferWithExplicitMetadataBuilder) -> OfferWithExplicitMetadataBuilder {
+ orig.clone()
+}
+
+use lightning::offers::offer::OfferWithDerivedMetadataBuilder as nativeOfferWithDerivedMetadataBuilderImport;
+pub(crate) type nativeOfferWithDerivedMetadataBuilder = nativeOfferWithDerivedMetadataBuilderImport<'static, >;
+
+/// Builds an [`Offer`] for the \"offer to be paid\" flow.
+///
+/// See [module-level documentation] for usage.
+///
+/// [module-level documentation]: self
+#[must_use]
+#[repr(C)]
+pub struct OfferWithDerivedMetadataBuilder {
+ /// A pointer to the opaque Rust object.
+
+ /// 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 nativeOfferWithDerivedMetadataBuilder,
+ /// Indicates that this is the only struct which contains the same pointer.
+
+ /// Rust functions which take ownership of an object provided via an argument require
+ /// this to be true and invalidate the object pointed to by inner.
+ pub is_owned: bool,
+}
+
+impl Drop for OfferWithDerivedMetadataBuilder {
+ fn drop(&mut self) {
+ if self.is_owned && !<*mut nativeOfferWithDerivedMetadataBuilder>::is_null(self.inner) {
+ let _ = unsafe { Box::from_raw(ObjOps::untweak_ptr(self.inner)) };
+ }
+ }
+}
+/// Frees any resources used by the OfferWithDerivedMetadataBuilder, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_free(this_obj: OfferWithDerivedMetadataBuilder) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferWithDerivedMetadataBuilder_free_void(this_ptr: *mut c_void) {
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeOfferWithDerivedMetadataBuilder) };
+}
+#[allow(unused)]
+impl OfferWithDerivedMetadataBuilder {
+ pub(crate) fn get_native_ref(&self) -> &'static nativeOfferWithDerivedMetadataBuilder {
+ unsafe { &*ObjOps::untweak_ptr(self.inner) }
+ }
+ pub(crate) fn get_native_mut_ref(&self) -> &'static mut nativeOfferWithDerivedMetadataBuilder {
+ unsafe { &mut *ObjOps::untweak_ptr(self.inner) }
+ }
+ /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+ pub(crate) fn take_inner(mut self) -> *mut nativeOfferWithDerivedMetadataBuilder {
+ assert!(self.is_owned);
+ let ret = ObjOps::untweak_ptr(self.inner);
+ self.inner = core::ptr::null_mut();
+ ret
+ }
+}
+impl Clone for OfferWithDerivedMetadataBuilder {
+ fn clone(&self) -> Self {
+ Self {
+ inner: if <*mut nativeOfferWithDerivedMetadataBuilder>::is_null(self.inner) { core::ptr::null_mut() } else {
+ ObjOps::heap_alloc(unsafe { &*ObjOps::untweak_ptr(self.inner) }.clone()) },
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn OfferWithDerivedMetadataBuilder_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *const nativeOfferWithDerivedMetadataBuilder)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the OfferWithDerivedMetadataBuilder
+pub extern "C" fn OfferWithDerivedMetadataBuilder_clone(orig: &OfferWithDerivedMetadataBuilder) -> OfferWithDerivedMetadataBuilder {
+ orig.clone()
+}
+/// Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices.
+/// The associated secret key must be remembered while the offer is valid.
+///
+/// Use a different pubkey per offer to avoid correlating offers.
+///
+/// # Note
+///
+/// If constructing an [`Offer`] for use with a [`ChannelManager`], use
+/// [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`].
+///
+/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+/// [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_new(mut signing_pubkey: crate::c_types::PublicKey) -> crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder {
+ let mut ret = lightning::offers::offer::OfferWithExplicitMetadataBuilder::new(signing_pubkey.into_rust());
+ crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Sets the [`Offer::metadata`] to the given bytes.
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_metadata(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut metadata: crate::c_types::derived::CVec_u8Z) -> crate::c_types::derived::CResult_NoneBolt12SemanticErrorZ {
+ let mut local_metadata = Vec::new(); for mut item in metadata.into_rust().drain(..) { local_metadata.push( { item }); };
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).metadata(local_metadata);
+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { () /*o*/ }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::offers::parse::Bolt12SemanticError::native_into(e) }).into() };
+ local_ret
+}
+
+/// Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
+/// the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
+///
+/// See [`Offer::chains`] on how this relates to the payment currency.
+///
+/// Successive calls to this method will add another chain hash.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_chain(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut network: crate::bitcoin::network::Network) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).chain(network.into_bitcoin());
+ () /*ret*/
+}
+
+/// Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_amount_msats(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut amount_msats: u64) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).amount_msats(amount_msats);
+ () /*ret*/
+}
+
+/// Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
+/// already passed is valid and can be checked for using [`Offer::is_expired`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_absolute_expiry(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut absolute_expiry: u64) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).absolute_expiry(core::time::Duration::from_secs(absolute_expiry));
+ () /*ret*/
+}
+
+/// Sets the [`Offer::description`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_description(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut description: crate::c_types::Str) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).description(description.into_string());
+ () /*ret*/
+}
+
+/// Sets the [`Offer::issuer`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_issuer(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut issuer: crate::c_types::Str) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).issuer(issuer.into_string());
+ () /*ret*/
+}
+
+/// Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
+/// private channels or if [`Offer::signing_pubkey`] is not a public node id.
+///
+/// Successive calls to this method will add another blinded path. Caller is responsible for not
+/// adding duplicate paths.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_path(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut path: crate::lightning::blinded_path::BlindedPath) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).path(*unsafe { Box::from_raw(path.take_inner()) });
+ () /*ret*/
+}
+
+/// Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
+/// [`Quantity::One`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_supported_quantity(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder, mut quantity: crate::lightning::offers::offer::Quantity) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).supported_quantity(quantity.into_native());
+ () /*ret*/
+}
+
+/// Builds an [`Offer`] from the builder's settings.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithExplicitMetadataBuilder_build(mut this_arg: crate::lightning::offers::offer::OfferWithExplicitMetadataBuilder) -> crate::c_types::derived::CResult_OfferBolt12SemanticErrorZ {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).build();
+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::offers::offer::Offer { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::offers::parse::Bolt12SemanticError::native_into(e) }).into() };
+ local_ret
+}
+
+/// Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing
+/// pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides
+/// recipient privacy by using a different signing pubkey for each offer. Otherwise, the
+/// provided `node_id` is used for the signing pubkey.
+///
+/// Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by
+/// [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an
+/// [`ExpandedKey`].
+///
+/// [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify
+/// [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(mut node_id: crate::c_types::PublicKey, expanded_key: &crate::lightning::ln::inbound_payment::ExpandedKey, mut entropy_source: crate::lightning::sign::EntropySource) -> crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder {
+ let mut ret = lightning::offers::offer::OfferWithDerivedMetadataBuilder::deriving_signing_pubkey(node_id.into_rust(), expanded_key.get_native_ref(), entropy_source, secp256k1::global::SECP256K1);
+ crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder { inner: ObjOps::heap_alloc(ret), is_owned: true }
+}
+
+/// Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called,
+/// the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported.
+///
+/// See [`Offer::chains`] on how this relates to the payment currency.
+///
+/// Successive calls to this method will add another chain hash.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_chain(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut network: crate::bitcoin::network::Network) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).chain(network.into_bitcoin());
+ () /*ret*/
+}
+
+/// Sets the [`Offer::amount`] as an [`Amount::Bitcoin`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_amount_msats(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut amount_msats: u64) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).amount_msats(amount_msats);
+ () /*ret*/
+}
+
+/// Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has
+/// already passed is valid and can be checked for using [`Offer::is_expired`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_absolute_expiry(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut absolute_expiry: u64) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).absolute_expiry(core::time::Duration::from_secs(absolute_expiry));
+ () /*ret*/
+}
+
+/// Sets the [`Offer::description`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_description(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut description: crate::c_types::Str) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).description(description.into_string());
+ () /*ret*/
+}
+
+/// Sets the [`Offer::issuer`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_issuer(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut issuer: crate::c_types::Str) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).issuer(issuer.into_string());
+ () /*ret*/
+}
+
+/// Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by
+/// private channels or if [`Offer::signing_pubkey`] is not a public node id.
+///
+/// Successive calls to this method will add another blinded path. Caller is responsible for not
+/// adding duplicate paths.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_path(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut path: crate::lightning::blinded_path::BlindedPath) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).path(*unsafe { Box::from_raw(path.take_inner()) });
+ () /*ret*/
+}
+
+/// Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
+/// [`Quantity::One`].
+///
+/// Successive calls to this method will override the previous setting.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_supported_quantity(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder, mut quantity: crate::lightning::offers::offer::Quantity) {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).supported_quantity(quantity.into_native());
+ () /*ret*/
+}
+
+/// Builds an [`Offer`] from the builder's settings.
+#[must_use]
+#[no_mangle]
+pub extern "C" fn OfferWithDerivedMetadataBuilder_build(mut this_arg: crate::lightning::offers::offer::OfferWithDerivedMetadataBuilder) -> crate::c_types::derived::CResult_OfferBolt12SemanticErrorZ {
+ let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).build();
+ let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning::offers::offer::Offer { inner: ObjOps::heap_alloc(o), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning::offers::parse::Bolt12SemanticError::native_into(e) }).into() };
+ local_ret
+}
+
+