@@ -56,6 +56,10 @@ use crate::ln::outbound_payment;
5656use  crate :: ln:: outbound_payment:: { OutboundPayments ,  PaymentAttempts ,  PendingOutboundPayment } ; 
5757use  crate :: ln:: wire:: Encode ; 
5858use  crate :: chain:: keysinterface:: { EntropySource ,  KeysManager ,  NodeSigner ,  Recipient ,  SignerProvider ,  ChannelSigner } ; 
59+ use  crate :: offers:: offer:: OfferBuilder ; 
60+ use  crate :: offers:: parse:: SemanticError ; 
61+ use  crate :: offers:: refund:: RefundBuilder ; 
62+ use  crate :: offers:: signer:: DerivedPubkey ; 
5963use  crate :: util:: config:: { UserConfig ,  ChannelConfig } ; 
6064use  crate :: util:: events:: { Event ,  EventHandler ,  EventsProvider ,  MessageSendEvent ,  MessageSendEventsProvider ,  ClosureReason ,  HTLCDestination } ; 
6165use  crate :: util:: events; 
@@ -5377,6 +5381,36 @@ where
53775381		Ok ( payment_secret) 
53785382	} 
53795383
5384+ 	/// Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the 
5385+ /// [`OnionMessenger`] when handling [`InvoiceRequest`] messages for the offer. 
5386+ /// 
5387+ /// [`Offer`]: crate::offers::offer::Offer 
5388+ /// [`OnionMessenger`]: crate::onion_message::OnionMessenger 
5389+ /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest 
5390+ pub  fn  create_offer_builder ( & self ,  description :  String )  -> OfferBuilder  { 
5391+ 		let  nonce = inbound_payment:: Nonce :: from_entropy_source ( & * self . entropy_source ) ; 
5392+ 		let  signing_pubkey = DerivedPubkey :: new ( & self . inbound_payment_key ,  nonce) ; 
5393+ 
5394+ 		// TODO: Set blinded paths 
5395+ 		OfferBuilder :: deriving_signing_pubkey ( description,  signing_pubkey) 
5396+ 	} 
5397+ 
5398+ 	/// Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the 
5399+ /// [`OnionMessenger`] when handling [`Invoice`] messages for the refund. 
5400+ /// 
5401+ /// [`Refund`]: crate::offers::refund::Refund 
5402+ /// [`OnionMessenger`]: crate::onion_message::OnionMessenger 
5403+ /// [`Invoice`]: crate::offers::invoice::Invoice 
5404+ pub  fn  create_refund_builder ( 
5405+ 		& self ,  description :  String ,  amount_msats :  u64 
5406+ 	)  -> Result < RefundBuilder ,  SemanticError >  { 
5407+ 		let  nonce = inbound_payment:: Nonce :: from_entropy_source ( & * self . entropy_source ) ; 
5408+ 		let  payer_id = DerivedPubkey :: new ( & self . inbound_payment_key ,  nonce) ; 
5409+ 
5410+ 		// TODO: Set blinded paths 
5411+ 		RefundBuilder :: deriving_payer_id ( description,  payer_id,  amount_msats) 
5412+ 	} 
5413+ 
53805414	/// Gets a payment secret and payment hash for use in an invoice given to a third party wishing 
53815415/// to pay us. 
53825416/// 
0 commit comments