Skip to content

Commit 4bcdc95

Browse files
committed
expose get_async_receive_offer
1 parent e58bc02 commit 4bcdc95

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/payment/bolt12.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,13 @@ impl Bolt12Payment {
450450

451451
Ok(maybe_wrap(refund))
452452
}
453+
454+
/// Retrieve an [`Offer`] for receiving async payments as an often-offline recipient. Will only return an offer if
455+
/// [`Builder::set_paths_to_static_invoice_server`] was called and we succeeded in interactively building a
456+
/// [`StaticInvoice`] with the static invoice server.
457+
///
458+
/// Useful for posting offers to receive payments later, such as posting an offer on a website.
459+
pub fn get_async_receive_offer(&self) -> Result<Offer, ()> {
460+
self.channel_manager.get_async_receive_offer()
461+
}
453462
}

0 commit comments

Comments
 (0)