lightningdevkit
Version:
Lightning Development Kit
128 lines (127 loc) • 5.42 kB
text/typescript
import { Result_RouteHopDecodeErrorZ } from '../structs/Result_RouteHopDecodeErrorZ.mjs';
import { ChannelFeatures } from '../structs/ChannelFeatures.mjs';
import { NodeFeatures } from '../structs/NodeFeatures.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
* that leads to it.
*/
export declare class RouteHop extends CommonBase {
/**
* The node_id of the node at this hop.
*/
get_pubkey(): Uint8Array;
/**
* The node_id of the node at this hop.
*/
set_pubkey(val: Uint8Array): void;
/**
* The node_announcement features of the node at this hop. For the last hop, these may be
* amended to match the features present in the invoice this node generated.
*/
get_node_features(): NodeFeatures;
/**
* The node_announcement features of the node at this hop. For the last hop, these may be
* amended to match the features present in the invoice this node generated.
*/
set_node_features(val: NodeFeatures): void;
/**
* The channel that should be used from the previous hop to reach this node.
*/
get_short_channel_id(): bigint;
/**
* The channel that should be used from the previous hop to reach this node.
*/
set_short_channel_id(val: bigint): void;
/**
* The channel_announcement features of the channel that should be used from the previous hop
* to reach this node.
*/
get_channel_features(): ChannelFeatures;
/**
* The channel_announcement features of the channel that should be used from the previous hop
* to reach this node.
*/
set_channel_features(val: ChannelFeatures): void;
/**
* The fee taken on this hop (for paying for the use of the *next* channel in the path).
* If this is the last hop in [`Path::hops`]:
* if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire
* blinded path
* otherwise, this is the full value of this [`Path`]'s part of the payment
*/
get_fee_msat(): bigint;
/**
* The fee taken on this hop (for paying for the use of the *next* channel in the path).
* If this is the last hop in [`Path::hops`]:
* if we're sending to a [`BlindedPaymentPath`], this is the fee paid for use of the entire
* blinded path
* otherwise, this is the full value of this [`Path`]'s part of the payment
*/
set_fee_msat(val: bigint): void;
/**
* The CLTV delta added for this hop.
* If this is the last hop in [`Path::hops`]:
* if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded
* path
* otherwise, this is the CLTV delta expected at the destination
*/
get_cltv_expiry_delta(): number;
/**
* The CLTV delta added for this hop.
* If this is the last hop in [`Path::hops`]:
* if we're sending to a [`BlindedPaymentPath`], this is the CLTV delta for the entire blinded
* path
* otherwise, this is the CLTV delta expected at the destination
*/
set_cltv_expiry_delta(val: number): void;
/**
* Indicates whether this hop is possibly announced in the public network graph.
*
* Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
* either know for sure it's announced in the public graph, or if any public channels exist
* for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
* the channel to be unannounced.
*
* Will be `true` for objects serialized with LDK version 0.0.116 and before.
*/
get_maybe_announced_channel(): boolean;
/**
* Indicates whether this hop is possibly announced in the public network graph.
*
* Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
* either know for sure it's announced in the public graph, or if any public channels exist
* for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
* the channel to be unannounced.
*
* Will be `true` for objects serialized with LDK version 0.0.116 and before.
*/
set_maybe_announced_channel(val: boolean): void;
/**
* Constructs a new RouteHop given each field
*/
static constructor_new(pubkey_arg: Uint8Array, node_features_arg: NodeFeatures, short_channel_id_arg: bigint, channel_features_arg: ChannelFeatures, fee_msat_arg: bigint, cltv_expiry_delta_arg: number, maybe_announced_channel_arg: boolean): RouteHop;
clone_ptr(): bigint;
/**
* Creates a copy of the RouteHop
*/
clone(): RouteHop;
/**
* Generates a non-cryptographic 64-bit hash of the RouteHop.
*/
hash(): bigint;
/**
* Checks if two RouteHops 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: RouteHop): boolean;
/**
* Serialize the RouteHop object into a byte array which can be read by RouteHop_read
*/
write(): Uint8Array;
/**
* Read a RouteHop from a byte array, created by RouteHop_write
*/
static constructor_read(ser: Uint8Array): Result_RouteHopDecodeErrorZ;
}