|
1 | 1 | //! Message, request, and other primitive types used to implement LSPS1.
|
2 | 2 |
|
3 | 3 | use crate::lsps0::ser::{
|
4 |
| - string_amount, string_amount_option, LSPSMessage, RequestId, ResponseError, |
| 4 | + string_amount, string_amount_option, u32_fee_rate, LSPSMessage, RequestId, ResponseError, |
5 | 5 | };
|
6 | 6 |
|
7 | 7 | use crate::prelude::{String, Vec};
|
8 | 8 |
|
9 | 9 | use bitcoin::address::{Address, NetworkUnchecked};
|
10 |
| -use bitcoin::OutPoint; |
| 10 | +use bitcoin::{FeeRate, OutPoint}; |
11 | 11 |
|
12 | 12 | use lightning_invoice::Bolt11Invoice;
|
13 | 13 |
|
@@ -40,11 +40,11 @@ pub struct GetInfoRequest {}
|
40 | 40 | #[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
41 | 41 | pub struct OptionsSupported {
|
42 | 42 | /// The smallest number of confirmations needed for the LSP to accept a channel as confirmed.
|
43 |
| - pub min_required_channel_confirmations: u8, |
| 43 | + pub min_required_channel_confirmations: u16, |
44 | 44 | /// The smallest number of blocks in which the LSP can confirm the funding transaction.
|
45 |
| - pub min_funding_confirms_within_blocks: u8, |
| 45 | + pub min_funding_confirms_within_blocks: u16, |
46 | 46 | /// The minimum number of block confirmations before the LSP accepts an on-chain payment as confirmed.
|
47 |
| - pub min_onchain_payment_confirmations: Option<u8>, |
| 47 | + pub min_onchain_payment_confirmations: Option<u16>, |
48 | 48 | /// Indicates if the LSP supports zero reserve.
|
49 | 49 | pub supports_zero_channel_reserve: bool,
|
50 | 50 | /// Indicates the minimum amount of satoshi that is required for the LSP to accept a payment
|
@@ -104,9 +104,9 @@ pub struct OrderParams {
|
104 | 104 | #[serde(with = "string_amount")]
|
105 | 105 | pub client_balance_sat: u64,
|
106 | 106 | /// The number of confirmations the funding tx must have before the LSP sends `channel_ready`.
|
107 |
| - pub required_channel_confirmations: u8, |
| 107 | + pub required_channel_confirmations: u16, |
108 | 108 | /// The maximum number of blocks the client wants to wait until the funding transaction is confirmed.
|
109 |
| - pub funding_confirms_within_blocks: u8, |
| 109 | + pub funding_confirms_within_blocks: u16, |
110 | 110 | /// Indicates how long the channel is leased for in block time.
|
111 | 111 | pub channel_expiry_blocks: u32,
|
112 | 112 | /// May contain arbitrary associated data like a coupon code or a authentication token.
|
@@ -167,10 +167,11 @@ pub struct PaymentInfo {
|
167 | 167 | pub onchain_address: Address<NetworkUnchecked>,
|
168 | 168 | /// The minimum number of block confirmations that are required for the on-chain payment to be
|
169 | 169 | /// considered confirmed.
|
170 |
| - pub min_onchain_payment_confirmations: Option<u8>, |
| 170 | + pub min_onchain_payment_confirmations: Option<u16>, |
171 | 171 | /// The minimum fee rate for the on-chain payment in case the client wants the payment to be
|
172 | 172 | /// confirmed without a confirmation.
|
173 |
| - pub min_fee_for_0conf: u8, |
| 173 | + #[serde(with = "u32_fee_rate")] |
| 174 | + pub min_fee_for_0conf: FeeRate, |
174 | 175 | /// Details regarding a detected on-chain payment.
|
175 | 176 | pub onchain_payment: Option<OnchainPayment>,
|
176 | 177 | }
|
|
0 commit comments