-
Notifications
You must be signed in to change notification settings - Fork 9
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 zero-amount Receive Chain Swap #538
Conversation
55937a5
to
9a82900
Compare
9f41dab
to
89e20d4
Compare
The SDK user has to provide a fee rate for these refunds, so they need to be manually handled |
# Conflicts: # lib/core/src/sdk.rs
It's not about refunds per se. The zero-amount swaps get the However it will not become an actual refundable when the user locks up funds, because when the zero-amount swap gets this event, we are getting and confirming the so-called quote from Boltz. By confirming it, we tell Boltz they should proceed with this swap (e.g. create the server lockup tx, etc). My question above was about this "getting and confirming" the quote. However we clarified in an earlier call that no user interaction should be needed to claim, so therefore we get and auto-confirm the quote. Hopefully this clarifies the confusion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. some comments about the interface.
# Conflicts: # cli/Cargo.lock # lib/Cargo.lock # lib/core/src/test_utils/swapper.rs
0002af6
to
183c828
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a couple of comments
lib/core/Cargo.toml
Outdated
@@ -14,7 +14,8 @@ frb = ["dep:flutter_rust_bridge"] | |||
[dependencies] | |||
anyhow = { workspace = true } | |||
bip39 = "2.0.0" | |||
boltz-client = { git = "https://github.com/SatoshiPortal/boltz-rust", branch = "trunk" } | |||
#boltz-client = { git = "https://github.com/SatoshiPortal/boltz-rust", branch = "trunk" } | |||
boltz-client = { git = "https://github.com/ok300/boltz-rust", branch = "ok300-support-quote" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is your rust-boltz PR merged yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: e8ac979
lib/core/src/model.rs
Outdated
/// The percentage of the sent amount that will count towards the service fee. | ||
/// | ||
/// When the method is [PaymentMethod::LiquidAddress], this is empty. | ||
pub service_feerate: Option<f64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe to be consistent with the previous PR, this could be swapper_feerate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: addde46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM one comment regarding docs.
let min = prepare_response.min_payer_amount_sat; | ||
let max = prepare_response.max_payer_amount_sat; | ||
let service_feerate = prepare_response.service_feerate; | ||
format!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we will need to document the fact that in amountless swap applications need to add the service fee on top of the fees_sat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: 542dec7
Fixes #519
Open questions:
prepare_response
? How else to communicate them to caller, as they are now essential?lockupFailed
event)?payer_amount_sat
to 0 for zero-amount swaps? OrNULL
(DB migration)?