-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LSPS1 client-side integration #418
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a160bf2
to
d0eb977
Compare
d0eb977
to
fe59fed
Compare
82fc329
to
9d47470
Compare
9d47470
to
5e13aa5
Compare
5e13aa5
to
2780049
Compare
Rebased on main after #426 landed. |
115f732
to
a2593ae
Compare
Rebased on main to resolve minor changes. |
1d68d58
to
e3725b4
Compare
jkczyz
reviewed
Jan 31, 2025
.. to align with the rest of the APIs where we usually go `node_id`, `address`, etc.
We add support for LSPS1 liquidity sources. To this end we slightly refactor our logic to first create a `LiquiditySourceBuilder` that then can be used to `build()` the `LiquiditySource` with the configured services.
9cec3f4
to
0e590ba
Compare
We add the logic required to send `create_order` requests and check on their status.
We add an `Lsps1Liquidity` API object, mirroring the approach we took with the `payment` APIs.
0e590ba
to
b1a277c
Compare
Now went ahead and squashed fixups, including the doc changes: > git diff-tree -U2 0e590ba9 b1a277c6
diff --git a/src/liquidity.rs b/src/liquidity.rs
index 7414260c..cbc19954 100644
--- a/src/liquidity.rs
+++ b/src/liquidity.rs
@@ -224,9 +224,9 @@ where
match sender.send(response) {
Ok(()) => (),
- Err(e) => {
+ Err(_) => {
log_error!(
self.logger,
- "Failed to handle response from liquidity service: {:?}",
- e
+ "Failed to handle response for request {:?} from liquidity service",
+ request_id
);
},
@@ -285,9 +285,9 @@ where
match sender.send(response) {
Ok(()) => (),
- Err(e) => {
+ Err(_) => {
log_error!(
self.logger,
- "Failed to handle response from liquidity service: {:?}",
- e
+ "Failed to handle response for request {:?} from liquidity service",
+ request_id
);
},
@@ -343,9 +343,9 @@ where
match sender.send(response) {
Ok(()) => (),
- Err(e) => {
+ Err(_) => {
log_error!(
self.logger,
- "Failed to handle response from liquidity service: {:?}",
- e
+ "Failed to handle response for request {:?} from liquidity service",
+ request_id
);
},
@@ -390,9 +390,9 @@ where
match sender.send(response) {
Ok(()) => (),
- Err(e) => {
+ Err(_) => {
log_error!(
self.logger,
- "Failed to handle response from liquidity service: {:?}",
- e
+ "Failed to handle response for request {:?} from liquidity service",
+ request_id
);
},
@@ -442,9 +442,9 @@ where
match sender.send(response) {
Ok(()) => (),
- Err(e) => {
+ Err(_) => {
log_error!(
self.logger,
- "Failed to handle response from liquidity service: {:?}",
- e
+ "Failed to handle response for request {:?} from liquidity service",
+ request_id
);
},
@@ -964,6 +964,11 @@ pub(crate) struct LSPS2BuyResponse {
/// Should be retrieved by calling [`Node::lsps1_liquidity`].
///
+/// To open [bLIP-52 / LSPS2] JIT channels, please refer to
+/// [`Bolt11Payment::receive_via_jit_channel`].
+///
/// [bLIP-51 / LSPS1]: https://github.com/lightning/blips/blob/master/blip-0051.md
+/// [bLIP-52 / LSPS2]: https://github.com/lightning/blips/blob/master/blip-0052.md
/// [`Node::lsps1_liquidity`]: crate::Node::lsps1_liquidity
+/// [`Bolt11Payment::receive_via_jit_channel`]: crate::payment::Bolt11Payment::receive_via_jit_channel
#[derive(Clone)]
pub struct LSPS1Liquidity { |
jkczyz
approved these changes
Feb 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We add the capability to act as an LSPS1 / bLIP-51 client.