Skip to content

Commit a6fc7f2

Browse files
committed
expose get_async_receive_offer
1 parent 55a8d29 commit a6fc7f2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ use lightning::impl_writeable_tlv_based;
157157
use lightning::ln::channel_state::ChannelShutdownState;
158158
use lightning::ln::channelmanager::PaymentId;
159159
use lightning::ln::msgs::SocketAddress;
160+
use lightning::offers::offer::Offer;
160161
use lightning::routing::gossip::NodeAlias;
161162

162163
use lightning_background_processor::process_events_async_with_kv_store_sync;
@@ -1575,6 +1576,15 @@ impl Node {
15751576
Error::PersistenceFailed
15761577
})
15771578
}
1579+
1580+
/// Retrieve an [`Offer`] for receiving async payments as an often-offline recipient. Will only return an offer if
1581+
/// [`Builder::set_paths_to_static_invoice_server`] was called and we succeeded in interactively building a
1582+
/// [`StaticInvoice`] with the static invoice server.
1583+
///
1584+
/// Useful for posting offers to receive payments later, such as posting an offer on a website.
1585+
pub fn get_async_receive_offer(&self) -> Result<Offer, ()> {
1586+
self.channel_manager.get_async_receive_offer()
1587+
}
15781588
}
15791589

15801590
impl Drop for Node {

0 commit comments

Comments
 (0)