Skip to content

Commit 7f49f93

Browse files
implement lsps5
1 parent 463e432 commit 7f49f93

16 files changed

+1899
-171
lines changed

lightning-liquidity/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ categories = ["cryptography::cryptocurrencies"]
1717
default = ["std"]
1818
std = ["lightning/std"]
1919
backtrace = ["dep:backtrace"]
20+
lsps5 = ["minreq", "url"]
2021

2122
[dependencies]
2223
lightning = { version = "0.0.124", path = "../lightning", default-features = false }
@@ -30,6 +31,9 @@ serde = { version = "1.0", default-features = false, features = ["derive", "allo
3031
serde_json = "1.0"
3132
backtrace = { version = "0.3", optional = true }
3233

34+
minreq = { version = "2.11.1", optional = true, features = ["https", "json-using-serde"] }
35+
url = { version = "2.5.0", optional = true, features = ["serde"] }
36+
3337
[dev-dependencies]
3438
lightning = { version = "0.0.124", path = "../lightning", default-features = false, features = ["_test_utils"] }
3539
lightning-invoice = { version = "0.32.0", path = "../lightning-invoice", default-features = false, features = ["serde", "std"] }

lightning-liquidity/src/events.rs

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use crate::lsps0;
1919
use crate::lsps1;
2020
use crate::lsps2;
21+
#[cfg(feature = "lsps5")]
22+
use crate::lsps5;
2123
use crate::prelude::{Vec, VecDeque};
2224
use crate::sync::{Arc, Mutex};
2325

@@ -114,6 +116,12 @@ pub enum Event {
114116
LSPS2Client(lsps2::event::LSPS2ClientEvent),
115117
/// An LSPS2 (JIT Channel) server event.
116118
LSPS2Service(lsps2::event::LSPS2ServiceEvent),
119+
/// An LSPS5 (Webhook Notifications) client event.
120+
#[cfg(feature = "lsps5")]
121+
LSPS5Client(lsps5::event::LSPS5ClientEvent),
122+
/// An LSPS5 (Webhook Notifications) server event.
123+
#[cfg(feature = "lsps5")]
124+
LSPS5Service(lsps5::event::LSPS5ServiceEvent),
117125
}
118126

119127
struct EventFuture {

lightning-liquidity/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ pub mod events;
6464
pub mod lsps0;
6565
pub mod lsps1;
6666
pub mod lsps2;
67+
#[cfg(feature = "lsps5")]
68+
pub mod lsps5;
6769
mod manager;
6870
pub mod message_queue;
6971
#[allow(dead_code)]

lightning-liquidity/src/lsps0/msgs.rs

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ impl TryFrom<LSPSMessage> for LSPS0Message {
7878
LSPSMessage::LSPS0(message) => Ok(message),
7979
LSPSMessage::LSPS1(_) => Err(()),
8080
LSPSMessage::LSPS2(_) => Err(()),
81+
#[cfg(feature = "lsps5")]
82+
LSPSMessage::LSPS5(_) => Err(()),
8183
}
8284
}
8385
}

0 commit comments

Comments
 (0)