@@ -10308,9 +10308,21 @@ where
10308
10308
#[cfg(c_bindings)]
10309
10309
create_refund_builder!(self, RefundMaybeWithDerivedMetadataBuilder);
10310
10310
10311
+ /// Retrieve our cached [`Offer`]s for receiving async payments as an often-offline recipient.
10312
+ /// Will only be set if [`UserConfig::paths_to_static_invoice_server`] is set and we succeeded in
10313
+ /// interactively building a [`StaticInvoice`] with the static invoice server.
10314
+ #[cfg(async_payments)]
10315
+ pub fn get_cached_async_receive_offers(&self) -> Vec<Offer> {
10316
+ self.flow.get_cached_async_receive_offers()
10317
+ }
10318
+
10311
10319
/// Create an offer for receiving async payments as an often-offline recipient.
10312
10320
///
10313
- /// Because we may be offline when the payer attempts to request an invoice, you MUST:
10321
+ /// Instead of using this method, it is preferable to set
10322
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10323
+ /// [`Self::get_cached_async_receive_offers`].
10324
+ ///
10325
+ /// If you want to build the [`StaticInvoice`] manually using this method instead, you MUST:
10314
10326
/// 1. Provide at least 1 [`BlindedMessagePath`] terminating at an always-online node that will
10315
10327
/// serve the [`StaticInvoice`] created from this offer on our behalf.
10316
10328
/// 2. Use [`Self::create_static_invoice_builder`] to create a [`StaticInvoice`] from this
@@ -10338,6 +10350,10 @@ where
10338
10350
/// Creates a [`StaticInvoiceBuilder`] from the corresponding [`Offer`] and [`Nonce`] that were
10339
10351
/// created via [`Self::create_async_receive_offer_builder`]. If `relative_expiry` is unset, the
10340
10352
/// invoice's expiry will default to [`STATIC_INVOICE_DEFAULT_RELATIVE_EXPIRY`].
10353
+ ///
10354
+ /// Instead of using this method to manually build the invoice, it is preferable to set
10355
+ /// [`UserConfig::paths_to_static_invoice_server`] and retrieve the automatically built offer via
10356
+ /// [`Self::get_cached_async_receive_offers`].
10341
10357
#[cfg(async_payments)]
10342
10358
pub fn create_static_invoice_builder<'a>(
10343
10359
&'a self, offer: &'a Offer, offer_nonce: Nonce, relative_expiry: Option<Duration>
0 commit comments