@@ -88,7 +88,7 @@ use crate::util::logger::{Level, Logger, WithContext};
8888use crate::util::errors::APIError;
8989#[cfg(async_payments)] use {
9090 crate::blinded_path::payment::AsyncBolt12OfferContext,
91- crate::offers::offer::{ Amount, DerivedMetadata, OfferBuilder} ,
91+ crate::offers::offer::Amount,
9292 crate::offers::static_invoice::{DEFAULT_RELATIVE_EXPIRY as STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY, StaticInvoice, StaticInvoiceBuilder},
9393};
9494
@@ -9678,43 +9678,11 @@ where
96789678 MR::Target: MessageRouter,
96799679 L::Target: Logger,
96809680{
9681-
9682- /// Create an offer for receiving async payments as an often-offline recipient.
9683- ///
9684- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
9685- /// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
9686- /// serve the [`StaticInvoice`] created from this offer on our behalf.
9687- /// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
9688- /// [`Offer`] plus the returned [`Nonce`], and provide the static invoice to the
9689- /// aforementioned always-online node.
9690- #[cfg(async_payments)]
9691- pub fn create_async_receive_offer_builder(
9692- &self, message_paths_to_always_online_node: Vec<BlindedMessagePath>
9693- ) -> Result<(OfferBuilder<DerivedMetadata, secp256k1::All>, Nonce), Bolt12SemanticError> {
9694- if message_paths_to_always_online_node.is_empty() {
9695- return Err(Bolt12SemanticError::MissingPaths)
9696- }
9697-
9698- let node_id = self.get_our_node_id();
9699- let expanded_key = &self.inbound_payment_key;
9700- let entropy = &*self.entropy_source;
9701- let secp_ctx = &self.secp_ctx;
9702-
9703- let nonce = Nonce::from_entropy_source(entropy);
9704- let mut builder = OfferBuilder::deriving_signing_pubkey(
9705- node_id, expanded_key, nonce, secp_ctx
9706- ).chain_hash(self.chain_hash);
9707-
9708- for path in message_paths_to_always_online_node {
9709- builder = builder.path(path);
9710- }
9711-
9712- Ok((builder.into(), nonce))
9713- }
9714-
97159681 /// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
9716- /// created via [`Self:: create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
9682+ /// created via [`create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
97179683 /// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
9684+ ///
9685+ /// [`create_async_receive_offer_builder`]: crate::offers::flow::create_async_receive_offer_builder
97189686 #[cfg(async_payments)]
97199687 pub fn create_static_invoice_builder<'a>(
97209688 &self, offer: &'a Offer, offer_nonce: Nonce, relative_expiry: Option<Duration>
0 commit comments