lightningdevkit
Version:
Lightning Development Kit
442 lines (441 loc) • 12.3 kB
text/typescript
import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs';
import { Result_InitFeaturesDecodeErrorZ } from '../structs/Result_InitFeaturesDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* Features used within an `init` message.
*/
export declare class InitFeatures extends CommonBase {
/**
* Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
*/
write(): Uint8Array;
/**
* Read a InitFeatures from a byte array, created by InitFeatures_write
*/
static constructor_read(ser: Uint8Array): Result_InitFeaturesDecodeErrorZ;
/**
* Checks if two InitFeaturess 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: InitFeatures): boolean;
clone_ptr(): bigint;
/**
* Creates a copy of the InitFeatures
*/
clone(): InitFeatures;
/**
* Generates a non-cryptographic 64-bit hash of the InitFeatures.
*/
hash(): bigint;
/**
* Create a blank Features with no features set
*/
static constructor_empty(): InitFeatures;
/**
* Returns the feature set as a list of bytes, in little-endian. This is in reverse byte order
* from most on-the-wire encodings.
*/
le_flags(): Uint8Array;
/**
* Returns true if this `Features` has any optional flags set
*/
supports_any_optional_bits(): boolean;
/**
* Returns true if this `Features` object contains required features unknown by `other`.
*/
requires_unknown_bits_from(other: InitFeatures): boolean;
/**
* Returns the set of required features unknown by `other`, as their bit position.
*/
required_unknown_bits_from(other: InitFeatures): BigUint64Array;
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
*/
requires_unknown_bits(): boolean;
/**
* Returns true if this `Features` supports any bits which we do not know of
*/
supports_unknown_bits(): boolean;
/**
* Sets a required feature bit. Errors if `bit` is outside the feature range as defined
* by [BOLT 9].
*
* Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
* be set instead (i.e., `bit - 1`).
*
* [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
*/
set_required_feature_bit(bit: number): Result_NoneNoneZ;
/**
* Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
* by [BOLT 9].
*
* Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
* set instead (i.e., `bit + 1`).
*
* [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
*/
set_optional_feature_bit(bit: number): Result_NoneNoneZ;
/**
* Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
* by [bLIP 2] or if it is a known `T` feature.
*
* Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
* be set instead (i.e., `bit - 1`).
*
* [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
*/
set_required_custom_bit(bit: number): Result_NoneNoneZ;
/**
* Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
* by [bLIP 2] or if it is a known `T` feature.
*
* Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
* set instead (i.e., `bit + 1`).
*
* [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
*/
set_optional_custom_bit(bit: number): Result_NoneNoneZ;
/**
* Unsets the `upfront_shutdown_script` feature
*/
clear_upfront_shutdown_script(): InitFeatures;
/**
* Unsets the `shutdown_anysegwit` feature
*/
clear_shutdown_anysegwit(): InitFeatures;
/**
* Unsets the `wumbo` feature
*/
clear_wumbo(): InitFeatures;
/**
* Unsets the `scid_privacy` feature
*/
clear_scid_privacy(): void;
/**
* Unsets the `anchors_zero_fee_htlc_tx` feature
*/
clear_anchors_zero_fee_htlc_tx(): void;
/**
* Unsets the `route_blinding` feature
*/
clear_route_blinding(): void;
/**
* Set this feature as optional.
*/
set_data_loss_protect_optional(): void;
/**
* Set this feature as required.
*/
set_data_loss_protect_required(): void;
/**
* Checks if this feature is supported.
*/
supports_data_loss_protect(): boolean;
/**
* Checks if this feature is required.
*/
requires_data_loss_protect(): boolean;
/**
* Set this feature as optional.
*/
set_initial_routing_sync_optional(): void;
/**
* Set this feature as required.
*/
set_initial_routing_sync_required(): void;
/**
* Checks if this feature is supported.
*/
initial_routing_sync(): boolean;
/**
* Set this feature as optional.
*/
set_upfront_shutdown_script_optional(): void;
/**
* Set this feature as required.
*/
set_upfront_shutdown_script_required(): void;
/**
* Checks if this feature is supported.
*/
supports_upfront_shutdown_script(): boolean;
/**
* Checks if this feature is required.
*/
requires_upfront_shutdown_script(): boolean;
/**
* Set this feature as optional.
*/
set_gossip_queries_optional(): void;
/**
* Set this feature as required.
*/
set_gossip_queries_required(): void;
/**
* Checks if this feature is supported.
*/
supports_gossip_queries(): boolean;
/**
* Checks if this feature is required.
*/
requires_gossip_queries(): boolean;
/**
* Set this feature as optional.
*/
set_variable_length_onion_optional(): void;
/**
* Set this feature as required.
*/
set_variable_length_onion_required(): void;
/**
* Checks if this feature is supported.
*/
supports_variable_length_onion(): boolean;
/**
* Checks if this feature is required.
*/
requires_variable_length_onion(): boolean;
/**
* Set this feature as optional.
*/
set_static_remote_key_optional(): void;
/**
* Set this feature as required.
*/
set_static_remote_key_required(): void;
/**
* Checks if this feature is supported.
*/
supports_static_remote_key(): boolean;
/**
* Checks if this feature is required.
*/
requires_static_remote_key(): boolean;
/**
* Set this feature as optional.
*/
set_payment_secret_optional(): void;
/**
* Set this feature as required.
*/
set_payment_secret_required(): void;
/**
* Checks if this feature is supported.
*/
supports_payment_secret(): boolean;
/**
* Checks if this feature is required.
*/
requires_payment_secret(): boolean;
/**
* Set this feature as optional.
*/
set_basic_mpp_optional(): void;
/**
* Set this feature as required.
*/
set_basic_mpp_required(): void;
/**
* Checks if this feature is supported.
*/
supports_basic_mpp(): boolean;
/**
* Checks if this feature is required.
*/
requires_basic_mpp(): boolean;
/**
* Set this feature as optional.
*/
set_wumbo_optional(): void;
/**
* Set this feature as required.
*/
set_wumbo_required(): void;
/**
* Checks if this feature is supported.
*/
supports_wumbo(): boolean;
/**
* Checks if this feature is required.
*/
requires_wumbo(): boolean;
/**
* Set this feature as optional.
*/
set_anchors_nonzero_fee_htlc_tx_optional(): void;
/**
* Set this feature as required.
*/
set_anchors_nonzero_fee_htlc_tx_required(): void;
/**
* Checks if this feature is supported.
*/
supports_anchors_nonzero_fee_htlc_tx(): boolean;
/**
* Checks if this feature is required.
*/
requires_anchors_nonzero_fee_htlc_tx(): boolean;
/**
* Set this feature as optional.
*/
set_anchors_zero_fee_htlc_tx_optional(): void;
/**
* Set this feature as required.
*/
set_anchors_zero_fee_htlc_tx_required(): void;
/**
* Checks if this feature is supported.
*/
supports_anchors_zero_fee_htlc_tx(): boolean;
/**
* Checks if this feature is required.
*/
requires_anchors_zero_fee_htlc_tx(): boolean;
/**
* Set this feature as optional.
*/
set_route_blinding_optional(): void;
/**
* Set this feature as required.
*/
set_route_blinding_required(): void;
/**
* Checks if this feature is supported.
*/
supports_route_blinding(): boolean;
/**
* Checks if this feature is required.
*/
requires_route_blinding(): boolean;
/**
* Set this feature as optional.
*/
set_shutdown_any_segwit_optional(): void;
/**
* Set this feature as required.
*/
set_shutdown_any_segwit_required(): void;
/**
* Checks if this feature is supported.
*/
supports_shutdown_anysegwit(): boolean;
/**
* Checks if this feature is required.
*/
requires_shutdown_anysegwit(): boolean;
/**
* Set this feature as optional.
*/
set_dual_fund_optional(): void;
/**
* Set this feature as required.
*/
set_dual_fund_required(): void;
/**
* Checks if this feature is supported.
*/
supports_dual_fund(): boolean;
/**
* Checks if this feature is required.
*/
requires_dual_fund(): boolean;
/**
* Set this feature as optional.
*/
set_taproot_optional(): void;
/**
* Set this feature as required.
*/
set_taproot_required(): void;
/**
* Checks if this feature is supported.
*/
supports_taproot(): boolean;
/**
* Checks if this feature is required.
*/
requires_taproot(): boolean;
/**
* Set this feature as optional.
*/
set_onion_messages_optional(): void;
/**
* Set this feature as required.
*/
set_onion_messages_required(): void;
/**
* Checks if this feature is supported.
*/
supports_onion_messages(): boolean;
/**
* Checks if this feature is required.
*/
requires_onion_messages(): boolean;
/**
* Set this feature as optional.
*/
set_channel_type_optional(): void;
/**
* Set this feature as required.
*/
set_channel_type_required(): void;
/**
* Checks if this feature is supported.
*/
supports_channel_type(): boolean;
/**
* Checks if this feature is required.
*/
requires_channel_type(): boolean;
/**
* Set this feature as optional.
*/
set_scid_privacy_optional(): void;
/**
* Set this feature as required.
*/
set_scid_privacy_required(): void;
/**
* Checks if this feature is supported.
*/
supports_scid_privacy(): boolean;
/**
* Checks if this feature is required.
*/
requires_scid_privacy(): boolean;
/**
* Set this feature as optional.
*/
set_zero_conf_optional(): void;
/**
* Set this feature as required.
*/
set_zero_conf_required(): void;
/**
* Checks if this feature is supported.
*/
supports_zero_conf(): boolean;
/**
* Checks if this feature is required.
*/
requires_zero_conf(): boolean;
/**
* Set this feature as optional.
*/
set_trampoline_routing_optional(): void;
/**
* Set this feature as required.
*/
set_trampoline_routing_required(): void;
/**
* Checks if this feature is supported.
*/
supports_trampoline_routing(): boolean;
/**
* Checks if this feature is required.
*/
requires_trampoline_routing(): boolean;
}