@@ -60,7 +60,7 @@ use crate::ln::wire::Encode;
60
60
use crate::offers::invoice::{BlindedPayInfo, Bolt12Invoice, DEFAULT_RELATIVE_EXPIRY, DerivedSigningPubkey, InvoiceBuilder};
61
61
use crate::offers::invoice_error::InvoiceError;
62
62
use crate::offers::merkle::SignError;
63
- use crate::offers::offer::{DerivedMetadata, Offer, OfferBuilder} ;
63
+ use crate::offers::offer::Offer;
64
64
use crate::offers::parse::Bolt12SemanticError;
65
65
use crate::offers::refund::{Refund, RefundBuilder};
66
66
use crate::onion_message::messenger::{Destination, MessageRouter, PendingOnionMessage, new_pending_onion_message};
@@ -98,6 +98,12 @@ use core::ops::Deref;
98
98
pub use crate::ln::outbound_payment::{PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
99
99
use crate::ln::script::ShutdownScript;
100
100
101
+ #[cfg(not(c_bindings))]
102
+ type OfferBuilder<'a> =
103
+ crate::offers::offer::OfferBuilder<'a, crate::offers::offer::DerivedMetadata, secp256k1::All>;
104
+ #[cfg(c_bindings)]
105
+ type OfferBuilder<'a> = crate::offers::offer::OfferWithDerivedMetadataBuilder;
106
+
101
107
// We hold various information about HTLC relay in the HTLC objects in Channel itself:
102
108
//
103
109
// Upon receipt of an HTLC from a peer, we'll give it a PendingHTLCStatus indicating if it should
@@ -7550,20 +7556,32 @@ where
7550
7556
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
7551
7557
pub fn create_offer_builder(
7552
7558
&self, description: String
7553
- ) -> Result<OfferBuilder<DerivedMetadata, secp256k1::All> , Bolt12SemanticError> {
7559
+ ) -> Result<OfferBuilder, Bolt12SemanticError> {
7554
7560
let node_id = self.get_our_node_id();
7555
7561
let expanded_key = &self.inbound_payment_key;
7556
7562
let entropy = &*self.entropy_source;
7557
- let secp_ctx = &self.secp_ctx;
7558
7563
7559
7564
let path = self.create_blinded_path().map_err(|_| Bolt12SemanticError::MissingPaths)?;
7560
- let builder = OfferBuilder::deriving_signing_pubkey(
7561
- description, node_id, expanded_key, entropy, secp_ctx
7562
- )
7563
- .chain_hash(self.chain_hash)
7564
- .path(path);
7565
7565
7566
- Ok(builder)
7566
+ #[cfg(not(c_bindings))] {
7567
+ let builder = OfferBuilder::deriving_signing_pubkey(
7568
+ description, node_id, expanded_key, entropy, &self.secp_ctx
7569
+ )
7570
+ .chain_hash(self.chain_hash)
7571
+ .path(path);
7572
+
7573
+ Ok(builder)
7574
+ }
7575
+
7576
+ #[cfg(c_bindings)] {
7577
+ let mut builder = OfferBuilder::deriving_signing_pubkey(
7578
+ description, node_id, expanded_key, entropy, &self.secp_ctx
7579
+ );
7580
+ builder.chain_hash(self.chain_hash);
7581
+ builder.path(path);
7582
+
7583
+ Ok(builder)
7584
+ }
7567
7585
}
7568
7586
7569
7587
/// Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the
0 commit comments