Browse Source

Provide margin of counterparty

refactor/no-log-handler
Philipp Hoenisch 3 years ago
parent
commit
e1206d38f0
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 3
      daemon/src/to_sse_event.rs

3
daemon/src/to_sse_event.rs

@ -26,6 +26,8 @@ pub struct Cfd {
#[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")]
pub margin: Amount,
#[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")]
pub margin_counterparty: Amount,
#[serde(with = "::bdk::bitcoin::util::amount::serde::as_btc")]
pub profit_btc: SignedAmount,
@ -257,6 +259,7 @@ impl ToSseEvent for CfdsWithAuxData {
// TODO: Depending on the state the margin might be set (i.e. in Open we save it
// in the DB internally) and does not have to be calculated
margin: cfd.margin().unwrap(),
margin_counterparty: cfd.counterparty_margin().unwrap(),
details,
}
})

Loading…
Cancel
Save