lightningdevkit
Version:
Lightning Development Kit
129 lines (128 loc) • 4.75 kB
text/typescript
import { NodeId } from '../structs/NodeId.mjs';
import { SocketAddress } from '../structs/SocketAddress.mjs';
import { NodeAlias } from '../structs/NodeAlias.mjs';
import { Result_UnsignedNodeAnnouncementDecodeErrorZ } from '../structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mjs';
import { NodeFeatures } from '../structs/NodeFeatures.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* The unsigned part of a [`node_announcement`] message.
*
* [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
*/
export declare class UnsignedNodeAnnouncement extends CommonBase {
/**
* The advertised features
*/
get_features(): NodeFeatures;
/**
* The advertised features
*/
set_features(val: NodeFeatures): void;
/**
* A strictly monotonic announcement counter, with gaps allowed
*/
get_timestamp(): number;
/**
* A strictly monotonic announcement counter, with gaps allowed
*/
set_timestamp(val: number): void;
/**
* The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
* to this node).
*/
get_node_id(): NodeId;
/**
* The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
* to this node).
*/
set_node_id(val: NodeId): void;
/**
* An RGB color for UI purposes
*/
get_rgb(): Uint8Array;
/**
* An RGB color for UI purposes
*/
set_rgb(val: Uint8Array): void;
/**
* An alias, for UI purposes.
*
* This should be sanitized before use. There is no guarantee of uniqueness.
*/
get_alias(): NodeAlias;
/**
* An alias, for UI purposes.
*
* This should be sanitized before use. There is no guarantee of uniqueness.
*/
set_alias(val: NodeAlias): void;
/**
* List of addresses on which this node is reachable
*
* Returns a copy of the field.
*/
get_addresses(): SocketAddress[];
/**
* List of addresses on which this node is reachable
*/
set_addresses(val: SocketAddress[]): void;
/**
* Excess address 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 address types are added to the lightning gossip protocol.
*
* Returns a copy of the field.
*/
get_excess_address_data(): Uint8Array;
/**
* Excess address 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 address types are added to the lightning gossip protocol.
*/
set_excess_address_data(val: Uint8Array): 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 UnsignedNodeAnnouncement given each field
*/
static constructor_new(features_arg: NodeFeatures, timestamp_arg: number, node_id_arg: NodeId, rgb_arg: Uint8Array, alias_arg: NodeAlias, addresses_arg: SocketAddress[], excess_address_data_arg: Uint8Array, excess_data_arg: Uint8Array): UnsignedNodeAnnouncement;
clone_ptr(): bigint;
/**
* Creates a copy of the UnsignedNodeAnnouncement
*/
clone(): UnsignedNodeAnnouncement;
/**
* Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
*/
hash(): bigint;
/**
* Checks if two UnsignedNodeAnnouncements 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: UnsignedNodeAnnouncement): boolean;
/**
* Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
*/
write(): Uint8Array;
/**
* Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
*/
static constructor_read(ser: Uint8Array): Result_UnsignedNodeAnnouncementDecodeErrorZ;
}