pub struct PaymentsDb<F> { /* private fields */ }Expand description
The app’s local BasicPaymentV2 database, synced from the user node.
Implementations§
Source§impl<F: Ffs> PaymentsDb<F>
impl<F: Ffs> PaymentsDb<F>
Sourcepub fn delete(&self) -> Result<()>
pub fn delete(&self) -> Result<()>
Clear the in-memory state and delete the on-disk payment db.
Sourcepub fn num_payments(&self) -> usize
pub fn num_payments(&self) -> usize
Total number of payments in the database.
Sourcepub fn num_pending(&self) -> usize
pub fn num_pending(&self) -> usize
Number of pending (unfinalized) payments.
Sourcepub fn num_finalized(&self) -> usize
pub fn num_finalized(&self) -> usize
Number of finalized payments.
Sourcepub fn num_pending_not_junk(&self) -> usize
pub fn num_pending_not_junk(&self) -> usize
Number of pending payments that are not junk.
Sourcepub fn num_finalized_not_junk(&self) -> usize
pub fn num_finalized_not_junk(&self) -> usize
Number of finalized payments that are not junk.
Sourcepub fn latest_updated_index(&self) -> Option<PaymentUpdatedIndex>
pub fn latest_updated_index(&self) -> Option<PaymentUpdatedIndex>
The latest updated_at index of any payment in the db.
Sourcepub fn get_payment_by_created_index(
&self,
created_index: &PaymentCreatedIndex,
) -> Option<BasicPaymentV2>
pub fn get_payment_by_created_index( &self, created_index: &PaymentCreatedIndex, ) -> Option<BasicPaymentV2>
Get a payment by its PaymentCreatedIndex.
Sourcepub fn get_payment_by_scroll_idx(
&self,
scroll_idx: usize,
) -> Option<BasicPaymentV2>
pub fn get_payment_by_scroll_idx( &self, scroll_idx: usize, ) -> Option<BasicPaymentV2>
Get a payment by scroll index in UI order (newest to oldest).
Sourcepub fn get_pending_payment_by_scroll_idx(
&self,
scroll_idx: usize,
) -> Option<BasicPaymentV2>
pub fn get_pending_payment_by_scroll_idx( &self, scroll_idx: usize, ) -> Option<BasicPaymentV2>
Get a pending payment by scroll index in UI order (newest to oldest).
Sourcepub fn get_pending_not_junk_payment_by_scroll_idx(
&self,
scroll_idx: usize,
) -> Option<BasicPaymentV2>
pub fn get_pending_not_junk_payment_by_scroll_idx( &self, scroll_idx: usize, ) -> Option<BasicPaymentV2>
Get a “pending and not junk” payment by scroll index in UI order.
Sourcepub fn get_finalized_payment_by_scroll_idx(
&self,
scroll_idx: usize,
) -> Option<BasicPaymentV2>
pub fn get_finalized_payment_by_scroll_idx( &self, scroll_idx: usize, ) -> Option<BasicPaymentV2>
Get a finalized payment by scroll index in UI order (newest to oldest).
Sourcepub fn get_finalized_not_junk_payment_by_scroll_idx(
&self,
scroll_idx: usize,
) -> Option<BasicPaymentV2>
pub fn get_finalized_not_junk_payment_by_scroll_idx( &self, scroll_idx: usize, ) -> Option<BasicPaymentV2>
Get a “finalized and not junk” payment by scroll index in UI order.