UNPKG

lightningdevkit

Version:
111 lines (110 loc) 3.99 kB
import { NodeId } from '../structs/NodeId.mjs'; import { Result_UnsignedChannelAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mjs'; import { ChannelFeatures } from '../structs/ChannelFeatures.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * The unsigned part of a [`channel_announcement`] message. * * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message */ export declare class UnsignedChannelAnnouncement extends CommonBase { /** * The advertised channel features */ get_features(): ChannelFeatures; /** * The advertised channel features */ set_features(val: ChannelFeatures): void; /** * 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; /** * The short channel ID */ get_short_channel_id(): bigint; /** * The short channel ID */ set_short_channel_id(val: bigint): void; /** * One of the two `node_id`s which are endpoints of this channel */ get_node_id_1(): NodeId; /** * One of the two `node_id`s which are endpoints of this channel */ set_node_id_1(val: NodeId): void; /** * The other of the two `node_id`s which are endpoints of this channel */ get_node_id_2(): NodeId; /** * The other of the two `node_id`s which are endpoints of this channel */ set_node_id_2(val: NodeId): void; /** * The funding key for the first node */ get_bitcoin_key_1(): NodeId; /** * The funding key for the first node */ set_bitcoin_key_1(val: NodeId): void; /** * The funding key for the second node */ get_bitcoin_key_2(): NodeId; /** * The funding key for the second node */ set_bitcoin_key_2(val: NodeId): void; /** * Excess data which was signed as a part of the message which we do not (yet) understand how * to decode. * * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. * * Returns a copy of the field. */ get_excess_data(): Uint8Array; /** * Excess data which was signed as a part of the message which we do not (yet) understand how * to decode. * * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. */ set_excess_data(val: Uint8Array): void; /** * Constructs a new UnsignedChannelAnnouncement given each field */ static constructor_new(features_arg: ChannelFeatures, chain_hash_arg: Uint8Array, short_channel_id_arg: bigint, node_id_1_arg: NodeId, node_id_2_arg: NodeId, bitcoin_key_1_arg: NodeId, bitcoin_key_2_arg: NodeId, excess_data_arg: Uint8Array): UnsignedChannelAnnouncement; clone_ptr(): bigint; /** * Creates a copy of the UnsignedChannelAnnouncement */ clone(): UnsignedChannelAnnouncement; /** * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement. */ hash(): bigint; /** * Checks if two UnsignedChannelAnnouncements 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: UnsignedChannelAnnouncement): boolean; /** * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read */ write(): Uint8Array; /** * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write */ static constructor_read(ser: Uint8Array): Result_UnsignedChannelAnnouncementDecodeErrorZ; }