Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 7f60e7f

Browse files
committed
Use bitcoin::Address in LSPS1
1 parent 71b9dd2 commit 7f60e7f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ no-std = ["hashbrown", "lightning/no-std", "bitcoin/no-std", "core2/alloc"]
2121
[dependencies]
2222
lightning = { version = "0.0.121", default-features = false, features = ["max_level_trace"] }
2323
lightning-invoice = "0.29.0"
24-
bitcoin = { version = "0.30.2", default-features = false }
24+
bitcoin = { version = "0.30.2", default-features = false, features = ["serde"] }
2525
hashbrown = { version = "0.8", optional = true }
2626
core2 = { version = "0.3.0", optional = true, default-features = false }
2727

src/lsps1/msgs.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
use crate::lsps0::msgs::{LSPSMessage, RequestId, ResponseError};
44
use crate::prelude::{String, Vec};
55

6+
use bitcoin::address::{Address, NetworkUnchecked};
7+
68
use serde::{Deserialize, Serialize};
79

810
use chrono::Utc;
@@ -94,7 +96,7 @@ pub struct OrderParams {
9496
/// May contain arbitrary associated data like a coupon code or a authentication token.
9597
pub token: String,
9698
/// The address where the LSP will send the funds if the order fails.
97-
pub refund_onchain_address: Option<String>,
99+
pub refund_onchain_address: Option<Address<NetworkUnchecked>>,
98100
/// Indicates if the channel should be announced to the network.
99101
pub announce_channel: bool,
100102
}
@@ -142,7 +144,7 @@ pub struct OrderPayment {
142144
pub bolt11_invoice: String,
143145
/// An on-chain address the client can send [`Self::order_total_sat`] to to have the channel
144146
/// opened.
145-
pub onchain_address: String,
147+
pub onchain_address: Address<NetworkUnchecked>,
146148
/// The minimum number of block confirmations that are required for the on-chain payment to be
147149
/// considered confirmed.
148150
pub min_onchain_payment_confirmations: Option<u8>,

0 commit comments

Comments
 (0)