@@ -13,3 +13,52 @@ pub use onchain::OnchainPayment;
13
13
pub use spontaneous:: SpontaneousPayment ;
14
14
pub use store:: { LSPFeeLimits , PaymentDetails , PaymentDirection , PaymentKind , PaymentStatus } ;
15
15
pub use unified_qr:: { QrPaymentResult , UnifiedQrPayment } ;
16
+
17
+ /// Represents information used to route a payment.
18
+ #[ derive( Clone , Debug , PartialEq ) ]
19
+ pub struct SendingParameters {
20
+ /// The maximum total fees, in millisatoshi, that may accrue during route finding.
21
+ ///
22
+ /// This limit also applies to the total fees that may arise while retrying failed payment
23
+ /// paths.
24
+ ///
25
+ /// Note that values below a few sats may result in some paths being spuriously ignored.
26
+ pub max_total_routing_fee_msat : Option < u64 > ,
27
+
28
+ /// The maximum total CLTV delta we accept for the route.
29
+ ///
30
+ /// Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
31
+ ///
32
+ /// [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`]: lightning::routing::router::DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA
33
+ pub max_total_cltv_expiry_delta : Option < u32 > ,
34
+
35
+ /// The maximum number of paths that may be used by (MPP) payments.
36
+ ///
37
+ /// Defaults to [`DEFAULT_MAX_PATH_COUNT`].
38
+ ///
39
+ /// [`DEFAULT_MAX_PATH_COUNT`]: lightning::routing::router::DEFAULT_MAX_PATH_COUNT
40
+ pub max_path_count : Option < u8 > ,
41
+
42
+ /// Selects the maximum share of a channel's total capacity which will be sent over a channel,
43
+ /// as a power of 1/2.
44
+ ///
45
+ /// A higher value prefers to send the payment using more MPP parts whereas
46
+ /// a lower value prefers to send larger MPP parts, potentially saturating channels and
47
+ /// increasing failure probability for those paths.
48
+ ///
49
+ /// Note that this restriction will be relaxed during pathfinding after paths which meet this
50
+ /// restriction have been found. While paths which meet this criteria will be searched for, it
51
+ /// is ultimately up to the scorer to select them over other paths.
52
+ ///
53
+ /// Examples:
54
+ ///
55
+ /// | Value | Max Proportion of Channel Capacity Used |
56
+ /// |-------|-----------------------------------------|
57
+ /// | 0 | Up to 100% of the channel’s capacity |
58
+ /// | 1 | Up to 50% of the channel’s capacity |
59
+ /// | 2 | Up to 25% of the channel’s capacity |
60
+ /// | 3 | Up to 12.5% of the channel’s capacity |
61
+ ///
62
+ /// Default value: 2
63
+ pub max_channel_saturation_power_of_half : Option < u8 > ,
64
+ }
0 commit comments