@@ -922,6 +922,56 @@ pub struct GraphListNodesResponse {
922922 #[ prost( string, repeated, tag = "1" ) ]
923923 pub node_ids : :: prost:: alloc:: vec:: Vec < :: prost:: alloc:: string:: String > ,
924924}
925+ /// Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name.
926+ ///
927+ /// This method parses the provided URI string and attempts to send the payment. If the URI
928+ /// has an offer and/or invoice, it will try to pay the offer first followed by the invoice.
929+ /// If they both fail, the on-chain payment will be paid.
930+ /// See more: <https://docs.rs/ldk-node/latest/ldk_node/payment/struct.UnifiedPayment.html#method.send>
931+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
932+ #[ cfg_attr( feature = "serde" , serde( rename_all = "snake_case" ) ) ]
933+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
934+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
935+ pub struct UnifiedSendRequest {
936+ /// A BIP 21 URI or BIP 353 Human-Readable Name to pay.
937+ #[ prost( string, tag = "1" ) ]
938+ pub uri : :: prost:: alloc:: string:: String ,
939+ /// The amount in millisatoshis to send. Required for "zero-amount" or variable-amount URIs.
940+ #[ prost( uint64, optional, tag = "2" ) ]
941+ pub amount_msat : :: core:: option:: Option < u64 > ,
942+ /// Configuration options for payment routing and pathfinding.
943+ #[ prost( message, optional, tag = "3" ) ]
944+ pub route_parameters : :: core:: option:: Option < super :: types:: RouteParametersConfig > ,
945+ }
946+ /// The response `content` for the `UnifiedSend` API, when HttpStatusCode is OK (200).
947+ /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
948+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
949+ #[ cfg_attr( feature = "serde" , serde( rename_all = "snake_case" ) ) ]
950+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
951+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
952+ pub struct UnifiedSendResponse {
953+ #[ prost( oneof = "unified_send_response::PaymentResult" , tags = "1, 2, 3" ) ]
954+ #[ cfg_attr( feature = "serde" , serde( flatten) ) ]
955+ pub payment_result : :: core:: option:: Option < unified_send_response:: PaymentResult > ,
956+ }
957+ /// Nested message and enum types in `UnifiedSendResponse`.
958+ pub mod unified_send_response {
959+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
960+ #[ cfg_attr( feature = "serde" , serde( rename_all = "snake_case" ) ) ]
961+ #[ allow( clippy:: derive_partial_eq_without_eq) ]
962+ #[ derive( Clone , PartialEq , :: prost:: Oneof ) ]
963+ pub enum PaymentResult {
964+ /// An on-chain payment was made. Contains the transaction ID.
965+ #[ prost( string, tag = "1" ) ]
966+ Txid ( :: prost:: alloc:: string:: String ) ,
967+ /// A BOLT11 payment was made. Contains the payment ID in hex-encoded form.
968+ #[ prost( string, tag = "2" ) ]
969+ Bolt11PaymentId ( :: prost:: alloc:: string:: String ) ,
970+ /// A BOLT12 payment was made. Contains the payment ID in hex-encoded form.
971+ #[ prost( string, tag = "3" ) ]
972+ Bolt12PaymentId ( :: prost:: alloc:: string:: String ) ,
973+ }
974+ }
925975/// Returns information on a node with the given ID from the network graph.
926976/// See more: <https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.node>
927977#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
0 commit comments