pub struct PaymentHistory {
pub payment_hash: String,
pub buyer_mode: BuyerMode,
pub successful_trades: u32,
pub distinct_counterparties: u32,
pub experienced_counterparties: u32,
pub first_success_at: Option<i64>,
pub last_success_at: Option<i64>,
}Expand description
Aggregate, order-scoped history of a (buyer, payment_hash) pair.
Carried by crate::message::Action::PaymentHistory, pushed by Mostro to
the seller right after fiat-sent-ok and returned on a seller query.
Counters only ever reflect trades that reached success without a
dispute.
Fields§
§payment_hash: StringEcho of the buyer-committed hash, so the seller’s client can compare
it with the hash it computes from the plaintext it received: with
payment_hash when buyer_mode is BuyerMode::Reputation, with
order_bound_payment_hash when it is BuyerMode::FullPrivacy.
For BuyerMode::Unknown the client cannot know which construction
a newer buyer used: it accepts a match under either one rather than
picking one and reporting a false mismatch.
buyer_mode: BuyerModeWhether the counters are meaningful. See BuyerMode.
successful_trades: u32Number of orders that reached success for (buyer, payment_hash).
distinct_counterparties: u32Number of distinct sellers among those orders.
experienced_counterparties: u32How many of those distinct counterparties were already experienced at the time of their successful trade with this pair. The thresholds are node policy, advertised on the info event.
first_success_at: Option<i64>Unix seconds of the first successful trade; None when
successful_trades == 0.
last_success_at: Option<i64>Unix seconds of the last successful trade; None when
successful_trades == 0.
Implementations§
Source§impl PaymentHistory
impl PaymentHistory
History for a buyer in Full Privacy Mode: every counter is zero and
buyer_mode says the history is unavailable.
Trait Implementations§
Source§impl Clone for PaymentHistory
impl Clone for PaymentHistory
Source§impl Debug for PaymentHistory
impl Debug for PaymentHistory
Source§impl<'de> Deserialize<'de> for PaymentHistory
impl<'de> Deserialize<'de> for PaymentHistory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PaymentHistory
Source§impl PartialEq for PaymentHistory
impl PartialEq for PaymentHistory
Source§impl Serialize for PaymentHistory
impl Serialize for PaymentHistory
impl StructuralPartialEq for PaymentHistory
Auto Trait Implementations§
impl Freeze for PaymentHistory
impl RefUnwindSafe for PaymentHistory
impl Send for PaymentHistory
impl Sync for PaymentHistory
impl Unpin for PaymentHistory
impl UnsafeUnpin for PaymentHistory
impl UnwindSafe for PaymentHistory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more