Add zero-amount Receive Chain Swap (#538)

Add support for Zero-Amount Receive Chain Swaps
This commit is contained in:
ok300
2024-12-09 16:10:52 +00:00
committed by GitHub
parent 790dfa91be
commit cfc883ae00
20 changed files with 571 additions and 60 deletions

4
cli/Cargo.lock generated
View File

@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@@ -609,7 +609,7 @@ dependencies = [
[[package]]
name = "boltz-client"
version = "0.1.3"
source = "git+https://github.com/SatoshiPortal/boltz-rust?branch=trunk#19e01071f5722c21f80ae9b34edef5c3972e9e0b"
source = "git+https://github.com/SatoshiPortal/boltz-rust?branch=trunk#68ff15b0f80abfa54d8dca4c11c8c2794e4b6921"
dependencies = [
"bip39",
"bitcoin 0.31.2",

View File

@@ -271,13 +271,21 @@ pub(crate) async fn handle_command(
})
.await?;
wait_confirmation!(
format!(
"Fees: {} sat. Are the fees acceptable? (y/N) ",
prepare_response.fees_sat
),
"Payment receive halted"
);
let fees = prepare_response.fees_sat;
let confirmation_msg = match payer_amount_sat {
Some(_) => format!("Fees: {fees} sat. Are the fees acceptable? (y/N)"),
None => {
let min = prepare_response.min_payer_amount_sat;
let max = prepare_response.max_payer_amount_sat;
let service_feerate = prepare_response.service_feerate;
format!(
"Fees: {fees} sat + {service_feerate:?}% of the sent amount. \
Sender should send between {min:?} sat and {max:?} sat. \
Are the fees acceptable? (y/N)"
)
}
};
wait_confirmation!(confirmation_msg, "Payment receive halted");
let response = sdk
.receive_payment(&ReceivePaymentRequest {