@@ -10378,9 +10378,21 @@ where
10378
10378
#[cfg(c_bindings)]
10379
10379
create_refund_builder!(self, RefundMaybeWithDerivedMetadataBuilder);
10380
10380
10381
+ /// Retrieve our cached [`Offer`]s for receiving async payments as an often-offline recipient.
10382
+ /// Will only be set if [`UserConfig::paths_to_static_invoice_server`] is set and we succeeded in
10383
+ /// interactively building a [`StaticInvoice`] with the static invoice server.
10384
+ #[cfg(async_payments)]
10385
+ pub fn get_cached_async_receive_offers(&self) -> Vec<Offer> {
10386
+ self.flow.get_cached_async_receive_offers()
10387
+ }
10388
+
10381
10389
/// Create an offer for receiving async payments as an often-offline recipient.
10382
10390
///
10383
- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
10391
+ /// Instead of using this method, it is preferable to set
10392
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10393
+ /// [`Self::get_cached_async_receive_offers`].
10394
+ ///
10395
+ /// If you want to build the [`StaticInvoice`] manually using this method instead, you MUST:
10384
10396
/// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
10385
10397
/// serve the [`StaticInvoice`] created from this offer on our behalf.
10386
10398
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
@@ -10396,6 +10408,10 @@ where
10396
10408
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
10397
10409
/// created via [`Self::create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
10398
10410
/// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
10411
+ ///
10412
+ /// Instead of using this method to manually build the invoice, it is preferable to set
10413
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10414
+ /// [`Self::get_cached_async_receive_offers`].
10399
10415
#[cfg(async_payments)]
10400
10416
pub fn create_static_invoice_builder<'a>(
10401
10417
&self, offer: &'a Offer, offer_nonce: Nonce, relative_expiry: Option<Duration>
0 commit comments