Package org.ldk.structs
Class PaymentPurpose
- java.lang.Object
-
- org.ldk.structs.PaymentPurpose
-
- Direct Known Subclasses:
PaymentPurpose.InvoicePayment,PaymentPurpose.SpontaneousPayment
public class PaymentPurpose extends Object
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPaymentPurpose.InvoicePaymentInformation for receiving a payment that we generated an invoice for.static classPaymentPurpose.SpontaneousPaymentBecause this is a spontaneous payment, the payer generated their own preimage rather than us (the payee) providing a preimage.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentPurposeclone()Creates a copy of the PaymentPurposeprotected voidfinalize()static PaymentPurposeinvoice_payment(byte[] payment_preimage, byte[] payment_secret)Utility method to constructs a new InvoicePayment-variant PaymentPurposestatic Result_PaymentPurposeDecodeErrorZread(byte[] ser)Read a PaymentPurpose from a byte array, created by PaymentPurpose_writestatic PaymentPurposespontaneous_payment(byte[] a)Utility method to constructs a new SpontaneousPayment-variant PaymentPurposebyte[]write()Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public PaymentPurpose clone()
Creates a copy of the PaymentPurpose
-
invoice_payment
public static PaymentPurpose invoice_payment(byte[] payment_preimage, byte[] payment_secret)
Utility method to constructs a new InvoicePayment-variant PaymentPurpose
-
spontaneous_payment
public static PaymentPurpose spontaneous_payment(byte[] a)
Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
-
write
public byte[] write()
Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
-
read
public static Result_PaymentPurposeDecodeErrorZ read(byte[] ser)
Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
-
-