@@ -29,26 +29,27 @@ use ldk_server_client::ldk_server_grpc::api::{
2929 Bolt11ReceiveRequest , Bolt11ReceiveResponse , Bolt11ReceiveVariableAmountViaJitChannelRequest ,
3030 Bolt11ReceiveVariableAmountViaJitChannelResponse , Bolt11ReceiveViaJitChannelRequest ,
3131 Bolt11ReceiveViaJitChannelResponse , Bolt11SendRequest , Bolt11SendResponse ,
32- Bolt11SendUnderpayingRequest , Bolt11SendUnderpayingResponse , Bolt12ReceiveRequest ,
33- Bolt12ReceiveResponse , Bolt12SendRequest , Bolt12SendResponse , CloseChannelRequest ,
34- CloseChannelResponse , ConnectPeerRequest , ConnectPeerResponse , DecodeInvoiceRequest ,
35- DecodeInvoiceResponse , DecodeOfferRequest , DecodeOfferResponse , DisconnectPeerRequest ,
36- DisconnectPeerResponse , ExportPathfindingScoresRequest , ForceCloseChannelRequest ,
37- ForceCloseChannelResponse , GetBalancesRequest , GetBalancesResponse , GetNodeInfoRequest ,
38- GetNodeInfoResponse , GetPaymentDetailsRequest , GetPaymentDetailsResponse ,
39- GraphGetChannelRequest , GraphGetChannelResponse , GraphGetNodeRequest , GraphGetNodeResponse ,
40- GraphListChannelsRequest , GraphListChannelsResponse , GraphListNodesRequest ,
41- GraphListNodesResponse , ListChannelsRequest , ListChannelsResponse ,
42- ListForwardedPaymentsRequest , ListPaymentsRequest , ListPeersRequest , ListPeersResponse ,
43- OnchainReceiveRequest , OnchainReceiveResponse , OnchainSendRequest , OnchainSendResponse ,
44- OpenChannelRequest , OpenChannelResponse , SignMessageRequest , SignMessageResponse ,
45- SpliceInRequest , SpliceInResponse , SpliceOutRequest , SpliceOutResponse , SpontaneousSendRequest ,
46- SpontaneousSendResponse , UnifiedSendRequest , UnifiedSendResponse , UpdateChannelConfigRequest ,
47- UpdateChannelConfigResponse , VerifySignatureRequest , VerifySignatureResponse ,
32+ Bolt11SendUnderpayingRequest , Bolt11SendUnderpayingResponse , Bolt12CreatePayerProofRequest ,
33+ Bolt12CreatePayerProofResponse , Bolt12ReceiveRequest , Bolt12ReceiveResponse , Bolt12SendRequest ,
34+ Bolt12SendResponse , CloseChannelRequest , CloseChannelResponse , ConnectPeerRequest ,
35+ ConnectPeerResponse , DecodeInvoiceRequest , DecodeInvoiceResponse , DecodeOfferRequest ,
36+ DecodeOfferResponse , DisconnectPeerRequest , DisconnectPeerResponse ,
37+ ExportPathfindingScoresRequest , ForceCloseChannelRequest , ForceCloseChannelResponse ,
38+ GetBalancesRequest , GetBalancesResponse , GetNodeInfoRequest , GetNodeInfoResponse ,
39+ GetPaymentDetailsRequest , GetPaymentDetailsResponse , GraphGetChannelRequest ,
40+ GraphGetChannelResponse , GraphGetNodeRequest , GraphGetNodeResponse , GraphListChannelsRequest ,
41+ GraphListChannelsResponse , GraphListNodesRequest , GraphListNodesResponse , ListChannelsRequest ,
42+ ListChannelsResponse , ListForwardedPaymentsRequest , ListPaymentsRequest , ListPeersRequest ,
43+ ListPeersResponse , OnchainReceiveRequest , OnchainReceiveResponse , OnchainSendRequest ,
44+ OnchainSendResponse , OpenChannelRequest , OpenChannelResponse , SignMessageRequest ,
45+ SignMessageResponse , SpliceInRequest , SpliceInResponse , SpliceOutRequest , SpliceOutResponse ,
46+ SpontaneousSendRequest , SpontaneousSendResponse , UnifiedSendRequest , UnifiedSendResponse ,
47+ UpdateChannelConfigRequest , UpdateChannelConfigResponse , VerifySignatureRequest ,
48+ VerifySignatureResponse ,
4849} ;
4950use ldk_server_client:: ldk_server_grpc:: types:: {
5051 bolt11_invoice_description, Bolt11InvoiceDescription , ChannelConfig , CustomTlvRecord ,
51- PageToken , RouteParametersConfig ,
52+ PageToken , PayerProofOptions , RouteParametersConfig ,
5253} ;
5354use ldk_server_client:: {
5455 DEFAULT_EXPIRY_SECS , DEFAULT_MAX_CHANNEL_SATURATION_POWER_OF_HALF , DEFAULT_MAX_PATH_COUNT ,
@@ -315,6 +316,27 @@ enum Commands {
315316 ) ]
316317 max_channel_saturation_power_of_half : Option < u32 > ,
317318 } ,
319+ #[ command( about = "Create a BOLT 12 payer proof for a payment this node made" ) ]
320+ Bolt12CreatePayerProof {
321+ #[ arg( help = "The hex-encoded payment id from PaymentSuccessful" ) ]
322+ payment_id : String ,
323+ #[ arg( help = "The hex-encoded 32-byte payment preimage from PaymentSuccessful" ) ]
324+ payment_preimage : String ,
325+ #[ arg( help = "The hex-encoded BOLT 12 invoice from PaymentSuccessful" ) ]
326+ invoice : String ,
327+ #[ arg( long, help = "Optional note to attach to the payer proof" ) ]
328+ note : Option < String > ,
329+ #[ arg( long, help = "Disclose the offer description in the proof" ) ]
330+ include_offer_description : bool ,
331+ #[ arg( long, help = "Disclose the offer issuer in the proof" ) ]
332+ include_offer_issuer : bool ,
333+ #[ arg( long, help = "Disclose the invoice amount in the proof" ) ]
334+ include_invoice_amount : bool ,
335+ #[ arg( long, help = "Disclose the invoice creation timestamp in the proof" ) ]
336+ include_invoice_created_at : bool ,
337+ #[ arg( long, help = "Additional TLV types to disclose" ) ]
338+ extra_tlv_types : Vec < u64 > ,
339+ } ,
318340 #[ command( about = "Send a spontaneous payment (keysend) to a node" ) ]
319341 SpontaneousSend {
320342 #[ arg( help = "The hex-encoded public key of the node to send the payment to" ) ]
@@ -868,6 +890,36 @@ async fn main() {
868890 . await ,
869891 ) ;
870892 } ,
893+ Commands :: Bolt12CreatePayerProof {
894+ payment_id,
895+ payment_preimage,
896+ invoice,
897+ note,
898+ include_offer_description,
899+ include_offer_issuer,
900+ include_invoice_amount,
901+ include_invoice_created_at,
902+ extra_tlv_types,
903+ } => {
904+ let options = PayerProofOptions {
905+ note,
906+ include_offer_description,
907+ include_offer_issuer,
908+ include_invoice_amount,
909+ include_invoice_created_at,
910+ extra_tlv_types,
911+ } ;
912+ handle_response_result :: < _ , Bolt12CreatePayerProofResponse > (
913+ client
914+ . bolt12_create_payer_proof ( Bolt12CreatePayerProofRequest {
915+ payment_id,
916+ payment_preimage,
917+ invoice,
918+ options : Some ( options) ,
919+ } )
920+ . await ,
921+ ) ;
922+ } ,
871923 Commands :: SpontaneousSend {
872924 node_id,
873925 amount,
0 commit comments