Struct SdkPayment

pub struct SdkPayment {
Show 21 fields pub index: PaymentCreatedIndex, pub id: LxPaymentId, pub rail: PaymentRail, pub kind: PaymentKind, pub direction: PaymentDirection, pub txid: Option<LxTxid>, pub amount: Option<Amount>, pub fees: Amount, pub status: PaymentStatus, pub status_msg: String, pub address: Option<Arc<Address<NetworkUnchecked>>>, pub invoice: Option<Arc<LxInvoice>>, pub tx: Option<Arc<Transaction>>, pub note: Option<String>, pub payer_name: Option<String>, pub payer_note: Option<String>, pub priority: Option<ConfirmationPriority>, pub expires_at: Option<TimestampMs>, pub finalized_at: Option<TimestampMs>, pub created_at: TimestampMs, pub updated_at: TimestampMs,
}
Expand description

Information about a payment.

Fields§

§index: PaymentCreatedIndex

Unique identifier for this payment, ordered by created_at.

This implements Ord and is generally the thing you want to key your payments by, e.g. BTreeMap<PaymentCreatedIndex, SdkPayment>.

§id: LxPaymentId

Unordered payment identifier. You should prefer to use index instead of this.

§rail: PaymentRail

The technical ‘rail’ used to fulfill a payment: ‘onchain’, ‘invoice’, ‘offer’, ‘spontaneous’, ‘waived_fee’, etc.

§kind: PaymentKind

Application-level payment kind.

§direction: PaymentDirection

The payment direction: "inbound", "outbound", or "info".

§txid: Option<LxTxid>

(Onchain payments only) The hex-encoded Bitcoin txid.

§amount: Option<Amount>

The amount of this payment.

  • If this is a completed inbound invoice payment, this is the amount we received.
  • If this is a pending or failed inbound inbound invoice payment, this is the amount encoded in our invoice, which may be null.
  • For all other payment types, an amount is always included.
§fees: Amount

The fees for this payment.

  • For outbound Lightning payments, these are the routing fees. If the payment is not completed, this value is an estimation only. This value reflects the actual fees paid if and only if the payment completes.
  • For inbound Lightning payments, the routing fees are not paid by us (the recipient), but if a JIT channel open was required to facilitate this payment, then the on-chain fee is reflected here.
§status: PaymentStatus

The status of this payment: [“pending”, “completed”, “failed”].

§status_msg: String

The payment status as a human-readable message. These strings are customized per payment type, e.g. “invoice generated”, “timed out”

§address: Option<Arc<Address<NetworkUnchecked>>>

(Onchain send only) The address that we’re sending to.

§invoice: Option<Arc<LxInvoice>>

(Invoice payments only) The BOLT11 invoice used in this payment.

§tx: Option<Arc<Transaction>>

The on-chain transaction, if there is one. Always Some for on-chain sends and receives.

§note: Option<String>

An optional personal note which a user can attach to any payment. A note can always be added or modified when a payment already exists, but this may not always be possible at creation time.

§payer_name: Option<String>

(Offer payments only) The payer’s self-reported human-readable name.

§payer_note: Option<String>

(Offer payments only) A payer-provided note for this payment. LDK truncates this to 512 bytes.

§priority: Option<ConfirmationPriority>

(Onchain send only) The confirmation priority used for this payment.

§expires_at: Option<TimestampMs>

The invoice or offer expiry time. None otherwise, or if the timestamp overflows.

§finalized_at: Option<TimestampMs>

If this payment is finalized, meaning it is “completed” or “failed”, this is the time it was finalized, in milliseconds since the UNIX epoch.

§created_at: TimestampMs

When this payment was created.

§updated_at: TimestampMs

When this payment was last updated.

Trait Implementations§

§

impl<'de> Deserialize<'de> for SdkPayment

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SdkPayment, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<BasicPaymentV2> for SdkPayment

§

fn from(p: BasicPaymentV2) -> SdkPayment

Converts to this type from the input type.
§

impl Serialize for SdkPayment

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<F, T, U> Apply<F, U> for T
where F: FnOnce(T) -> U,

§

fn apply(self, f: F) -> U

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,