diff --git a/src/lib.rs b/src/lib.rs index e7acbdf2..59984310 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1355,7 +1355,7 @@ impl LightningNode { } else if let Some(ref s) = payment_details.reverse_swap_info { let reverse_swap_info = ReverseSwapInfo { paid_onchain_amount: s.onchain_amount_sat.as_sats().to_amount_up(&exchange_rate), - onchain_fees_amount: (breez_payment.amount_msat + swap_fees_amount: (breez_payment.amount_msat - s.onchain_amount_sat.as_sats().msats) .as_msats() .to_amount_up(&exchange_rate), diff --git a/src/lipalightninglib.udl b/src/lipalightninglib.udl index 5a62a7e2..5c23c1be 100644 --- a/src/lipalightninglib.udl +++ b/src/lipalightninglib.udl @@ -579,7 +579,7 @@ dictionary SwapInfo { dictionary ReverseSwapInfo { Amount paid_onchain_amount; - Amount onchain_fees_amount; + Amount swap_fees_amount; string? claim_txid; ReverseSwapStatus status; }; diff --git a/src/reverse_swap.rs b/src/reverse_swap.rs index 2bdce1cf..b1a56585 100644 --- a/src/reverse_swap.rs +++ b/src/reverse_swap.rs @@ -5,10 +5,9 @@ use breez_sdk_core::ReverseSwapStatus; #[derive(PartialEq, Debug)] pub struct ReverseSwapInfo { pub paid_onchain_amount: Amount, - /// Total fees paid excluding LN routing fees. In practice this doesn't include only onchain - /// fees (the reverse-swap provider also takes a cut) but from the perspective of a payer, - /// these are fees involved with paying onchain. - pub onchain_fees_amount: Amount, + /// Total fees paid excluding LN routing fees. Includes onchain + /// fees and reverse-swap provider fees. + pub swap_fees_amount: Amount, /// The tx id of the claim tx, which is the final tx in the reverse swap flow, which send funds /// to the targeted on-chain address. ///