Enum lightning::util::events::PaymentPurpose[][src]

pub enum PaymentPurpose {
    InvoicePayment {
        payment_preimage: Option<PaymentPreimage>,
        payment_secret: PaymentSecret,
        user_payment_id: u64,
    },
    SpontaneousPayment(PaymentPreimage),
}
Expand description

Some information provided on receipt of payment depends on whether the payment received is a spontaneous payment or a “conventional” lightning payment that’s paying an invoice.

Variants

InvoicePayment

Information for receiving a payment that we generated an invoice for.

Fields of InvoicePayment

payment_preimage: Option<PaymentPreimage>

The preimage to the payment_hash, if the payment hash (and secret) were fetched via ChannelManager::create_inbound_payment. If provided, this can be handed directly to ChannelManager::claim_funds.

payment_secret: PaymentSecret

The “payment secret”. This authenticates the sender to the recipient, preventing a number of deanonymization attacks during the routing process. It is provided here for your reference, however its accuracy is enforced directly by ChannelManager using the values you previously provided to ChannelManager::create_inbound_payment or ChannelManager::create_inbound_payment_for_hash.

user_payment_id: u64

This is the user_payment_id which was provided to ChannelManager::create_inbound_payment_for_hash or ChannelManager::create_inbound_payment. It has no meaning inside of LDK and is simply copied here. It may be used to correlate PaymentReceived events with invoice metadata stored elsewhere.

SpontaneousPayment

Because this is a spontaneous payment, the payer generated their own preimage rather than us (the payee) providing a preimage.

Tuple Fields of SpontaneousPayment

0: PaymentPreimage

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.