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: PaymentCreatedIndexUnique 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: LxPaymentIdUnordered payment identifier.
You should prefer to use index instead of this.
rail: PaymentRailThe technical ‘rail’ used to fulfill a payment: ‘onchain’, ‘invoice’, ‘offer’, ‘spontaneous’, ‘waived_fee’, etc.
kind: PaymentKindApplication-level payment kind.
direction: PaymentDirectionThe 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: AmountThe 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: PaymentStatusThe status of this payment: [“pending”, “completed”, “failed”].
status_msg: StringThe 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: TimestampMsWhen this payment was created.
updated_at: TimestampMsWhen this payment was last updated.