pub struct Movement {Show 13 fields
pub id: MovementId,
pub status: MovementStatus,
pub subsystem: MovementSubsystem,
pub metadata: HashMap<String, Value>,
pub intended_balance: SignedAmount,
pub effective_balance: SignedAmount,
pub offchain_fee: Amount,
pub sent_to: Vec<MovementDestination>,
pub received_on: Vec<MovementDestination>,
pub input_vtxos: Vec<VtxoId>,
pub output_vtxos: Vec<VtxoId>,
pub exited_vtxos: Vec<VtxoId>,
pub time: MovementTimestamp,
}Expand description
Describes an attempted movement of offchain funds within the Wallet.
Fields§
§id: MovementIdThe internal ID of the movement.
status: MovementStatusThe status of the movement.
subsystem: MovementSubsystemContains information about the subsystem that created the movement as well as the purpose of the movement.
metadata: HashMap<String, Value>Miscellaneous metadata for the movement. This is JSON containing arbitrary information as defined by the subsystem that created the movement.
intended_balance: SignedAmountHow much the movement was expected to increase or decrease the balance by. This is always an estimate and often discounts any applicable fees.
effective_balance: SignedAmountHow much the wallet balance actually changed by. Positive numbers indicate an increase and negative numbers indicate a decrease. This is often inclusive of applicable fees, and it should be the most accurate number.
offchain_fee: AmountHow much the movement cost the user in offchain fees. If there are applicable onchain fees they will not be included in this value but, depending on the subsystem, could be found in the metadata.
sent_to: Vec<MovementDestination>A list of external recipients that received funds from this movement.
received_on: Vec<MovementDestination>Describes the means by which the wallet received funds in this movement. This could include BOLT11 invoices or other useful data.
input_vtxos: Vec<VtxoId>A list of Vtxo IDs that were consumed by this movement and are either locked or unavailable.
output_vtxos: Vec<VtxoId>A list of IDs for new VTXOs that were produced as a result of this movement. Often change VTXOs will be found here for outbound actions unless this was an inbound action.
exited_vtxos: Vec<VtxoId>A list of IDs for VTXOs that were marked for unilateral exit as a result of this movement. This could happen for many reasons, e.g. an unsuccessful lightning payment which can’t be revoked but is about to expire. VTXOs listed here will result in a reduction of spendable balance due to the VTXOs being managed by the crate::Exit system.
time: MovementTimestampContains the times at which the movement was created, updated and completed.
Implementations§
Source§impl Movement
impl Movement
pub fn new( id: MovementId, status: MovementStatus, subsystem: &MovementSubsystem, time: DateTime<Local>, ) -> Self
Sourcepub fn received_on(&self, payment_method: &PaymentMethod) -> bool
pub fn received_on(&self, payment_method: &PaymentMethod) -> bool
Checks whether this movement received the given payment method
Sourcepub fn sent_to(&self, payment_method: &PaymentMethod) -> bool
pub fn sent_to(&self, payment_method: &PaymentMethod) -> bool
Checks whether this movement sent to the given payment method
Sourcepub fn lightning_invoice(&self) -> Option<&Invoice>
pub fn lightning_invoice(&self) -> Option<&Invoice>
Get the Lightning invoice associated with this movement
Returns None for movements that don’t have an invoice.
Sourcepub fn lightning_offer(&self) -> Option<&Offer>
pub fn lightning_offer(&self) -> Option<&Offer>
Get the Lightning offer associated with this movement
Returns None for movements that don’t have an offer.
Sourcepub fn lightning_payment_hash(&self) -> Option<PaymentHash>
pub fn lightning_payment_hash(&self) -> Option<PaymentHash>
Get the Lightning payment hash associated with this movement
Returns None for movements that are not Lightning payments.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Movement
impl<'de> Deserialize<'de> for Movement
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 Movement
impl StructuralPartialEq for Movement
Auto Trait Implementations§
impl Freeze for Movement
impl RefUnwindSafe for Movement
impl Send for Movement
impl Sync for Movement
impl Unpin for Movement
impl UnsafeUnpin for Movement
impl UnwindSafe for Movement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request