feat(extensions): add extension loader infrastructure (#3)
Some checks are pending
Docker Compose Actions Workflow / test (push) Waiting to run

## Summary

- Adds a modular extension system for Lightning.Pub enabling third-party plugins
- Provides isolated SQLite databases per extension for data safety
- Implements ExtensionContext API for accessing Lightning.Pub services (payments, Nostr, storage)
- Supports RPC method registration with automatic namespacing
- Includes HTTP route handling for protocols like LNURL
- Event routing for payment receipts and Nostr events
- Comprehensive documentation with architecture overview and working examples

## Key Components

- `src/extensions/types.ts` - Core extension interfaces
- `src/extensions/loader.ts` - Extension discovery, loading, and lifecycle management
- `src/extensions/context.ts` - Bridge between extensions and Lightning.Pub services
- `src/extensions/database.ts` - SQLite isolation with WAL mode
- `src/extensions/README.md` - Full documentation with examples

## ExtensionContext API

| Method | Description |
|--------|-------------|
| `getApplication()` | Get application info |
| `createInvoice()` | Create Lightning invoice |
| `payInvoice()` | Pay Lightning invoice |
| `getLnurlPayInfo()` | Get LNURL-pay info for a user (enables Lightning Address/zaps) |
| `sendEncryptedDM()` | Send Nostr DM (NIP-44) |
| `publishNostrEvent()` | Publish Nostr event |
| `registerMethod()` | Register RPC method |
| `onPaymentReceived()` | Subscribe to payment callbacks |
| `onNostrEvent()` | Subscribe to Nostr events |

## Test plan

- [x] Review extension loader code for correctness
- [x] Verify TypeScript compilation succeeds
- [x] Test extension discovery from `src/extensions/` directory
- [x] Test RPC method registration and routing
- [x] Test database isolation between extensions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: boufni95 <boufni95@gmail.com>
Co-authored-by: Patrick Mulligan <patjmulligan@protonmail.com>
Reviewed-on: #3
This commit is contained in:
padreug 2026-04-02 18:47:55 +00:00
parent 72c9872b23
commit 77e5772afd
47 changed files with 10187 additions and 4828 deletions

View file

@ -1,9 +1,13 @@
// @generated by protobuf-ts 2.8.1
// @generated by protobuf-ts 2.11.1
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Router } from "./router.js";
import type { DeleteAliasesResponse } from "./router.js";
import type { DeleteAliasesRequest } from "./router.js";
import type { AddAliasesResponse } from "./router.js";
import type { AddAliasesRequest } from "./router.js";
import type { UpdateChanStatusResponse } from "./router.js";
import type { UpdateChanStatusRequest } from "./router.js";
import type { ForwardHtlcInterceptRequest } from "./router.js";
@ -39,6 +43,23 @@ import type { Payment } from "./lightning.js";
import type { SendPaymentRequest } from "./router.js";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
//
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/**
* Router is a service that offers advanced interaction with the router
* subsystem of the daemon.
@ -50,17 +71,20 @@ export interface IRouterClient {
*
* SendPaymentV2 attempts to route a payment described by the passed
* PaymentRequest to the final destination. The call returns a stream of
* payment updates.
* payment updates. When using this RPC, make sure to set a fee limit, as the
* default routing fee limit is 0 sats. Without a non-zero fee limit only
* routes without fees will be attempted which often fails with
* FAILURE_REASON_NO_ROUTE.
*
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: SendPaymentV2
*/
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment>;
/**
*
* lncli: `trackpayment`
* TrackPaymentV2 returns an update stream for the payment identified by the
* payment hash.
*
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: TrackPaymentV2
*/
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment>;
/**
@ -72,7 +96,7 @@ export interface IRouterClient {
* payment attempt make sure to subscribe to this method before initiating any
* payments.
*
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: TrackPayments
*/
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment>;
/**
@ -80,7 +104,7 @@ export interface IRouterClient {
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
* may cost to send an HTLC to the target end destination.
*
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
* @generated from protobuf rpc: EstimateRouteFee
*/
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse>;
/**
@ -92,7 +116,7 @@ export interface IRouterClient {
* SendToRouteV2 in that it doesn't return the full HTLC information.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
* @generated from protobuf rpc: SendToRoute
*/
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse>;
/**
@ -102,65 +126,71 @@ export interface IRouterClient {
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
* @generated from protobuf rpc: SendToRouteV2
*/
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt>;
/**
*
* lncli: `resetmc`
* ResetMissionControl clears all mission control state and starts with a clean
* slate.
*
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
* @generated from protobuf rpc: ResetMissionControl
*/
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse>;
/**
*
* lncli: `querymc`
* QueryMissionControl exposes the internal mission control state to callers.
* It is a development feature.
*
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
* @generated from protobuf rpc: QueryMissionControl
*/
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse>;
/**
*
* lncli: `importmc`
* XImportMissionControl is an experimental API that imports the state provided
* to the internal mission control's state, using all results which are more
* recent than our existing values. These values will only be imported
* in-memory, and will not be persisted across restarts.
*
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
* @generated from protobuf rpc: XImportMissionControl
*/
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse>;
/**
*
* lncli: `getmccfg`
* GetMissionControlConfig returns mission control's current config.
*
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
* @generated from protobuf rpc: GetMissionControlConfig
*/
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse>;
/**
*
* lncli: `setmccfg`
* SetMissionControlConfig will set mission control's config, if the config
* provided is valid.
*
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
* @generated from protobuf rpc: SetMissionControlConfig
*/
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse>;
/**
* lncli: `queryprob`
* Deprecated. QueryProbability returns the current success probability
* estimate for a given node pair and amount. The call returns a zero success
* probability if no channel is available or if the amount violates min/max
* HTLC constraints.
*
* QueryProbability returns the current success probability estimate for a
* given node pair and amount.
*
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
* @generated from protobuf rpc: QueryProbability
*/
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse>;
/**
*
* lncli: `buildroute`
* BuildRoute builds a fully specified route based on a list of hop public
* keys. It retrieves the relevant channel policies from the graph in order to
* calculate the correct fees and time locks.
* Note that LND will use its default final_cltv_delta if no value is supplied.
* Make sure to add the correct final_cltv_delta depending on the invoice
* restriction. Moreover the caller has to make sure to provide the
* payment_addr if the route is paying an invoice which signaled it.
*
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
* @generated from protobuf rpc: BuildRoute
*/
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse>;
/**
@ -168,7 +198,7 @@ export interface IRouterClient {
* SubscribeHtlcEvents creates a uni-directional stream from the server to
* the client which delivers a stream of htlc events.
*
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
* @generated from protobuf rpc: SubscribeHtlcEvents
*/
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent>;
/**
@ -178,7 +208,7 @@ export interface IRouterClient {
* returns a stream of payment status updates.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
* @generated from protobuf rpc: SendPayment
*/
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus>;
/**
@ -187,7 +217,7 @@ export interface IRouterClient {
* the payment identified by the payment hash.
*
* @deprecated
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
* @generated from protobuf rpc: TrackPayment
*/
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus>;
/**
@ -198,20 +228,59 @@ export interface IRouterClient {
* In case of interception, the htlc can be either settled, cancelled or
* resumed later by using the ResolveHoldForward endpoint.
*
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
* @generated from protobuf rpc: HtlcInterceptor
*/
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>;
/**
*
* lncli: `updatechanstatus`
* UpdateChanStatus attempts to manually set the state of a channel
* (enabled, disabled, or auto). A manual "disable" request will cause the
* channel to stay disabled until a subsequent manual request of either
* "enable" or "auto".
*
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
* @generated from protobuf rpc: UpdateChanStatus
*/
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse>;
/**
*
* XAddLocalChanAliases is an experimental API that creates a set of new
* channel SCID alias mappings. The final total set of aliases in the manager
* after the add operation is returned. This is only a locally stored alias,
* and will not be communicated to the channel peer via any message. Therefore,
* routing over such an alias will only work if the peer also calls this same
* RPC on their end. If an alias already exists, an error is returned
*
* @generated from protobuf rpc: XAddLocalChanAliases
*/
xAddLocalChanAliases(input: AddAliasesRequest, options?: RpcOptions): UnaryCall<AddAliasesRequest, AddAliasesResponse>;
/**
*
* XDeleteLocalChanAliases is an experimental API that deletes a set of alias
* mappings. The final total set of aliases in the manager after the delete
* operation is returned. The deletion will not be communicated to the channel
* peer via any message.
*
* @generated from protobuf rpc: XDeleteLocalChanAliases
*/
xDeleteLocalChanAliases(input: DeleteAliasesRequest, options?: RpcOptions): UnaryCall<DeleteAliasesRequest, DeleteAliasesResponse>;
}
//
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/**
* Router is a service that offers advanced interaction with the router
* subsystem of the daemon.
@ -228,20 +297,23 @@ export class RouterClient implements IRouterClient, ServiceInfo {
*
* SendPaymentV2 attempts to route a payment described by the passed
* PaymentRequest to the final destination. The call returns a stream of
* payment updates.
* payment updates. When using this RPC, make sure to set a fee limit, as the
* default routing fee limit is 0 sats. Without a non-zero fee limit only
* routes without fees will be attempted which often fails with
* FAILURE_REASON_NO_ROUTE.
*
* @generated from protobuf rpc: SendPaymentV2(routerrpc.SendPaymentRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: SendPaymentV2
*/
sendPaymentV2(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, Payment> {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept<SendPaymentRequest, Payment>("serverStreaming", this._transport, method, opt, input);
}
/**
*
* lncli: `trackpayment`
* TrackPaymentV2 returns an update stream for the payment identified by the
* payment hash.
*
* @generated from protobuf rpc: TrackPaymentV2(routerrpc.TrackPaymentRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: TrackPaymentV2
*/
trackPaymentV2(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, Payment> {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
@ -256,7 +328,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* payment attempt make sure to subscribe to this method before initiating any
* payments.
*
* @generated from protobuf rpc: TrackPayments(routerrpc.TrackPaymentsRequest) returns (stream lnrpc.Payment);
* @generated from protobuf rpc: TrackPayments
*/
trackPayments(input: TrackPaymentsRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentsRequest, Payment> {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
@ -267,7 +339,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
* may cost to send an HTLC to the target end destination.
*
* @generated from protobuf rpc: EstimateRouteFee(routerrpc.RouteFeeRequest) returns (routerrpc.RouteFeeResponse);
* @generated from protobuf rpc: EstimateRouteFee
*/
estimateRouteFee(input: RouteFeeRequest, options?: RpcOptions): UnaryCall<RouteFeeRequest, RouteFeeResponse> {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
@ -282,7 +354,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* SendToRouteV2 in that it doesn't return the full HTLC information.
*
* @deprecated
* @generated from protobuf rpc: SendToRoute(routerrpc.SendToRouteRequest) returns (routerrpc.SendToRouteResponse);
* @generated from protobuf rpc: SendToRoute
*/
sendToRoute(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendToRouteResponse> {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
@ -295,86 +367,92 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* route manually. This can be used for things like rebalancing, and atomic
* swaps.
*
* @generated from protobuf rpc: SendToRouteV2(routerrpc.SendToRouteRequest) returns (lnrpc.HTLCAttempt);
* @generated from protobuf rpc: SendToRouteV2
*/
sendToRouteV2(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, HTLCAttempt> {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept<SendToRouteRequest, HTLCAttempt>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `resetmc`
* ResetMissionControl clears all mission control state and starts with a clean
* slate.
*
* @generated from protobuf rpc: ResetMissionControl(routerrpc.ResetMissionControlRequest) returns (routerrpc.ResetMissionControlResponse);
* @generated from protobuf rpc: ResetMissionControl
*/
resetMissionControl(input: ResetMissionControlRequest, options?: RpcOptions): UnaryCall<ResetMissionControlRequest, ResetMissionControlResponse> {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept<ResetMissionControlRequest, ResetMissionControlResponse>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `querymc`
* QueryMissionControl exposes the internal mission control state to callers.
* It is a development feature.
*
* @generated from protobuf rpc: QueryMissionControl(routerrpc.QueryMissionControlRequest) returns (routerrpc.QueryMissionControlResponse);
* @generated from protobuf rpc: QueryMissionControl
*/
queryMissionControl(input: QueryMissionControlRequest, options?: RpcOptions): UnaryCall<QueryMissionControlRequest, QueryMissionControlResponse> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<QueryMissionControlRequest, QueryMissionControlResponse>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `importmc`
* XImportMissionControl is an experimental API that imports the state provided
* to the internal mission control's state, using all results which are more
* recent than our existing values. These values will only be imported
* in-memory, and will not be persisted across restarts.
*
* @generated from protobuf rpc: XImportMissionControl(routerrpc.XImportMissionControlRequest) returns (routerrpc.XImportMissionControlResponse);
* @generated from protobuf rpc: XImportMissionControl
*/
xImportMissionControl(input: XImportMissionControlRequest, options?: RpcOptions): UnaryCall<XImportMissionControlRequest, XImportMissionControlResponse> {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept<XImportMissionControlRequest, XImportMissionControlResponse>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `getmccfg`
* GetMissionControlConfig returns mission control's current config.
*
* @generated from protobuf rpc: GetMissionControlConfig(routerrpc.GetMissionControlConfigRequest) returns (routerrpc.GetMissionControlConfigResponse);
* @generated from protobuf rpc: GetMissionControlConfig
*/
getMissionControlConfig(input: GetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<GetMissionControlConfigRequest, GetMissionControlConfigResponse> {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept<GetMissionControlConfigRequest, GetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `setmccfg`
* SetMissionControlConfig will set mission control's config, if the config
* provided is valid.
*
* @generated from protobuf rpc: SetMissionControlConfig(routerrpc.SetMissionControlConfigRequest) returns (routerrpc.SetMissionControlConfigResponse);
* @generated from protobuf rpc: SetMissionControlConfig
*/
setMissionControlConfig(input: SetMissionControlConfigRequest, options?: RpcOptions): UnaryCall<SetMissionControlConfigRequest, SetMissionControlConfigResponse> {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept<SetMissionControlConfigRequest, SetMissionControlConfigResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `queryprob`
* Deprecated. QueryProbability returns the current success probability
* estimate for a given node pair and amount. The call returns a zero success
* probability if no channel is available or if the amount violates min/max
* HTLC constraints.
*
* QueryProbability returns the current success probability estimate for a
* given node pair and amount.
*
* @generated from protobuf rpc: QueryProbability(routerrpc.QueryProbabilityRequest) returns (routerrpc.QueryProbabilityResponse);
* @generated from protobuf rpc: QueryProbability
*/
queryProbability(input: QueryProbabilityRequest, options?: RpcOptions): UnaryCall<QueryProbabilityRequest, QueryProbabilityResponse> {
const method = this.methods[11], opt = this._transport.mergeOptions(options);
return stackIntercept<QueryProbabilityRequest, QueryProbabilityResponse>("unary", this._transport, method, opt, input);
}
/**
*
* lncli: `buildroute`
* BuildRoute builds a fully specified route based on a list of hop public
* keys. It retrieves the relevant channel policies from the graph in order to
* calculate the correct fees and time locks.
* Note that LND will use its default final_cltv_delta if no value is supplied.
* Make sure to add the correct final_cltv_delta depending on the invoice
* restriction. Moreover the caller has to make sure to provide the
* payment_addr if the route is paying an invoice which signaled it.
*
* @generated from protobuf rpc: BuildRoute(routerrpc.BuildRouteRequest) returns (routerrpc.BuildRouteResponse);
* @generated from protobuf rpc: BuildRoute
*/
buildRoute(input: BuildRouteRequest, options?: RpcOptions): UnaryCall<BuildRouteRequest, BuildRouteResponse> {
const method = this.methods[12], opt = this._transport.mergeOptions(options);
@ -385,7 +463,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* SubscribeHtlcEvents creates a uni-directional stream from the server to
* the client which delivers a stream of htlc events.
*
* @generated from protobuf rpc: SubscribeHtlcEvents(routerrpc.SubscribeHtlcEventsRequest) returns (stream routerrpc.HtlcEvent);
* @generated from protobuf rpc: SubscribeHtlcEvents
*/
subscribeHtlcEvents(input: SubscribeHtlcEventsRequest, options?: RpcOptions): ServerStreamingCall<SubscribeHtlcEventsRequest, HtlcEvent> {
const method = this.methods[13], opt = this._transport.mergeOptions(options);
@ -398,7 +476,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* returns a stream of payment status updates.
*
* @deprecated
* @generated from protobuf rpc: SendPayment(routerrpc.SendPaymentRequest) returns (stream routerrpc.PaymentStatus);
* @generated from protobuf rpc: SendPayment
*/
sendPayment(input: SendPaymentRequest, options?: RpcOptions): ServerStreamingCall<SendPaymentRequest, PaymentStatus> {
const method = this.methods[14], opt = this._transport.mergeOptions(options);
@ -410,7 +488,7 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* the payment identified by the payment hash.
*
* @deprecated
* @generated from protobuf rpc: TrackPayment(routerrpc.TrackPaymentRequest) returns (stream routerrpc.PaymentStatus);
* @generated from protobuf rpc: TrackPayment
*/
trackPayment(input: TrackPaymentRequest, options?: RpcOptions): ServerStreamingCall<TrackPaymentRequest, PaymentStatus> {
const method = this.methods[15], opt = this._transport.mergeOptions(options);
@ -424,23 +502,51 @@ export class RouterClient implements IRouterClient, ServiceInfo {
* In case of interception, the htlc can be either settled, cancelled or
* resumed later by using the ResolveHoldForward endpoint.
*
* @generated from protobuf rpc: HtlcInterceptor(stream routerrpc.ForwardHtlcInterceptResponse) returns (stream routerrpc.ForwardHtlcInterceptRequest);
* @generated from protobuf rpc: HtlcInterceptor
*/
htlcInterceptor(options?: RpcOptions): DuplexStreamingCall<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest> {
const method = this.methods[16], opt = this._transport.mergeOptions(options);
return stackIntercept<ForwardHtlcInterceptResponse, ForwardHtlcInterceptRequest>("duplex", this._transport, method, opt);
}
/**
*
* lncli: `updatechanstatus`
* UpdateChanStatus attempts to manually set the state of a channel
* (enabled, disabled, or auto). A manual "disable" request will cause the
* channel to stay disabled until a subsequent manual request of either
* "enable" or "auto".
*
* @generated from protobuf rpc: UpdateChanStatus(routerrpc.UpdateChanStatusRequest) returns (routerrpc.UpdateChanStatusResponse);
* @generated from protobuf rpc: UpdateChanStatus
*/
updateChanStatus(input: UpdateChanStatusRequest, options?: RpcOptions): UnaryCall<UpdateChanStatusRequest, UpdateChanStatusResponse> {
const method = this.methods[17], opt = this._transport.mergeOptions(options);
return stackIntercept<UpdateChanStatusRequest, UpdateChanStatusResponse>("unary", this._transport, method, opt, input);
}
/**
*
* XAddLocalChanAliases is an experimental API that creates a set of new
* channel SCID alias mappings. The final total set of aliases in the manager
* after the add operation is returned. This is only a locally stored alias,
* and will not be communicated to the channel peer via any message. Therefore,
* routing over such an alias will only work if the peer also calls this same
* RPC on their end. If an alias already exists, an error is returned
*
* @generated from protobuf rpc: XAddLocalChanAliases
*/
xAddLocalChanAliases(input: AddAliasesRequest, options?: RpcOptions): UnaryCall<AddAliasesRequest, AddAliasesResponse> {
const method = this.methods[18], opt = this._transport.mergeOptions(options);
return stackIntercept<AddAliasesRequest, AddAliasesResponse>("unary", this._transport, method, opt, input);
}
/**
*
* XDeleteLocalChanAliases is an experimental API that deletes a set of alias
* mappings. The final total set of aliases in the manager after the delete
* operation is returned. The deletion will not be communicated to the channel
* peer via any message.
*
* @generated from protobuf rpc: XDeleteLocalChanAliases
*/
xDeleteLocalChanAliases(input: DeleteAliasesRequest, options?: RpcOptions): UnaryCall<DeleteAliasesRequest, DeleteAliasesResponse> {
const method = this.methods[19], opt = this._transport.mergeOptions(options);
return stackIntercept<DeleteAliasesRequest, DeleteAliasesResponse>("unary", this._transport, method, opt, input);
}
}