Skip to content

Commit

Permalink
Rename onchain_fees_amount to swap_fees_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgranhao committed Sep 25, 2024
1 parent 44dda96 commit 7dcb74d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/lipalightninglib.udl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
7 changes: 3 additions & 4 deletions src/reverse_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit 7dcb74d

Please sign in to comment.