lightningdevkit
Version:
Lightning Development Kit
48 lines (47 loc) • 1.91 kB
text/typescript
import { Bolt12OfferContext } from '../structs/Bolt12OfferContext.mjs';
import { Bolt12RefundContext } from '../structs/Bolt12RefundContext.mjs';
import { Result_PaymentContextDecodeErrorZ } from '../structs/Result_PaymentContextDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* The context of an inbound payment, which is included in a [`BlindedPaymentPath`] via
* [`ReceiveTlvs`] and surfaced in [`PaymentPurpose`].
*
* [`PaymentPurpose`]: crate::events::PaymentPurpose
*/
export declare class PaymentContext extends CommonBase {
protected constructor(_dummy: null, ptr: bigint);
clone_ptr(): bigint;
/**
* Creates a copy of the PaymentContext
*/
clone(): PaymentContext;
/**
* Utility method to constructs a new Bolt12Offer-variant PaymentContext
*/
static constructor_bolt12_offer(a: Bolt12OfferContext): PaymentContext;
/**
* Utility method to constructs a new Bolt12Refund-variant PaymentContext
*/
static constructor_bolt12_refund(a: Bolt12RefundContext): PaymentContext;
/**
* Checks if two PaymentContexts contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
eq(b: PaymentContext): boolean;
/**
* Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read
*/
write(): Uint8Array;
/**
* Read a PaymentContext from a byte array, created by PaymentContext_write
*/
static constructor_read(ser: Uint8Array): Result_PaymentContextDecodeErrorZ;
}
/** A PaymentContext of type Bolt12Offer */
export declare class PaymentContext_Bolt12Offer extends PaymentContext {
bolt12_offer: Bolt12OfferContext;
}
/** A PaymentContext of type Bolt12Refund */
export declare class PaymentContext_Bolt12Refund extends PaymentContext {
bolt12_refund: Bolt12RefundContext;
}