UNPKG

lightningdevkit

Version:
91 lines (90 loc) 4.22 kB
import { TxOut } from '../structs/TxOut.mjs'; import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs'; import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs'; import { OutPoint } from '../structs/OutPoint.mjs'; import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * Describes the necessary information to spend a spendable output. * * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able * to spend on-chain. The information needed to do this is provided in this enum, including the * outpoint describing which `txid` and output `index` is available, the full output which exists * at that `txid`/`index`, and any keys or other information required to sign. * * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs */ export declare class SpendableOutputDescriptor extends CommonBase { protected constructor(_dummy: null, ptr: bigint); clone_ptr(): bigint; /** * Creates a copy of the SpendableOutputDescriptor */ clone(): SpendableOutputDescriptor; /** * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor */ static constructor_static_output(outpoint: OutPoint, output: TxOut, channel_keys_id: Uint8Array): SpendableOutputDescriptor; /** * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor */ static constructor_delayed_payment_output(a: DelayedPaymentOutputDescriptor): SpendableOutputDescriptor; /** * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor */ static constructor_static_payment_output(a: StaticPaymentOutputDescriptor): SpendableOutputDescriptor; /** * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor. */ hash(): bigint; /** * Checks if two SpendableOutputDescriptors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ eq(b: SpendableOutputDescriptor): boolean; /** * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read */ write(): Uint8Array; /** * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write */ static constructor_read(ser: Uint8Array): Result_SpendableOutputDescriptorDecodeErrorZ; /** * Returns the outpoint of the spendable output. */ spendable_outpoint(): OutPoint; } /** A SpendableOutputDescriptor of type StaticOutput */ export declare class SpendableOutputDescriptor_StaticOutput extends SpendableOutputDescriptor { /** * The outpoint which is spendable. */ outpoint: OutPoint; /** * The output which is referenced by the given outpoint. */ output: TxOut; /** * The `channel_keys_id` for the channel which this output came from. * * For channels which were generated on LDK 0.0.119 or later, this is the value which was * passed to the [`SignerProvider::get_destination_script`] call which provided this * output script. * * For channels which were generated prior to LDK 0.0.119, no such argument existed, * however this field may still be filled in if such data is available. * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ channel_keys_id: Uint8Array; } /** A SpendableOutputDescriptor of type DelayedPaymentOutput */ export declare class SpendableOutputDescriptor_DelayedPaymentOutput extends SpendableOutputDescriptor { delayed_payment_output: DelayedPaymentOutputDescriptor; } /** A SpendableOutputDescriptor of type StaticPaymentOutput */ export declare class SpendableOutputDescriptor_StaticPaymentOutput extends SpendableOutputDescriptor { static_payment_output: StaticPaymentOutputDescriptor; }