UNPKG

lightningdevkit

Version:
26 lines (25 loc) 1.2 kB
import { NetworkGraph } from '../structs/NetworkGraph.mjs'; import { EntropySource } from '../structs/EntropySource.mjs'; import { MessageRouter } from '../structs/MessageRouter.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * A [`MessageRouter`] that can only route to a directly connected [`Destination`]. * * # Privacy * * Creating [`BlindedMessagePath`]s may affect privacy since, if a suitable path cannot be found, * it will create a one-hop path using the recipient as the introduction node if it is a announced * node. Otherwise, there is no way to find a path to the introduction node in order to send a * message, and thus an `Err` is returned. */ export declare class DefaultMessageRouter extends CommonBase { /** * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`]. */ static constructor_new(network_graph: NetworkGraph, entropy_source: EntropySource): DefaultMessageRouter; /** * Constructs a new MessageRouter which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is */ as_MessageRouter(): MessageRouter; }