UNPKG

lightningdevkit

Version:
108 lines (107 loc) 4.71 kB
import { TxOut } from '../structs/TxOut.mjs'; import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs'; import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs'; import { OutPoint } from '../structs/OutPoint.mjs'; import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * Information about a spendable output to our \"payment key\". * * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this. */ export declare class StaticPaymentOutputDescriptor extends CommonBase { /** * The outpoint which is spendable. */ get_outpoint(): OutPoint; /** * The outpoint which is spendable. */ set_outpoint(val: OutPoint): void; /** * The output which is referenced by the given outpoint. */ get_output(): TxOut; /** * The output which is referenced by the given outpoint. */ set_output(val: TxOut): void; /** * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ get_channel_keys_id(): Uint8Array; /** * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`]. * This may be useful in re-deriving keys used in the channel to spend the output. */ set_channel_keys_id(val: Uint8Array): void; /** * The value of the channel which this transactions spends. */ get_channel_value_satoshis(): bigint; /** * The value of the channel which this transactions spends. */ set_channel_value_satoshis(val: bigint): void; /** * The necessary channel parameters that need to be provided to the re-derived signer through * [`ChannelSigner::provide_channel_parameters`]. * * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later. * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ get_channel_transaction_parameters(): ChannelTransactionParameters; /** * The necessary channel parameters that need to be provided to the re-derived signer through * [`ChannelSigner::provide_channel_parameters`]. * * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later. * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ set_channel_transaction_parameters(val: ChannelTransactionParameters | null): void; /** * Constructs a new StaticPaymentOutputDescriptor given each field * * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ static constructor_new(outpoint_arg: OutPoint, output_arg: TxOut, channel_keys_id_arg: Uint8Array, channel_value_satoshis_arg: bigint, channel_transaction_parameters_arg: ChannelTransactionParameters | null): StaticPaymentOutputDescriptor; clone_ptr(): bigint; /** * Creates a copy of the StaticPaymentOutputDescriptor */ clone(): StaticPaymentOutputDescriptor; /** * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor. */ hash(): bigint; /** * Checks if two StaticPaymentOutputDescriptors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ eq(b: StaticPaymentOutputDescriptor): boolean; /** * Returns the `witness_script` of the spendable output. * * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that * originated from an anchor outputs channel, as they take the form of a P2WSH script. */ witness_script(): Option_CVec_u8ZZ; /** * The maximum length a well-formed witness spending one of these should have. * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte * shorter. */ max_witness_length(): bigint; /** * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read */ write(): Uint8Array; /** * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write */ static constructor_read(ser: Uint8Array): Result_StaticPaymentOutputDescriptorDecodeErrorZ; }