lightningdevkit
Version:
Lightning Development Kit
209 lines (208 loc) • 8.61 kB
text/typescript
import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs';
import { ChannelId } from '../structs/ChannelId.mjs';
import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs';
import { ChannelParameters } from '../structs/ChannelParameters.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Contains fields that are both common to [`open_channel`] and [`open_channel2`] messages.
*
* [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
* [`open_channel2`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel2-message
*/
export declare class CommonOpenChannelFields extends CommonBase {
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
get_chain_hash(): Uint8Array;
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
set_chain_hash(val: Uint8Array): void;
/**
* A temporary channel ID
* For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
* For V1 channels: a temporary channel ID, until the funding outpoint is announced
*/
get_temporary_channel_id(): ChannelId;
/**
* A temporary channel ID
* For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint
* For V1 channels: a temporary channel ID, until the funding outpoint is announced
*/
set_temporary_channel_id(val: ChannelId): void;
/**
* For V1 channels: The channel value
* For V2 channels: Part of the channel value contributed by the channel initiator
*/
get_funding_satoshis(): bigint;
/**
* For V1 channels: The channel value
* For V2 channels: Part of the channel value contributed by the channel initiator
*/
set_funding_satoshis(val: bigint): void;
/**
* The threshold below which outputs on transactions broadcast by the channel initiator will be
* omitted
*/
get_dust_limit_satoshis(): bigint;
/**
* The threshold below which outputs on transactions broadcast by the channel initiator will be
* omitted
*/
set_dust_limit_satoshis(val: bigint): void;
/**
* The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
*/
get_max_htlc_value_in_flight_msat(): bigint;
/**
* The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
*/
set_max_htlc_value_in_flight_msat(val: bigint): void;
/**
* The minimum HTLC size incoming to channel initiator, in milli-satoshi
*/
get_htlc_minimum_msat(): bigint;
/**
* The minimum HTLC size incoming to channel initiator, in milli-satoshi
*/
set_htlc_minimum_msat(val: bigint): void;
/**
* The feerate for the commitment transaction set by the channel initiator until updated by
* [`UpdateFee`]
*/
get_commitment_feerate_sat_per_1000_weight(): number;
/**
* The feerate for the commitment transaction set by the channel initiator until updated by
* [`UpdateFee`]
*/
set_commitment_feerate_sat_per_1000_weight(val: number): void;
/**
* The number of blocks which the counterparty will have to wait to claim on-chain funds if they
* broadcast a commitment transaction
*/
get_to_self_delay(): number;
/**
* The number of blocks which the counterparty will have to wait to claim on-chain funds if they
* broadcast a commitment transaction
*/
set_to_self_delay(val: number): void;
/**
* The maximum number of inbound HTLCs towards channel initiator
*/
get_max_accepted_htlcs(): number;
/**
* The maximum number of inbound HTLCs towards channel initiator
*/
set_max_accepted_htlcs(val: number): void;
/**
* The channel initiator's key controlling the funding transaction
*/
get_funding_pubkey(): Uint8Array;
/**
* The channel initiator's key controlling the funding transaction
*/
set_funding_pubkey(val: Uint8Array): void;
/**
* Used to derive a revocation key for transactions broadcast by counterparty
*/
get_revocation_basepoint(): Uint8Array;
/**
* Used to derive a revocation key for transactions broadcast by counterparty
*/
set_revocation_basepoint(val: Uint8Array): void;
/**
* A payment key to channel initiator for transactions broadcast by counterparty
*/
get_payment_basepoint(): Uint8Array;
/**
* A payment key to channel initiator for transactions broadcast by counterparty
*/
set_payment_basepoint(val: Uint8Array): void;
/**
* Used to derive a payment key to channel initiator for transactions broadcast by channel
* initiator
*/
get_delayed_payment_basepoint(): Uint8Array;
/**
* Used to derive a payment key to channel initiator for transactions broadcast by channel
* initiator
*/
set_delayed_payment_basepoint(val: Uint8Array): void;
/**
* Used to derive an HTLC payment key to channel initiator
*/
get_htlc_basepoint(): Uint8Array;
/**
* Used to derive an HTLC payment key to channel initiator
*/
set_htlc_basepoint(val: Uint8Array): void;
/**
* The first to-be-broadcast-by-channel-initiator transaction's per commitment point
*/
get_first_per_commitment_point(): Uint8Array;
/**
* The first to-be-broadcast-by-channel-initiator transaction's per commitment point
*/
set_first_per_commitment_point(val: Uint8Array): void;
/**
* The channel flags to be used
*/
get_channel_flags(): number;
/**
* The channel flags to be used
*/
set_channel_flags(val: number): void;
/**
* Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
* collaboratively close
*/
get_shutdown_scriptpubkey(): Option_CVec_u8ZZ;
/**
* Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
* collaboratively close
*/
set_shutdown_scriptpubkey(val: Option_CVec_u8ZZ): void;
/**
* The channel type that this channel will represent
*
* If this is `None`, we derive the channel type from the intersection of our
* feature bits with our counterparty's feature bits from the [`Init`] message.
*
* Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
get_channel_type(): ChannelTypeFeatures;
/**
* The channel type that this channel will represent
*
* If this is `None`, we derive the channel type from the intersection of our
* feature bits with our counterparty's feature bits from the [`Init`] message.
*
* Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
set_channel_type(val: ChannelTypeFeatures | null): void;
/**
* Constructs a new CommonOpenChannelFields given each field
*
* Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
static constructor_new(chain_hash_arg: Uint8Array, temporary_channel_id_arg: ChannelId, funding_satoshis_arg: bigint, dust_limit_satoshis_arg: bigint, max_htlc_value_in_flight_msat_arg: bigint, htlc_minimum_msat_arg: bigint, commitment_feerate_sat_per_1000_weight_arg: number, to_self_delay_arg: number, max_accepted_htlcs_arg: number, funding_pubkey_arg: Uint8Array, revocation_basepoint_arg: Uint8Array, payment_basepoint_arg: Uint8Array, delayed_payment_basepoint_arg: Uint8Array, htlc_basepoint_arg: Uint8Array, first_per_commitment_point_arg: Uint8Array, channel_flags_arg: number, shutdown_scriptpubkey_arg: Option_CVec_u8ZZ, channel_type_arg: ChannelTypeFeatures | null): CommonOpenChannelFields;
clone_ptr(): bigint;
/**
* Creates a copy of the CommonOpenChannelFields
*/
clone(): CommonOpenChannelFields;
/**
* Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields.
*/
hash(): bigint;
/**
* Checks if two CommonOpenChannelFieldss 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: CommonOpenChannelFields): boolean;
/**
* The [`ChannelParameters`] for this channel.
*/
channel_parameters(): ChannelParameters;
}