channel rpc

This commit is contained in:
boufni95 2024-08-23 20:20:10 +02:00
parent 11860d099f
commit b5bd1a74d9
24 changed files with 35275 additions and 33084 deletions

View file

@ -38,6 +38,11 @@ The nostr server will send back a message response, and inside the body there wi
- This methods has an __empty__ __request__ body - This methods has an __empty__ __request__ body
- output: [LndSeed](#LndSeed) - output: [LndSeed](#LndSeed)
- ListChannels
- auth type: __Admin__
- This methods has an __empty__ __request__ body
- output: [LndChannels](#LndChannels)
- GetUsageMetrics - GetUsageMetrics
- auth type: __Metrics__ - auth type: __Metrics__
- This methods has an __empty__ __request__ body - This methods has an __empty__ __request__ body
@ -185,9 +190,9 @@ The nostr server will send back a message response, and inside the body there wi
- __User__: - __User__:
- expected context content - expected context content
- __user_id__: _string_
- __app_id__: _string_ - __app_id__: _string_
- __app_user_id__: _string_ - __app_user_id__: _string_
- __user_id__: _string_
- __Admin__: - __Admin__:
- expected context content - expected context content
@ -244,6 +249,13 @@ The nostr server will send back a message response, and inside the body there wi
- This methods has an __empty__ __request__ body - This methods has an __empty__ __request__ body
- output: [LndSeed](#LndSeed) - output: [LndSeed](#LndSeed)
- ListChannels
- auth type: __Admin__
- http method: __get__
- http route: __/api/admin/channels__
- This methods has an __empty__ __request__ body
- output: [LndChannels](#LndChannels)
- GetUsageMetrics - GetUsageMetrics
- auth type: __Metrics__ - auth type: __Metrics__
- http method: __post__ - http method: __post__
@ -601,131 +613,305 @@ The nostr server will send back a message response, and inside the body there wi
## Messages ## Messages
### The content of requests and response from the methods ### The content of requests and response from the methods
### AppsMetricsRequest ### AuthAppRequest
- __from_unix__: _number_ *this field is optional - __name__: _string_
- __to_unix__: _number_ *this field is optional - __allow_user_creation__: _boolean_ *this field is optional
- __include_operations__: _boolean_ *this field is optional
### SetMockAppBalanceRequest ### Application
- __amount__: _number_ - __name__: _string_
- __id__: _string_
- __balance__: _number_
- __npub__: _string_
### NewAddressResponse ### DecodeInvoiceRequest
- __address__: _string_ - __invoice__: _string_
### PayAddressResponse ### OpenChannel
- __txId__: _string_ - __channel_id__: _string_
- __operation_id__: _string_ - __capacity__: _number_
- __service_fee__: _number_ - __active__: _boolean_
- __network_fee__: _number_ - __lifetime__: _number_
- __local_balance__: _number_
- __remote_balance__: _number_
- __label__: _string_
### ChannelRouting
- __send_errors__: _number_
- __receive_errors__: _number_
- __missed_forward_fee_as_output__: _number_
- __events_number__: _number_
- __channel_id__: _string_
- __forward_errors_as_input__: _number_
- __forward_errors_as_output__: _number_
- __missed_forward_fee_as_input__: _number_
- __forward_fee_as_input__: _number_
- __forward_fee_as_output__: _number_
### ChainBalanceEvent
- __block_height__: _number_
- __confirmed_balance__: _number_
- __unconfirmed_balance__: _number_
- __total_balance__: _number_
### GetPaymentStateRequest
- __invoice__: _string_
### EncryptionExchangeRequest
- __deviceId__: _string_
- __publicKey__: _string_
### ChannelBalanceEvent
- __block_height__: _number_
- __channel_id__: _string_
- __local_balance_sats__: _number_
- __remote_balance_sats__: _number_
### HandleLnurlPayResponse ### HandleLnurlPayResponse
- __pr__: _string_ - __pr__: _string_
- __routes__: ARRAY of: _[Empty](#Empty)_ - __routes__: ARRAY of: _[Empty](#Empty)_
### GetProductBuyLinkResponse ### LiveUserOperation
- __link__: _string_ - __operation__: _[UserOperation](#UserOperation)_
### UsageMetric ### RequestNPubLinkingTokenRequest
- __parsed_in_nano__: _number_ - __user_identifier__: _string_
- __validate_in_nano__: _number_
- __handle_in_nano__: _number_
- __batch__: _boolean_
- __nostr__: _boolean_
- __batch_size__: _number_
- __processed_at_ms__: _number_
- __auth_in_nano__: _number_
- __rpc_name__: _string_
### AppMetrics ### HttpCreds
- __app__: _[Application](#Application)_ - __url__: _string_
- __users__: _[UsersInfo](#UsersInfo)_ - __token__: _string_
- __received__: _number_
- __total_fees__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
- __spent__: _number_
- __available__: _number_
- __fees__: _number_
- __invoices__: _number_
### LndMetrics ### AppsMetricsRequest
- __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_ - __from_unix__: _number_ *this field is optional
- __to_unix__: _number_ *this field is optional
- __include_operations__: _boolean_ *this field is optional
### Application ### LnurlWithdrawInfoResponse
- __balanceCheck__: _string_
- __payLink__: _string_
- __tag__: _string_
- __callback__: _string_
- __k1__: _string_
- __defaultDescription__: _string_
- __minWithdrawable__: _number_
- __maxWithdrawable__: _number_
### NewInvoiceRequest
- __memo__: _string_
- __amountSats__: _number_
### DecodeInvoiceResponse
- __amount__: _number_
### UserInfo
- __service_fee_bps__: _number_
- __network_max_fee_bps__: _number_
- __network_max_fee_fixed__: _number_
- __userId__: _string_
- __balance__: _number_ - __balance__: _number_
- __npub__: _string_ - __max_withdrawable__: _number_
- __name__: _string_ - __user_identifier__: _string_
- __id__: _string_
### AddAppInvoiceRequest ### SetMockInvoiceAsPaidRequest
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ - __invoice__: _string_
- __payer_identifier__: _string_ - __amount__: _number_
- __http_callback_url__: _string_
### SendAppUserToAppPaymentRequest
- __from_user_identifier__: _string_
- __amount__: _number_
### GetAppUserLNURLInfoRequest ### GetAppUserLNURLInfoRequest
- __user_identifier__: _string_ - __user_identifier__: _string_
- __base_url_override__: _string_ - __base_url_override__: _string_
### GetPaymentStateRequest ### GetProductBuyLinkResponse
- __invoice__: _string_ - __link__: _string_
### ChannelRouting ### LndMetrics
- __forward_fee_as_output__: _number_ - __nodes__: ARRAY of: _[LndNodeMetrics](#LndNodeMetrics)_
- __events_number__: _number_
- __send_errors__: _number_
- __forward_errors_as_output__: _number_
- __forward_fee_as_input__: _number_
- __missed_forward_fee_as_input__: _number_
- __missed_forward_fee_as_output__: _number_
- __channel_id__: _string_
- __receive_errors__: _number_
- __forward_errors_as_input__: _number_
### PayAppUserInvoiceRequest ### AddAppUserRequest
- __user_identifier__: _string_ - __balance__: _number_
- __invoice__: _string_ - __identifier__: _string_
- __amount__: _number_ - __fail_if_exists__: _boolean_
### SetMockAppUserBalanceRequest ### BanUserResponse
- __user_identifier__: _string_ - __balance_sats__: _number_
- __amount__: _number_ - __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_
### PayAddressRequest
- __address__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### GetUserOperationsRequest ### GetUserOperationsRequest
- __max_size__: _number_
- __latestIncomingInvoice__: _number_ - __latestIncomingInvoice__: _number_
- __latestOutgoingInvoice__: _number_ - __latestOutgoingInvoice__: _number_
- __latestIncomingTx__: _number_ - __latestIncomingTx__: _number_
- __latestOutgoingTx__: _number_ - __latestOutgoingTx__: _number_
- __latestIncomingUserToUserPayment__: _number_ - __latestIncomingUserToUserPayment__: _number_
- __latestOutgoingUserToUserPayment__: _number_ - __latestOutgoingUserToUserPayment__: _number_
- __max_size__: _number_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### LinkNPubThroughTokenRequest
- __token__: _string_
### LndGetInfoRequest
- __nodeId__: _number_
### BannedAppUser
- __app_name__: _string_
- __app_id__: _string_
- __user_identifier__: _string_
- __nostr_pub__: _string_
### Product ### Product
- __id__: _string_ - __id__: _string_
- __name__: _string_ - __name__: _string_
- __price_sats__: _number_ - __price_sats__: _number_
### UseInviteLinkRequest ### GetInviteTokenStateResponse
- __invite_token__: _string_ - __used__: _boolean_
### AppsMetrics ### PayInvoiceResponse
- __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_ - __preimage__: _string_
- __amount_paid__: _number_
- __operation_id__: _string_
- __service_fee__: _number_
- __network_fee__: _number_
### SetMockInvoiceAsPaidRequest ### OpenChannelResponse
- __invoice__: _string_ - __channelId__: _string_
### PayAddressResponse
- __service_fee__: _number_
- __network_fee__: _number_
- __txId__: _string_
- __operation_id__: _string_
### PaymentState
- __network_fee__: _number_
- __paid_at_unix__: _number_
- __amount__: _number_
- __service_fee__: _number_
### UsersInfo
- __no_balance__: _number_
- __negative_balance__: _number_
- __always_been_inactive__: _number_
- __balance_avg__: _number_
- __balance_median__: _number_
- __total__: _number_
### LndGetInfoResponse
- __alias__: _string_
### LndMetricsRequest
- __to_unix__: _number_ *this field is optional
- __from_unix__: _number_ *this field is optional
### SetMockAppUserBalanceRequest
- __amount__: _number_
- __user_identifier__: _string_
### RelaysMigration
- __relays__: ARRAY of: _string_
### UsageMetric
- __rpc_name__: _string_
- __batch__: _boolean_
- __nostr__: _boolean_
- __processed_at_ms__: _number_
- __auth_in_nano__: _number_
- __handle_in_nano__: _number_
- __batch_size__: _number_
- __parsed_in_nano__: _number_
- __validate_in_nano__: _number_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### PayAddressRequest
- __address__: _string_
- __amoutSats__: _number_
- __satsPerVByte__: _number_
### LnurlLinkResponse
- __lnurl__: _string_
- __k1__: _string_
### CreateOneTimeInviteLinkResponse
- __invitation_link__: _string_
### LndSeed
- __seed__: ARRAY of: _string_
### LndChannels
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
### OpenChannelRequest
- __pushAmount__: _number_
- __closeAddress__: _string_
- __destination__: _string_
- __fundingAmount__: _number_
### UserOperations
- __fromIndex__: _number_
- __toIndex__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
### Empty
### SendAppUserToAppUserPaymentRequest
- __from_user_identifier__: _string_
- __to_user_identifier__: _string_
- __amount__: _number_ - __amount__: _number_
### BanUserRequest ### LnurlPayInfoResponse
- __user_id__: _string_ - __maxSendable__: _number_
- __minSendable__: _number_
- __metadata__: _string_
- __allowsNostr__: _boolean_
- __nostrPubkey__: _string_
- __tag__: _string_
- __callback__: _string_
### AddProductRequest
- __name__: _string_
- __price_sats__: _number_
### RequestNPubLinkingTokenResponse
- __token__: _string_
### EnrollAdminTokenRequest
- __admin_token__: _string_
### CreateOneTimeInviteLinkRequest
- __sats__: _number_ *this field is optional
### GetInviteTokenStateRequest
- __invite_token__: _string_
### RoutingEvent
- __forward_fail_event__: _boolean_
- __incoming_channel_id__: _number_
- __incoming_htlc_id__: _number_
- __event_type__: _string_
- __incoming_amt_msat__: _number_
- __failure_string__: _string_
- __settled__: _boolean_
- __offchain__: _boolean_
- __outgoing_channel_id__: _number_
- __outgoing_htlc_id__: _number_
- __timestamp_ns__: _number_
- __outgoing_amt_msat__: _number_
### GetAppUserRequest ### GetAppUserRequest
- __user_identifier__: _string_ - __user_identifier__: _string_
### NewInvoiceResponse ### PayInvoiceRequest
- __invoice__: _string_ - __invoice__: _string_
- __amount__: _number_
### GetUserOperationsResponse ### GetUserOperationsResponse
- __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_ - __latestIncomingTxOperations__: _[UserOperations](#UserOperations)_
@ -735,266 +921,96 @@ The nostr server will send back a message response, and inside the body there wi
- __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_ - __latestIncomingInvoiceOperations__: _[UserOperations](#UserOperations)_
- __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_ - __latestOutgoingTxOperations__: _[UserOperations](#UserOperations)_
### LndMetricsRequest ### UsageMetrics
- __from_unix__: _number_ *this field is optional - __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_
- __to_unix__: _number_ *this field is optional
### AuthApp ### NewAddressRequest
- __app__: _[Application](#Application)_ - __addressType__: _[AddressType](#AddressType)_
- __auth_token__: _string_
### DecodeInvoiceRequest ### ClosedChannel
- __invoice__: _string_ - __channel_id__: _string_
- __capacity__: _number_
- __closed_height__: _number_
### LnurlLinkResponse ### LndNodeMetrics
- __lnurl__: _string_ - __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_
- __k1__: _string_ - __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
- __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_
- __offline_channels__: _number_
- __online_channels__: _number_
- __pending_channels__: _number_
- __closing_channels__: _number_
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
### RequestNPubLinkingTokenResponse ### BanUserRequest
- __token__: _string_ - __user_id__: _string_
### CreateOneTimeInviteLinkResponse
- __invitation_link__: _string_
### UsersInfo
- __total__: _number_
- __no_balance__: _number_
- __negative_balance__: _number_
- __always_been_inactive__: _number_
- __balance_avg__: _number_
- __balance_median__: _number_
### RoutingEvent
- __outgoing_channel_id__: _number_
- __incoming_amt_msat__: _number_
- __settled__: _boolean_
- __outgoing_amt_msat__: _number_
- __failure_string__: _string_
- __offchain__: _boolean_
- __incoming_channel_id__: _number_
- __incoming_htlc_id__: _number_
- __outgoing_htlc_id__: _number_
- __timestamp_ns__: _number_
- __event_type__: _string_
- __forward_fail_event__: _boolean_
### UserInfo
- __user_identifier__: _string_
- __service_fee_bps__: _number_
- __network_max_fee_bps__: _number_
- __network_max_fee_fixed__: _number_
- __userId__: _string_
- __balance__: _number_
- __max_withdrawable__: _number_
### LndGetInfoRequest
- __nodeId__: _number_
### AddAppRequest ### AddAppRequest
- __name__: _string_ - __name__: _string_
- __allow_user_creation__: _boolean_ - __allow_user_creation__: _boolean_
### AddAppUserInvoiceRequest ### AddAppUserInvoiceRequest
- __receiver_identifier__: _string_
- __payer_identifier__: _string_ - __payer_identifier__: _string_
- __http_callback_url__: _string_ - __http_callback_url__: _string_
- __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_ - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
- __receiver_identifier__: _string_
### LinkNPubThroughTokenRequest ### SetMockAppBalanceRequest
- __token__: _string_ - __amount__: _number_
### PayInvoiceResponse ### AppMetrics
- __network_fee__: _number_ - __spent__: _number_
- __preimage__: _string_ - __available__: _number_
- __amount_paid__: _number_ - __fees__: _number_
- __operation_id__: _string_ - __invoices__: _number_
- __service_fee__: _number_ - __operations__: ARRAY of: _[UserOperation](#UserOperation)_
- __app__: _[Application](#Application)_
- __users__: _[UsersInfo](#UsersInfo)_
- __received__: _number_
- __total_fees__: _number_
### LnurlPayInfoResponse ### AppsMetrics
- __allowsNostr__: _boolean_ - __apps__: ARRAY of: _[AppMetrics](#AppMetrics)_
- __nostrPubkey__: _string_
- __tag__: _string_
- __callback__: _string_
- __maxSendable__: _number_
- __minSendable__: _number_
- __metadata__: _string_
### ClosureMigration ### ClosureMigration
- __closes_at_unix__: _number_ - __closes_at_unix__: _number_
### ChainBalanceEvent ### PayAppUserInvoiceRequest
- __block_height__: _number_ - __user_identifier__: _string_
- __confirmed_balance__: _number_
- __unconfirmed_balance__: _number_
- __total_balance__: _number_
### LndNodeMetrics
- __channels_balance_events__: ARRAY of: _[ChannelBalanceEvent](#ChannelBalanceEvent)_
- __channel_routing__: ARRAY of: _[ChannelRouting](#ChannelRouting)_
- __closing_channels__: _number_
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
- __closed_channels__: ARRAY of: _[ClosedChannel](#ClosedChannel)_
- __chain_balance_events__: ARRAY of: _[ChainBalanceEvent](#ChainBalanceEvent)_
- __offline_channels__: _number_
- __online_channels__: _number_
- __pending_channels__: _number_
### UserOperation
- __network_fee__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __identifier__: _string_
- __service_fee__: _number_
- __operationId__: _string_
- __confirmed__: _boolean_
- __tx_hash__: _string_
- __internal__: _boolean_
- __paidAtUnix__: _number_
- __inbound__: _boolean_
- __amount__: _number_
### GetInviteTokenStateRequest
- __invite_token__: _string_
### ChannelBalanceEvent
- __block_height__: _number_
- __channel_id__: _string_
- __local_balance_sats__: _number_
- __remote_balance_sats__: _number_
### OpenChannel
- __channel_id__: _string_
- __capacity__: _number_
- __active__: _boolean_
- __lifetime__: _number_
- __local_balance__: _number_
- __remote_balance__: _number_
### BanUserResponse
- __balance_sats__: _number_
- __banned_app_users__: ARRAY of: _[BannedAppUser](#BannedAppUser)_
### AppUser
- __identifier__: _string_
- __info__: _[UserInfo](#UserInfo)_
- __max_withdrawable__: _number_
### PaymentState
- __amount__: _number_
- __service_fee__: _number_
- __network_fee__: _number_
- __paid_at_unix__: _number_
### MigrationUpdate
- __closure__: _[ClosureMigration](#ClosureMigration)_ *this field is optional
- __relays__: _[RelaysMigration](#RelaysMigration)_ *this field is optional
### HttpCreds
- __url__: _string_
- __token__: _string_
### ClosedChannel
- __capacity__: _number_
- __closed_height__: _number_
- __channel_id__: _string_
### LndGetInfoResponse
- __alias__: _string_
### PayInvoiceRequest
- __invoice__: _string_ - __invoice__: _string_
- __amount__: _number_ - __amount__: _number_
### SendAppUserToAppPaymentRequest ### NewAddressResponse
- __from_user_identifier__: _string_ - __address__: _string_
- __amount__: _number_
### OpenChannelRequest ### NewInvoiceResponse
- __closeAddress__: _string_ - __invoice__: _string_
- __destination__: _string_
- __fundingAmount__: _number_
- __pushAmount__: _number_
### EnrollAdminTokenRequest ### UserOperation
- __admin_token__: _string_
### Empty
### NewAddressRequest
- __addressType__: _[AddressType](#AddressType)_
### AddProductRequest
- __name__: _string_
- __price_sats__: _number_
### GetInviteTokenStateResponse
- __used__: _boolean_
### EncryptionExchangeRequest
- __publicKey__: _string_
- __deviceId__: _string_
### UsageMetrics
- __metrics__: ARRAY of: _[UsageMetric](#UsageMetric)_
### AuthAppRequest
- __name__: _string_
- __allow_user_creation__: _boolean_ *this field is optional
### AddAppUserRequest
- __identifier__: _string_ - __identifier__: _string_
- __fail_if_exists__: _boolean_ - __operationId__: _string_
- __balance__: _number_ - __network_fee__: _number_
- __confirmed__: _boolean_
### DecodeInvoiceResponse - __tx_hash__: _string_
- __paidAtUnix__: _number_
- __type__: _[UserOperationType](#UserOperationType)_
- __amount__: _number_ - __amount__: _number_
- __internal__: _boolean_
- __inbound__: _boolean_
- __service_fee__: _number_
### RelaysMigration ### UseInviteLinkRequest
- __relays__: ARRAY of: _string_ - __invite_token__: _string_
### CreateOneTimeInviteLinkRequest ### AuthApp
- __sats__: _number_ *this field is optional - __app__: _[Application](#Application)_
- __auth_token__: _string_
### BannedAppUser ### AddAppInvoiceRequest
- __app_name__: _string_ - __payer_identifier__: _string_
- __app_id__: _string_ - __http_callback_url__: _string_
- __user_identifier__: _string_ - __invoice_req__: _[NewInvoiceRequest](#NewInvoiceRequest)_
- __nostr_pub__: _string_
### SendAppUserToAppUserPaymentRequest
- __from_user_identifier__: _string_
- __to_user_identifier__: _string_
- __amount__: _number_
### NewInvoiceRequest
- __amountSats__: _number_
- __memo__: _string_
### OpenChannelResponse
- __channelId__: _string_
### LiveUserOperation
- __operation__: _[UserOperation](#UserOperation)_
### LndSeed
- __seed__: ARRAY of: _string_
### LnurlWithdrawInfoResponse
- __maxWithdrawable__: _number_
- __balanceCheck__: _string_
- __payLink__: _string_
- __tag__: _string_
- __callback__: _string_
- __k1__: _string_
- __defaultDescription__: _string_
- __minWithdrawable__: _number_
### UserOperations
- __toIndex__: _number_
- __operations__: ARRAY of: _[UserOperation](#UserOperation)_
- __fromIndex__: _number_
### RequestNPubLinkingTokenRequest
- __user_identifier__: _string_
## Enums ## Enums
### The enumerators used in the messages ### The enumerators used in the messages

File diff suppressed because it is too large Load diff

View file

@ -141,6 +141,25 @@ export default (methods: Types.ServerMethods, opts: ServerOptions) => {
opts.metricsCallback([{ ...info, ...stats, ...authContext }]) opts.metricsCallback([{ ...info, ...stats, ...authContext }])
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } } catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
}) })
if (!opts.allowNotImplementedMethods && !methods.ListChannels) throw new Error('method: ListChannels is not implemented')
app.get('/api/admin/channels', async (req, res) => {
const info: Types.RequestInfo = { rpcName: 'ListChannels', batch: false, nostr: false, batchSize: 0}
const stats: Types.RequestStats = { startMs:req.startTimeMs || 0, start:req.startTime || 0n, parse: process.hrtime.bigint(), guard: 0n, validate: 0n, handle: 0n }
let authCtx: Types.AuthContext = {}
try {
if (!methods.ListChannels) throw new Error('method: ListChannels is not implemented')
const authContext = await opts.AdminAuthGuard(req.headers['authorization'])
authCtx = authContext
stats.guard = process.hrtime.bigint()
stats.validate = stats.guard
const query = req.query
const params = req.params
const response = await methods.ListChannels({rpcName:'ListChannels', ctx:authContext })
stats.handle = process.hrtime.bigint()
res.json({status: 'OK', ...response})
opts.metricsCallback([{ ...info, ...stats, ...authContext }])
} catch (ex) { const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
})
if (!opts.allowNotImplementedMethods && !methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') if (!opts.allowNotImplementedMethods && !methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented')
app.post('/api/reports/usage', async (req, res) => { app.post('/api/reports/usage', async (req, res) => {
const info: Types.RequestInfo = { rpcName: 'GetUsageMetrics', batch: false, nostr: false, batchSize: 0} const info: Types.RequestInfo = { rpcName: 'GetUsageMetrics', batch: false, nostr: false, batchSize: 0}

View file

@ -87,6 +87,20 @@ export default (params: ClientParams) => ({
} }
return { status: 'ERROR', reason: 'invalid response' } return { status: 'ERROR', reason: 'invalid response' }
}, },
ListChannels: async (): Promise<ResultError | ({ status: 'OK' }& Types.LndChannels)> => {
const auth = await params.retrieveAdminAuth()
if (auth === null) throw new Error('retrieveAdminAuth() returned null')
let finalRoute = '/api/admin/channels'
const { data } = await axios.get(params.baseUrl + finalRoute, { headers: { 'authorization': auth } })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LndChannelsValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => { GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => {
const auth = await params.retrieveMetricsAuth() const auth = await params.retrieveMetricsAuth()
if (auth === null) throw new Error('retrieveMetricsAuth() returned null') if (auth === null) throw new Error('retrieveMetricsAuth() returned null')

View file

@ -86,6 +86,20 @@ export default (params: NostrClientParams, send: (to:string, message: NostrRequ
} }
return { status: 'ERROR', reason: 'invalid response' } return { status: 'ERROR', reason: 'invalid response' }
}, },
ListChannels: async (): Promise<ResultError | ({ status: 'OK' }& Types.LndChannels)> => {
const auth = await params.retrieveNostrAdminAuth()
if (auth === null) throw new Error('retrieveNostrAdminAuth() returned null')
const nostrRequest: NostrRequest = {}
const data = await send(params.pubDestination, {rpcName:'ListChannels',authIdentifier:auth, ...nostrRequest })
if (data.status === 'ERROR' && typeof data.reason === 'string') return data
if (data.status === 'OK') {
const result = data
if(!params.checkResult) return { status: 'OK', ...result }
const error = Types.LndChannelsValidate(result)
if (error === null) { return { status: 'OK', ...result } } else return { status: 'ERROR', reason: error.message }
}
return { status: 'ERROR', reason: 'invalid response' }
},
GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => { GetUsageMetrics: async (): Promise<ResultError | ({ status: 'OK' }& Types.UsageMetrics)> => {
const auth = await params.retrieveNostrMetricsAuth() const auth = await params.retrieveNostrMetricsAuth()
if (auth === null) throw new Error('retrieveNostrMetricsAuth() returned null') if (auth === null) throw new Error('retrieveNostrMetricsAuth() returned null')

View file

@ -16,10 +16,10 @@ export type NostrOptions = {
logger?: Logger logger?: Logger
throwErrors?: true throwErrors?: true
metricsCallback: (metrics: Types.RequestMetric[]) => void metricsCallback: (metrics: Types.RequestMetric[]) => void
NostrAdminAuthGuard: (appId?:string, identifier?: string) => Promise<Types.AdminContext>
NostrMetricsAuthGuard: (appId?:string, identifier?: string) => Promise<Types.MetricsContext>
NostrUserAuthGuard: (appId?:string, identifier?: string) => Promise<Types.UserContext> NostrUserAuthGuard: (appId?:string, identifier?: string) => Promise<Types.UserContext>
NostrGuestWithPubAuthGuard: (appId?:string, identifier?: string) => Promise<Types.GuestWithPubContext> NostrGuestWithPubAuthGuard: (appId?:string, identifier?: string) => Promise<Types.GuestWithPubContext>
NostrAdminAuthGuard: (appId?:string, identifier?: string) => Promise<Types.AdminContext>
NostrMetricsAuthGuard: (appId?:string, identifier?: string) => Promise<Types.MetricsContext>
} }
const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => { const logErrorAndReturnResponse = (error: Error, response: string, res: NostrResponse, logger: Logger, metric: Types.RequestMetric, metricsCallback: (metrics: Types.RequestMetric[]) => void) => {
logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res({ status: 'ERROR', reason: response }) logger.error(error.message || error); metricsCallback([{ ...metric, error: response }]); res({ status: 'ERROR', reason: response })
@ -109,6 +109,19 @@ export default (methods: Types.ServerMethods, opts: NostrOptions) => {
opts.metricsCallback([{ ...info, ...stats, ...authContext }]) opts.metricsCallback([{ ...info, ...stats, ...authContext }])
}catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e } }catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
break break
case 'ListChannels':
try {
if (!methods.ListChannels) throw new Error('method: ListChannels is not implemented')
const authContext = await opts.NostrAdminAuthGuard(req.appId, req.authIdentifier)
stats.guard = process.hrtime.bigint()
authCtx = authContext
stats.validate = stats.guard
const response = await methods.ListChannels({rpcName:'ListChannels', ctx:authContext })
stats.handle = process.hrtime.bigint()
res({status: 'OK', ...response})
opts.metricsCallback([{ ...info, ...stats, ...authContext }])
}catch(ex){ const e = ex as any; logErrorAndReturnResponse(e, e.message || e, res, logger, { ...info, ...stats, ...authCtx }, opts.metricsCallback); if (opts.throwErrors) throw e }
break
case 'GetUsageMetrics': case 'GetUsageMetrics':
try { try {
if (!methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented') if (!methods.GetUsageMetrics) throw new Error('method: GetUsageMetrics is not implemented')

File diff suppressed because it is too large Load diff

View file

@ -8,8 +8,8 @@ import type { BlockEpoch } from "./chainnotifier.js";
import type { SpendEvent } from "./chainnotifier.js"; import type { SpendEvent } from "./chainnotifier.js";
import type { SpendRequest } from "./chainnotifier.js"; import type { SpendRequest } from "./chainnotifier.js";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { ConfEvent } from "./chainnotifier.js"; import type { ConfEvent } from "./chainnotifier";
import type { ConfRequest } from "./chainnotifier.js"; import type { ConfRequest } from "./chainnotifier";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/** /**

View file

@ -4,8 +4,6 @@
import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Lightning } from "./lightning.js"; import { Lightning } from "./lightning.js";
import type { LookupHtlcResponse } from "./lightning.js";
import type { LookupHtlcRequest } from "./lightning.js";
import type { ListAliasesResponse } from "./lightning.js"; import type { ListAliasesResponse } from "./lightning.js";
import type { ListAliasesRequest } from "./lightning.js"; import type { ListAliasesRequest } from "./lightning.js";
import type { CustomMessage } from "./lightning.js"; import type { CustomMessage } from "./lightning.js";
@ -132,6 +130,12 @@ import type { WalletBalanceResponse } from "./lightning.js";
import type { WalletBalanceRequest } from "./lightning.js"; import type { WalletBalanceRequest } from "./lightning.js";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
import type { GetDebugInfoResponse } from "./lightning.js";
import type { GetDebugInfoRequest } from "./lightning.js";
import type { LookupHtlcResolutionResponse } from "./lightning.js";
import type { LookupHtlcResolutionRequest } from "./lightning.js";
// //
// Comments in this file will be directly parsed into the API // Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field. // Documentation as descriptions of the associated method, message, or field.
@ -252,8 +256,10 @@ export interface ILightningClient {
signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall<SignMessageRequest, SignMessageResponse>; signMessage(input: SignMessageRequest, options?: RpcOptions): UnaryCall<SignMessageRequest, SignMessageResponse>;
/** /**
* lncli: `verifymessage` * lncli: `verifymessage`
* VerifyMessage verifies a signature over a msg. The signature must be * VerifyMessage verifies a signature over a message and recovers the signer's
* zbase32 encoded and signed by an active node in the resident node's * public key. The signature is only deemed valid if the recovered public key
* corresponds to a node key in the public Lightning network. The signature
* must be zbase32 encoded and signed by an active node in the resident node's
* channel database. In addition to returning the validity of the signature, * channel database. In addition to returning the validity of the signature,
* VerifyMessage also returns the recovered pubkey from the signature. * VerifyMessage also returns the recovered pubkey from the signature.
* *
@ -303,6 +309,15 @@ export interface ILightningClient {
* @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse); * @generated from protobuf rpc: GetInfo(lnrpc.GetInfoRequest) returns (lnrpc.GetInfoResponse);
*/ */
getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall<GetInfoRequest, GetInfoResponse>; getInfo(input: GetInfoRequest, options?: RpcOptions): UnaryCall<GetInfoRequest, GetInfoResponse>;
/**
* lncli: 'getdebuginfo'
* GetDebugInfo returns debug information concerning the state of the daemon
* and its subsystems. This includes the full configuration and the latest log
* entries from the log file.
*
* @generated from protobuf rpc: GetDebugInfo(lnrpc.GetDebugInfoRequest) returns (lnrpc.GetDebugInfoResponse);
*/
getDebugInfo(input: GetDebugInfoRequest, options?: RpcOptions): UnaryCall<GetDebugInfoRequest, GetDebugInfoResponse>;
/** /**
* * lncli: `getrecoveryinfo` * * lncli: `getrecoveryinfo`
* GetRecoveryInfo returns information concerning the recovery mode including * GetRecoveryInfo returns information concerning the recovery mode including
@ -515,7 +530,7 @@ export interface ILightningClient {
* optionally specify the add_index and/or the settle_index. If the add_index * optionally specify the add_index and/or the settle_index. If the add_index
* is specified, then we'll first start by sending add invoice events for all * is specified, then we'll first start by sending add invoice events for all
* invoices with an add_index greater than the specified value. If the * invoices with an add_index greater than the specified value. If the
* settle_index is specified, the next, we'll send out all settle events for * settle_index is specified, then next, we'll send out all settle events for
* invoices with a settle_index greater than the specified value. One or both * invoices with a settle_index greater than the specified value. One or both
* of these fields can be set. If no fields are set, then we'll only send out * of these fields can be set. If no fields are set, then we'll only send out
* the latest add/settle events. * the latest add/settle events.
@ -540,7 +555,7 @@ export interface ILightningClient {
*/ */
listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall<ListPaymentsRequest, ListPaymentsResponse>; listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall<ListPaymentsRequest, ListPaymentsResponse>;
/** /**
* * lncli: `deletepayments`
* DeletePayment deletes an outgoing payment from DB. Note that it will not * DeletePayment deletes an outgoing payment from DB. Note that it will not
* attempt to delete an In-Flight payment, since that would be unsafe. * attempt to delete an In-Flight payment, since that would be unsafe.
* *
@ -548,7 +563,7 @@ export interface ILightningClient {
*/ */
deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall<DeletePaymentRequest, DeletePaymentResponse>; deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall<DeletePaymentRequest, DeletePaymentResponse>;
/** /**
* * lncli: `deletepayments --all`
* DeleteAllPayments deletes all outgoing payments from DB. Note that it will * DeleteAllPayments deletes all outgoing payments from DB. Note that it will
* not attempt to delete In-Flight payments, since that would be unsafe. * not attempt to delete In-Flight payments, since that would be unsafe.
* *
@ -704,7 +719,7 @@ export interface ILightningClient {
*/ */
exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall<ChanBackupExportRequest, ChanBackupSnapshot>; exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall<ChanBackupExportRequest, ChanBackupSnapshot>;
/** /**
* * lncli: `verifychanbackup`
* VerifyChanBackup allows a caller to verify the integrity of a channel backup * VerifyChanBackup allows a caller to verify the integrity of a channel backup
* snapshot. This method will accept either a packed Single or a packed Multi. * snapshot. This method will accept either a packed Single or a packed Multi.
* Specifying both will result in an error. * Specifying both will result in an error.
@ -806,6 +821,10 @@ export interface ILightningClient {
* SubscribeCustomMessages subscribes to a stream of incoming custom peer * SubscribeCustomMessages subscribes to a stream of incoming custom peer
* messages. * messages.
* *
* To include messages with type outside of the custom range (>= 32768) lnd
* needs to be compiled with the `dev` build tag, and the message type to
* override should be specified in lnd's experimental protocol configuration.
*
* @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage);
*/ */
subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall<SubscribeCustomMessagesRequest, CustomMessage>; subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall<SubscribeCustomMessagesRequest, CustomMessage>;
@ -819,9 +838,14 @@ export interface ILightningClient {
*/ */
listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall<ListAliasesRequest, ListAliasesResponse>; listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall<ListAliasesRequest, ListAliasesResponse>;
/** /**
* @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); *
* LookupHtlcResolution retrieves a final htlc resolution from the database.
* If the htlc has no final resolution yet, a NotFound grpc status code is
* returned.
*
* @generated from protobuf rpc: LookupHtlcResolution(lnrpc.LookupHtlcResolutionRequest) returns (lnrpc.LookupHtlcResolutionResponse);
*/ */
lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall<LookupHtlcRequest, LookupHtlcResponse>; lookupHtlcResolution(input: LookupHtlcResolutionRequest, options?: RpcOptions): UnaryCall<LookupHtlcResolutionRequest, LookupHtlcResolutionResponse>;
} }
// //
// Comments in this file will be directly parsed into the API // Comments in this file will be directly parsed into the API
@ -978,8 +1002,10 @@ export class LightningClient implements ILightningClient, ServiceInfo {
} }
/** /**
* lncli: `verifymessage` * lncli: `verifymessage`
* VerifyMessage verifies a signature over a msg. The signature must be * VerifyMessage verifies a signature over a message and recovers the signer's
* zbase32 encoded and signed by an active node in the resident node's * public key. The signature is only deemed valid if the recovered public key
* corresponds to a node key in the public Lightning network. The signature
* must be zbase32 encoded and signed by an active node in the resident node's
* channel database. In addition to returning the validity of the signature, * channel database. In addition to returning the validity of the signature,
* VerifyMessage also returns the recovered pubkey from the signature. * VerifyMessage also returns the recovered pubkey from the signature.
* *
@ -1047,6 +1073,18 @@ export class LightningClient implements ILightningClient, ServiceInfo {
const method = this.methods[15], opt = this._transport.mergeOptions(options); const method = this.methods[15], opt = this._transport.mergeOptions(options);
return stackIntercept<GetInfoRequest, GetInfoResponse>("unary", this._transport, method, opt, input); return stackIntercept<GetInfoRequest, GetInfoResponse>("unary", this._transport, method, opt, input);
} }
/**
* lncli: 'getdebuginfo'
* GetDebugInfo returns debug information concerning the state of the daemon
* and its subsystems. This includes the full configuration and the latest log
* entries from the log file.
*
* @generated from protobuf rpc: GetDebugInfo(lnrpc.GetDebugInfoRequest) returns (lnrpc.GetDebugInfoResponse);
*/
getDebugInfo(input: GetDebugInfoRequest, options?: RpcOptions): UnaryCall<GetDebugInfoRequest, GetDebugInfoResponse> {
const method = this.methods[16], opt = this._transport.mergeOptions(options);
return stackIntercept<GetDebugInfoRequest, GetDebugInfoResponse>("unary", this._transport, method, opt, input);
}
/** /**
* * lncli: `getrecoveryinfo` * * lncli: `getrecoveryinfo`
* GetRecoveryInfo returns information concerning the recovery mode including * GetRecoveryInfo returns information concerning the recovery mode including
@ -1056,7 +1094,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse); * @generated from protobuf rpc: GetRecoveryInfo(lnrpc.GetRecoveryInfoRequest) returns (lnrpc.GetRecoveryInfoResponse);
*/ */
getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall<GetRecoveryInfoRequest, GetRecoveryInfoResponse> { getRecoveryInfo(input: GetRecoveryInfoRequest, options?: RpcOptions): UnaryCall<GetRecoveryInfoRequest, GetRecoveryInfoResponse> {
const method = this.methods[16], opt = this._transport.mergeOptions(options); const method = this.methods[17], opt = this._transport.mergeOptions(options);
return stackIntercept<GetRecoveryInfoRequest, GetRecoveryInfoResponse>("unary", this._transport, method, opt, input); return stackIntercept<GetRecoveryInfoRequest, GetRecoveryInfoResponse>("unary", this._transport, method, opt, input);
} }
// TODO(roasbeef): merge with below with bool? // TODO(roasbeef): merge with below with bool?
@ -1071,7 +1109,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse); * @generated from protobuf rpc: PendingChannels(lnrpc.PendingChannelsRequest) returns (lnrpc.PendingChannelsResponse);
*/ */
pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall<PendingChannelsRequest, PendingChannelsResponse> { pendingChannels(input: PendingChannelsRequest, options?: RpcOptions): UnaryCall<PendingChannelsRequest, PendingChannelsResponse> {
const method = this.methods[17], opt = this._transport.mergeOptions(options); const method = this.methods[18], opt = this._transport.mergeOptions(options);
return stackIntercept<PendingChannelsRequest, PendingChannelsResponse>("unary", this._transport, method, opt, input); return stackIntercept<PendingChannelsRequest, PendingChannelsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1082,7 +1120,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse); * @generated from protobuf rpc: ListChannels(lnrpc.ListChannelsRequest) returns (lnrpc.ListChannelsResponse);
*/ */
listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall<ListChannelsRequest, ListChannelsResponse> { listChannels(input: ListChannelsRequest, options?: RpcOptions): UnaryCall<ListChannelsRequest, ListChannelsResponse> {
const method = this.methods[18], opt = this._transport.mergeOptions(options); const method = this.methods[19], opt = this._transport.mergeOptions(options);
return stackIntercept<ListChannelsRequest, ListChannelsResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListChannelsRequest, ListChannelsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1095,7 +1133,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate); * @generated from protobuf rpc: SubscribeChannelEvents(lnrpc.ChannelEventSubscription) returns (stream lnrpc.ChannelEventUpdate);
*/ */
subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall<ChannelEventSubscription, ChannelEventUpdate> { subscribeChannelEvents(input: ChannelEventSubscription, options?: RpcOptions): ServerStreamingCall<ChannelEventSubscription, ChannelEventUpdate> {
const method = this.methods[19], opt = this._transport.mergeOptions(options); const method = this.methods[20], opt = this._transport.mergeOptions(options);
return stackIntercept<ChannelEventSubscription, ChannelEventUpdate>("serverStreaming", this._transport, method, opt, input); return stackIntercept<ChannelEventSubscription, ChannelEventUpdate>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1106,7 +1144,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse); * @generated from protobuf rpc: ClosedChannels(lnrpc.ClosedChannelsRequest) returns (lnrpc.ClosedChannelsResponse);
*/ */
closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall<ClosedChannelsRequest, ClosedChannelsResponse> { closedChannels(input: ClosedChannelsRequest, options?: RpcOptions): UnaryCall<ClosedChannelsRequest, ClosedChannelsResponse> {
const method = this.methods[20], opt = this._transport.mergeOptions(options); const method = this.methods[21], opt = this._transport.mergeOptions(options);
return stackIntercept<ClosedChannelsRequest, ClosedChannelsResponse>("unary", this._transport, method, opt, input); return stackIntercept<ClosedChannelsRequest, ClosedChannelsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1119,7 +1157,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint); * @generated from protobuf rpc: OpenChannelSync(lnrpc.OpenChannelRequest) returns (lnrpc.ChannelPoint);
*/ */
openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall<OpenChannelRequest, ChannelPoint> { openChannelSync(input: OpenChannelRequest, options?: RpcOptions): UnaryCall<OpenChannelRequest, ChannelPoint> {
const method = this.methods[21], opt = this._transport.mergeOptions(options); const method = this.methods[22], opt = this._transport.mergeOptions(options);
return stackIntercept<OpenChannelRequest, ChannelPoint>("unary", this._transport, method, opt, input); return stackIntercept<OpenChannelRequest, ChannelPoint>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1136,7 +1174,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate); * @generated from protobuf rpc: OpenChannel(lnrpc.OpenChannelRequest) returns (stream lnrpc.OpenStatusUpdate);
*/ */
openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall<OpenChannelRequest, OpenStatusUpdate> { openChannel(input: OpenChannelRequest, options?: RpcOptions): ServerStreamingCall<OpenChannelRequest, OpenStatusUpdate> {
const method = this.methods[22], opt = this._transport.mergeOptions(options); const method = this.methods[23], opt = this._transport.mergeOptions(options);
return stackIntercept<OpenChannelRequest, OpenStatusUpdate>("serverStreaming", this._transport, method, opt, input); return stackIntercept<OpenChannelRequest, OpenStatusUpdate>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1150,7 +1188,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse); * @generated from protobuf rpc: BatchOpenChannel(lnrpc.BatchOpenChannelRequest) returns (lnrpc.BatchOpenChannelResponse);
*/ */
batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall<BatchOpenChannelRequest, BatchOpenChannelResponse> { batchOpenChannel(input: BatchOpenChannelRequest, options?: RpcOptions): UnaryCall<BatchOpenChannelRequest, BatchOpenChannelResponse> {
const method = this.methods[23], opt = this._transport.mergeOptions(options); const method = this.methods[24], opt = this._transport.mergeOptions(options);
return stackIntercept<BatchOpenChannelRequest, BatchOpenChannelResponse>("unary", this._transport, method, opt, input); return stackIntercept<BatchOpenChannelRequest, BatchOpenChannelResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1167,7 +1205,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp); * @generated from protobuf rpc: FundingStateStep(lnrpc.FundingTransitionMsg) returns (lnrpc.FundingStateStepResp);
*/ */
fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall<FundingTransitionMsg, FundingStateStepResp> { fundingStateStep(input: FundingTransitionMsg, options?: RpcOptions): UnaryCall<FundingTransitionMsg, FundingStateStepResp> {
const method = this.methods[24], opt = this._transport.mergeOptions(options); const method = this.methods[25], opt = this._transport.mergeOptions(options);
return stackIntercept<FundingTransitionMsg, FundingStateStepResp>("unary", this._transport, method, opt, input); return stackIntercept<FundingTransitionMsg, FundingStateStepResp>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1181,7 +1219,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest); * @generated from protobuf rpc: ChannelAcceptor(stream lnrpc.ChannelAcceptResponse) returns (stream lnrpc.ChannelAcceptRequest);
*/ */
channelAcceptor(options?: RpcOptions): DuplexStreamingCall<ChannelAcceptResponse, ChannelAcceptRequest> { channelAcceptor(options?: RpcOptions): DuplexStreamingCall<ChannelAcceptResponse, ChannelAcceptRequest> {
const method = this.methods[25], opt = this._transport.mergeOptions(options); const method = this.methods[26], opt = this._transport.mergeOptions(options);
return stackIntercept<ChannelAcceptResponse, ChannelAcceptRequest>("duplex", this._transport, method, opt); return stackIntercept<ChannelAcceptResponse, ChannelAcceptRequest>("duplex", this._transport, method, opt);
} }
/** /**
@ -1197,7 +1235,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate); * @generated from protobuf rpc: CloseChannel(lnrpc.CloseChannelRequest) returns (stream lnrpc.CloseStatusUpdate);
*/ */
closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall<CloseChannelRequest, CloseStatusUpdate> { closeChannel(input: CloseChannelRequest, options?: RpcOptions): ServerStreamingCall<CloseChannelRequest, CloseStatusUpdate> {
const method = this.methods[26], opt = this._transport.mergeOptions(options); const method = this.methods[27], opt = this._transport.mergeOptions(options);
return stackIntercept<CloseChannelRequest, CloseStatusUpdate>("serverStreaming", this._transport, method, opt, input); return stackIntercept<CloseChannelRequest, CloseStatusUpdate>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1212,7 +1250,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse); * @generated from protobuf rpc: AbandonChannel(lnrpc.AbandonChannelRequest) returns (lnrpc.AbandonChannelResponse);
*/ */
abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall<AbandonChannelRequest, AbandonChannelResponse> { abandonChannel(input: AbandonChannelRequest, options?: RpcOptions): UnaryCall<AbandonChannelRequest, AbandonChannelResponse> {
const method = this.methods[27], opt = this._transport.mergeOptions(options); const method = this.methods[28], opt = this._transport.mergeOptions(options);
return stackIntercept<AbandonChannelRequest, AbandonChannelResponse>("unary", this._transport, method, opt, input); return stackIntercept<AbandonChannelRequest, AbandonChannelResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1227,7 +1265,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse); * @generated from protobuf rpc: SendPayment(stream lnrpc.SendRequest) returns (stream lnrpc.SendResponse);
*/ */
sendPayment(options?: RpcOptions): DuplexStreamingCall<SendRequest, SendResponse> { sendPayment(options?: RpcOptions): DuplexStreamingCall<SendRequest, SendResponse> {
const method = this.methods[28], opt = this._transport.mergeOptions(options); const method = this.methods[29], opt = this._transport.mergeOptions(options);
return stackIntercept<SendRequest, SendResponse>("duplex", this._transport, method, opt); return stackIntercept<SendRequest, SendResponse>("duplex", this._transport, method, opt);
} }
/** /**
@ -1240,7 +1278,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse); * @generated from protobuf rpc: SendPaymentSync(lnrpc.SendRequest) returns (lnrpc.SendResponse);
*/ */
sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall<SendRequest, SendResponse> { sendPaymentSync(input: SendRequest, options?: RpcOptions): UnaryCall<SendRequest, SendResponse> {
const method = this.methods[29], opt = this._transport.mergeOptions(options); const method = this.methods[30], opt = this._transport.mergeOptions(options);
return stackIntercept<SendRequest, SendResponse>("unary", this._transport, method, opt, input); return stackIntercept<SendRequest, SendResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1255,7 +1293,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse); * @generated from protobuf rpc: SendToRoute(stream lnrpc.SendToRouteRequest) returns (stream lnrpc.SendResponse);
*/ */
sendToRoute(options?: RpcOptions): DuplexStreamingCall<SendToRouteRequest, SendResponse> { sendToRoute(options?: RpcOptions): DuplexStreamingCall<SendToRouteRequest, SendResponse> {
const method = this.methods[30], opt = this._transport.mergeOptions(options); const method = this.methods[31], opt = this._transport.mergeOptions(options);
return stackIntercept<SendToRouteRequest, SendResponse>("duplex", this._transport, method, opt); return stackIntercept<SendToRouteRequest, SendResponse>("duplex", this._transport, method, opt);
} }
/** /**
@ -1266,7 +1304,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse); * @generated from protobuf rpc: SendToRouteSync(lnrpc.SendToRouteRequest) returns (lnrpc.SendResponse);
*/ */
sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendResponse> { sendToRouteSync(input: SendToRouteRequest, options?: RpcOptions): UnaryCall<SendToRouteRequest, SendResponse> {
const method = this.methods[31], opt = this._transport.mergeOptions(options); const method = this.methods[32], opt = this._transport.mergeOptions(options);
return stackIntercept<SendToRouteRequest, SendResponse>("unary", this._transport, method, opt, input); return stackIntercept<SendToRouteRequest, SendResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1278,7 +1316,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse); * @generated from protobuf rpc: AddInvoice(lnrpc.Invoice) returns (lnrpc.AddInvoiceResponse);
*/ */
addInvoice(input: Invoice, options?: RpcOptions): UnaryCall<Invoice, AddInvoiceResponse> { addInvoice(input: Invoice, options?: RpcOptions): UnaryCall<Invoice, AddInvoiceResponse> {
const method = this.methods[32], opt = this._transport.mergeOptions(options); const method = this.methods[33], opt = this._transport.mergeOptions(options);
return stackIntercept<Invoice, AddInvoiceResponse>("unary", this._transport, method, opt, input); return stackIntercept<Invoice, AddInvoiceResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1294,7 +1332,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse); * @generated from protobuf rpc: ListInvoices(lnrpc.ListInvoiceRequest) returns (lnrpc.ListInvoiceResponse);
*/ */
listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall<ListInvoiceRequest, ListInvoiceResponse> { listInvoices(input: ListInvoiceRequest, options?: RpcOptions): UnaryCall<ListInvoiceRequest, ListInvoiceResponse> {
const method = this.methods[33], opt = this._transport.mergeOptions(options); const method = this.methods[34], opt = this._transport.mergeOptions(options);
return stackIntercept<ListInvoiceRequest, ListInvoiceResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListInvoiceRequest, ListInvoiceResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1306,7 +1344,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice); * @generated from protobuf rpc: LookupInvoice(lnrpc.PaymentHash) returns (lnrpc.Invoice);
*/ */
lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall<PaymentHash, Invoice> { lookupInvoice(input: PaymentHash, options?: RpcOptions): UnaryCall<PaymentHash, Invoice> {
const method = this.methods[34], opt = this._transport.mergeOptions(options); const method = this.methods[35], opt = this._transport.mergeOptions(options);
return stackIntercept<PaymentHash, Invoice>("unary", this._transport, method, opt, input); return stackIntercept<PaymentHash, Invoice>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1316,7 +1354,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* optionally specify the add_index and/or the settle_index. If the add_index * optionally specify the add_index and/or the settle_index. If the add_index
* is specified, then we'll first start by sending add invoice events for all * is specified, then we'll first start by sending add invoice events for all
* invoices with an add_index greater than the specified value. If the * invoices with an add_index greater than the specified value. If the
* settle_index is specified, the next, we'll send out all settle events for * settle_index is specified, then next, we'll send out all settle events for
* invoices with a settle_index greater than the specified value. One or both * invoices with a settle_index greater than the specified value. One or both
* of these fields can be set. If no fields are set, then we'll only send out * of these fields can be set. If no fields are set, then we'll only send out
* the latest add/settle events. * the latest add/settle events.
@ -1324,7 +1362,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice); * @generated from protobuf rpc: SubscribeInvoices(lnrpc.InvoiceSubscription) returns (stream lnrpc.Invoice);
*/ */
subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall<InvoiceSubscription, Invoice> { subscribeInvoices(input: InvoiceSubscription, options?: RpcOptions): ServerStreamingCall<InvoiceSubscription, Invoice> {
const method = this.methods[35], opt = this._transport.mergeOptions(options); const method = this.methods[36], opt = this._transport.mergeOptions(options);
return stackIntercept<InvoiceSubscription, Invoice>("serverStreaming", this._transport, method, opt, input); return stackIntercept<InvoiceSubscription, Invoice>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1336,7 +1374,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq); * @generated from protobuf rpc: DecodePayReq(lnrpc.PayReqString) returns (lnrpc.PayReq);
*/ */
decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall<PayReqString, PayReq> { decodePayReq(input: PayReqString, options?: RpcOptions): UnaryCall<PayReqString, PayReq> {
const method = this.methods[36], opt = this._transport.mergeOptions(options); const method = this.methods[37], opt = this._transport.mergeOptions(options);
return stackIntercept<PayReqString, PayReq>("unary", this._transport, method, opt, input); return stackIntercept<PayReqString, PayReq>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1346,29 +1384,29 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse); * @generated from protobuf rpc: ListPayments(lnrpc.ListPaymentsRequest) returns (lnrpc.ListPaymentsResponse);
*/ */
listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall<ListPaymentsRequest, ListPaymentsResponse> { listPayments(input: ListPaymentsRequest, options?: RpcOptions): UnaryCall<ListPaymentsRequest, ListPaymentsResponse> {
const method = this.methods[37], opt = this._transport.mergeOptions(options); const method = this.methods[38], opt = this._transport.mergeOptions(options);
return stackIntercept<ListPaymentsRequest, ListPaymentsResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListPaymentsRequest, ListPaymentsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
* * lncli: `deletepayments`
* DeletePayment deletes an outgoing payment from DB. Note that it will not * DeletePayment deletes an outgoing payment from DB. Note that it will not
* attempt to delete an In-Flight payment, since that would be unsafe. * attempt to delete an In-Flight payment, since that would be unsafe.
* *
* @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse); * @generated from protobuf rpc: DeletePayment(lnrpc.DeletePaymentRequest) returns (lnrpc.DeletePaymentResponse);
*/ */
deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall<DeletePaymentRequest, DeletePaymentResponse> { deletePayment(input: DeletePaymentRequest, options?: RpcOptions): UnaryCall<DeletePaymentRequest, DeletePaymentResponse> {
const method = this.methods[38], opt = this._transport.mergeOptions(options); const method = this.methods[39], opt = this._transport.mergeOptions(options);
return stackIntercept<DeletePaymentRequest, DeletePaymentResponse>("unary", this._transport, method, opt, input); return stackIntercept<DeletePaymentRequest, DeletePaymentResponse>("unary", this._transport, method, opt, input);
} }
/** /**
* * lncli: `deletepayments --all`
* DeleteAllPayments deletes all outgoing payments from DB. Note that it will * DeleteAllPayments deletes all outgoing payments from DB. Note that it will
* not attempt to delete In-Flight payments, since that would be unsafe. * not attempt to delete In-Flight payments, since that would be unsafe.
* *
* @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse); * @generated from protobuf rpc: DeleteAllPayments(lnrpc.DeleteAllPaymentsRequest) returns (lnrpc.DeleteAllPaymentsResponse);
*/ */
deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall<DeleteAllPaymentsRequest, DeleteAllPaymentsResponse> { deleteAllPayments(input: DeleteAllPaymentsRequest, options?: RpcOptions): UnaryCall<DeleteAllPaymentsRequest, DeleteAllPaymentsResponse> {
const method = this.methods[39], opt = this._transport.mergeOptions(options); const method = this.methods[40], opt = this._transport.mergeOptions(options);
return stackIntercept<DeleteAllPaymentsRequest, DeleteAllPaymentsResponse>("unary", this._transport, method, opt, input); return stackIntercept<DeleteAllPaymentsRequest, DeleteAllPaymentsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1383,7 +1421,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph); * @generated from protobuf rpc: DescribeGraph(lnrpc.ChannelGraphRequest) returns (lnrpc.ChannelGraph);
*/ */
describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall<ChannelGraphRequest, ChannelGraph> { describeGraph(input: ChannelGraphRequest, options?: RpcOptions): UnaryCall<ChannelGraphRequest, ChannelGraph> {
const method = this.methods[40], opt = this._transport.mergeOptions(options); const method = this.methods[41], opt = this._transport.mergeOptions(options);
return stackIntercept<ChannelGraphRequest, ChannelGraph>("unary", this._transport, method, opt, input); return stackIntercept<ChannelGraphRequest, ChannelGraph>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1394,7 +1432,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse); * @generated from protobuf rpc: GetNodeMetrics(lnrpc.NodeMetricsRequest) returns (lnrpc.NodeMetricsResponse);
*/ */
getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall<NodeMetricsRequest, NodeMetricsResponse> { getNodeMetrics(input: NodeMetricsRequest, options?: RpcOptions): UnaryCall<NodeMetricsRequest, NodeMetricsResponse> {
const method = this.methods[41], opt = this._transport.mergeOptions(options); const method = this.methods[42], opt = this._transport.mergeOptions(options);
return stackIntercept<NodeMetricsRequest, NodeMetricsResponse>("unary", this._transport, method, opt, input); return stackIntercept<NodeMetricsRequest, NodeMetricsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1407,7 +1445,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge); * @generated from protobuf rpc: GetChanInfo(lnrpc.ChanInfoRequest) returns (lnrpc.ChannelEdge);
*/ */
getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall<ChanInfoRequest, ChannelEdge> { getChanInfo(input: ChanInfoRequest, options?: RpcOptions): UnaryCall<ChanInfoRequest, ChannelEdge> {
const method = this.methods[42], opt = this._transport.mergeOptions(options); const method = this.methods[43], opt = this._transport.mergeOptions(options);
return stackIntercept<ChanInfoRequest, ChannelEdge>("unary", this._transport, method, opt, input); return stackIntercept<ChanInfoRequest, ChannelEdge>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1418,7 +1456,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo); * @generated from protobuf rpc: GetNodeInfo(lnrpc.NodeInfoRequest) returns (lnrpc.NodeInfo);
*/ */
getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall<NodeInfoRequest, NodeInfo> { getNodeInfo(input: NodeInfoRequest, options?: RpcOptions): UnaryCall<NodeInfoRequest, NodeInfo> {
const method = this.methods[43], opt = this._transport.mergeOptions(options); const method = this.methods[44], opt = this._transport.mergeOptions(options);
return stackIntercept<NodeInfoRequest, NodeInfo>("unary", this._transport, method, opt, input); return stackIntercept<NodeInfoRequest, NodeInfo>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1437,7 +1475,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse); * @generated from protobuf rpc: QueryRoutes(lnrpc.QueryRoutesRequest) returns (lnrpc.QueryRoutesResponse);
*/ */
queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall<QueryRoutesRequest, QueryRoutesResponse> { queryRoutes(input: QueryRoutesRequest, options?: RpcOptions): UnaryCall<QueryRoutesRequest, QueryRoutesResponse> {
const method = this.methods[44], opt = this._transport.mergeOptions(options); const method = this.methods[45], opt = this._transport.mergeOptions(options);
return stackIntercept<QueryRoutesRequest, QueryRoutesResponse>("unary", this._transport, method, opt, input); return stackIntercept<QueryRoutesRequest, QueryRoutesResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1448,7 +1486,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo); * @generated from protobuf rpc: GetNetworkInfo(lnrpc.NetworkInfoRequest) returns (lnrpc.NetworkInfo);
*/ */
getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall<NetworkInfoRequest, NetworkInfo> { getNetworkInfo(input: NetworkInfoRequest, options?: RpcOptions): UnaryCall<NetworkInfoRequest, NetworkInfo> {
const method = this.methods[45], opt = this._transport.mergeOptions(options); const method = this.methods[46], opt = this._transport.mergeOptions(options);
return stackIntercept<NetworkInfoRequest, NetworkInfo>("unary", this._transport, method, opt, input); return stackIntercept<NetworkInfoRequest, NetworkInfo>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1459,7 +1497,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse); * @generated from protobuf rpc: StopDaemon(lnrpc.StopRequest) returns (lnrpc.StopResponse);
*/ */
stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall<StopRequest, StopResponse> { stopDaemon(input: StopRequest, options?: RpcOptions): UnaryCall<StopRequest, StopResponse> {
const method = this.methods[46], opt = this._transport.mergeOptions(options); const method = this.methods[47], opt = this._transport.mergeOptions(options);
return stackIntercept<StopRequest, StopResponse>("unary", this._transport, method, opt, input); return stackIntercept<StopRequest, StopResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1474,7 +1512,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate); * @generated from protobuf rpc: SubscribeChannelGraph(lnrpc.GraphTopologySubscription) returns (stream lnrpc.GraphTopologyUpdate);
*/ */
subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall<GraphTopologySubscription, GraphTopologyUpdate> { subscribeChannelGraph(input: GraphTopologySubscription, options?: RpcOptions): ServerStreamingCall<GraphTopologySubscription, GraphTopologyUpdate> {
const method = this.methods[47], opt = this._transport.mergeOptions(options); const method = this.methods[48], opt = this._transport.mergeOptions(options);
return stackIntercept<GraphTopologySubscription, GraphTopologyUpdate>("serverStreaming", this._transport, method, opt, input); return stackIntercept<GraphTopologySubscription, GraphTopologyUpdate>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1487,7 +1525,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse); * @generated from protobuf rpc: DebugLevel(lnrpc.DebugLevelRequest) returns (lnrpc.DebugLevelResponse);
*/ */
debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall<DebugLevelRequest, DebugLevelResponse> { debugLevel(input: DebugLevelRequest, options?: RpcOptions): UnaryCall<DebugLevelRequest, DebugLevelResponse> {
const method = this.methods[48], opt = this._transport.mergeOptions(options); const method = this.methods[49], opt = this._transport.mergeOptions(options);
return stackIntercept<DebugLevelRequest, DebugLevelResponse>("unary", this._transport, method, opt, input); return stackIntercept<DebugLevelRequest, DebugLevelResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1498,7 +1536,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse); * @generated from protobuf rpc: FeeReport(lnrpc.FeeReportRequest) returns (lnrpc.FeeReportResponse);
*/ */
feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall<FeeReportRequest, FeeReportResponse> { feeReport(input: FeeReportRequest, options?: RpcOptions): UnaryCall<FeeReportRequest, FeeReportResponse> {
const method = this.methods[49], opt = this._transport.mergeOptions(options); const method = this.methods[50], opt = this._transport.mergeOptions(options);
return stackIntercept<FeeReportRequest, FeeReportResponse>("unary", this._transport, method, opt, input); return stackIntercept<FeeReportRequest, FeeReportResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1509,7 +1547,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse); * @generated from protobuf rpc: UpdateChannelPolicy(lnrpc.PolicyUpdateRequest) returns (lnrpc.PolicyUpdateResponse);
*/ */
updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall<PolicyUpdateRequest, PolicyUpdateResponse> { updateChannelPolicy(input: PolicyUpdateRequest, options?: RpcOptions): UnaryCall<PolicyUpdateRequest, PolicyUpdateResponse> {
const method = this.methods[50], opt = this._transport.mergeOptions(options); const method = this.methods[51], opt = this._transport.mergeOptions(options);
return stackIntercept<PolicyUpdateRequest, PolicyUpdateResponse>("unary", this._transport, method, opt, input); return stackIntercept<PolicyUpdateRequest, PolicyUpdateResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1529,7 +1567,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse); * @generated from protobuf rpc: ForwardingHistory(lnrpc.ForwardingHistoryRequest) returns (lnrpc.ForwardingHistoryResponse);
*/ */
forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall<ForwardingHistoryRequest, ForwardingHistoryResponse> { forwardingHistory(input: ForwardingHistoryRequest, options?: RpcOptions): UnaryCall<ForwardingHistoryRequest, ForwardingHistoryResponse> {
const method = this.methods[51], opt = this._transport.mergeOptions(options); const method = this.methods[52], opt = this._transport.mergeOptions(options);
return stackIntercept<ForwardingHistoryRequest, ForwardingHistoryResponse>("unary", this._transport, method, opt, input); return stackIntercept<ForwardingHistoryRequest, ForwardingHistoryResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1544,7 +1582,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup); * @generated from protobuf rpc: ExportChannelBackup(lnrpc.ExportChannelBackupRequest) returns (lnrpc.ChannelBackup);
*/ */
exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall<ExportChannelBackupRequest, ChannelBackup> { exportChannelBackup(input: ExportChannelBackupRequest, options?: RpcOptions): UnaryCall<ExportChannelBackupRequest, ChannelBackup> {
const method = this.methods[52], opt = this._transport.mergeOptions(options); const method = this.methods[53], opt = this._transport.mergeOptions(options);
return stackIntercept<ExportChannelBackupRequest, ChannelBackup>("unary", this._transport, method, opt, input); return stackIntercept<ExportChannelBackupRequest, ChannelBackup>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1558,11 +1596,11 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot); * @generated from protobuf rpc: ExportAllChannelBackups(lnrpc.ChanBackupExportRequest) returns (lnrpc.ChanBackupSnapshot);
*/ */
exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall<ChanBackupExportRequest, ChanBackupSnapshot> { exportAllChannelBackups(input: ChanBackupExportRequest, options?: RpcOptions): UnaryCall<ChanBackupExportRequest, ChanBackupSnapshot> {
const method = this.methods[53], opt = this._transport.mergeOptions(options); const method = this.methods[54], opt = this._transport.mergeOptions(options);
return stackIntercept<ChanBackupExportRequest, ChanBackupSnapshot>("unary", this._transport, method, opt, input); return stackIntercept<ChanBackupExportRequest, ChanBackupSnapshot>("unary", this._transport, method, opt, input);
} }
/** /**
* * lncli: `verifychanbackup`
* VerifyChanBackup allows a caller to verify the integrity of a channel backup * VerifyChanBackup allows a caller to verify the integrity of a channel backup
* snapshot. This method will accept either a packed Single or a packed Multi. * snapshot. This method will accept either a packed Single or a packed Multi.
* Specifying both will result in an error. * Specifying both will result in an error.
@ -1570,7 +1608,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse); * @generated from protobuf rpc: VerifyChanBackup(lnrpc.ChanBackupSnapshot) returns (lnrpc.VerifyChanBackupResponse);
*/ */
verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall<ChanBackupSnapshot, VerifyChanBackupResponse> { verifyChanBackup(input: ChanBackupSnapshot, options?: RpcOptions): UnaryCall<ChanBackupSnapshot, VerifyChanBackupResponse> {
const method = this.methods[54], opt = this._transport.mergeOptions(options); const method = this.methods[55], opt = this._transport.mergeOptions(options);
return stackIntercept<ChanBackupSnapshot, VerifyChanBackupResponse>("unary", this._transport, method, opt, input); return stackIntercept<ChanBackupSnapshot, VerifyChanBackupResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1583,7 +1621,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse); * @generated from protobuf rpc: RestoreChannelBackups(lnrpc.RestoreChanBackupRequest) returns (lnrpc.RestoreBackupResponse);
*/ */
restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall<RestoreChanBackupRequest, RestoreBackupResponse> { restoreChannelBackups(input: RestoreChanBackupRequest, options?: RpcOptions): UnaryCall<RestoreChanBackupRequest, RestoreBackupResponse> {
const method = this.methods[55], opt = this._transport.mergeOptions(options); const method = this.methods[56], opt = this._transport.mergeOptions(options);
return stackIntercept<RestoreChanBackupRequest, RestoreBackupResponse>("unary", this._transport, method, opt, input); return stackIntercept<RestoreChanBackupRequest, RestoreBackupResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1599,7 +1637,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot); * @generated from protobuf rpc: SubscribeChannelBackups(lnrpc.ChannelBackupSubscription) returns (stream lnrpc.ChanBackupSnapshot);
*/ */
subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall<ChannelBackupSubscription, ChanBackupSnapshot> { subscribeChannelBackups(input: ChannelBackupSubscription, options?: RpcOptions): ServerStreamingCall<ChannelBackupSubscription, ChanBackupSnapshot> {
const method = this.methods[56], opt = this._transport.mergeOptions(options); const method = this.methods[57], opt = this._transport.mergeOptions(options);
return stackIntercept<ChannelBackupSubscription, ChanBackupSnapshot>("serverStreaming", this._transport, method, opt, input); return stackIntercept<ChannelBackupSubscription, ChanBackupSnapshot>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1611,7 +1649,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse); * @generated from protobuf rpc: BakeMacaroon(lnrpc.BakeMacaroonRequest) returns (lnrpc.BakeMacaroonResponse);
*/ */
bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall<BakeMacaroonRequest, BakeMacaroonResponse> { bakeMacaroon(input: BakeMacaroonRequest, options?: RpcOptions): UnaryCall<BakeMacaroonRequest, BakeMacaroonResponse> {
const method = this.methods[57], opt = this._transport.mergeOptions(options); const method = this.methods[58], opt = this._transport.mergeOptions(options);
return stackIntercept<BakeMacaroonRequest, BakeMacaroonResponse>("unary", this._transport, method, opt, input); return stackIntercept<BakeMacaroonRequest, BakeMacaroonResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1621,7 +1659,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse); * @generated from protobuf rpc: ListMacaroonIDs(lnrpc.ListMacaroonIDsRequest) returns (lnrpc.ListMacaroonIDsResponse);
*/ */
listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall<ListMacaroonIDsRequest, ListMacaroonIDsResponse> { listMacaroonIDs(input: ListMacaroonIDsRequest, options?: RpcOptions): UnaryCall<ListMacaroonIDsRequest, ListMacaroonIDsResponse> {
const method = this.methods[58], opt = this._transport.mergeOptions(options); const method = this.methods[59], opt = this._transport.mergeOptions(options);
return stackIntercept<ListMacaroonIDsRequest, ListMacaroonIDsResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListMacaroonIDsRequest, ListMacaroonIDsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1632,7 +1670,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse); * @generated from protobuf rpc: DeleteMacaroonID(lnrpc.DeleteMacaroonIDRequest) returns (lnrpc.DeleteMacaroonIDResponse);
*/ */
deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall<DeleteMacaroonIDRequest, DeleteMacaroonIDResponse> { deleteMacaroonID(input: DeleteMacaroonIDRequest, options?: RpcOptions): UnaryCall<DeleteMacaroonIDRequest, DeleteMacaroonIDResponse> {
const method = this.methods[59], opt = this._transport.mergeOptions(options); const method = this.methods[60], opt = this._transport.mergeOptions(options);
return stackIntercept<DeleteMacaroonIDRequest, DeleteMacaroonIDResponse>("unary", this._transport, method, opt, input); return stackIntercept<DeleteMacaroonIDRequest, DeleteMacaroonIDResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1643,7 +1681,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse); * @generated from protobuf rpc: ListPermissions(lnrpc.ListPermissionsRequest) returns (lnrpc.ListPermissionsResponse);
*/ */
listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall<ListPermissionsRequest, ListPermissionsResponse> { listPermissions(input: ListPermissionsRequest, options?: RpcOptions): UnaryCall<ListPermissionsRequest, ListPermissionsResponse> {
const method = this.methods[60], opt = this._transport.mergeOptions(options); const method = this.methods[61], opt = this._transport.mergeOptions(options);
return stackIntercept<ListPermissionsRequest, ListPermissionsResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListPermissionsRequest, ListPermissionsResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1655,7 +1693,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse); * @generated from protobuf rpc: CheckMacaroonPermissions(lnrpc.CheckMacPermRequest) returns (lnrpc.CheckMacPermResponse);
*/ */
checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall<CheckMacPermRequest, CheckMacPermResponse> { checkMacaroonPermissions(input: CheckMacPermRequest, options?: RpcOptions): UnaryCall<CheckMacPermRequest, CheckMacPermResponse> {
const method = this.methods[61], opt = this._transport.mergeOptions(options); const method = this.methods[62], opt = this._transport.mergeOptions(options);
return stackIntercept<CheckMacPermRequest, CheckMacPermResponse>("unary", this._transport, method, opt, input); return stackIntercept<CheckMacPermRequest, CheckMacPermResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1676,7 +1714,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest); * @generated from protobuf rpc: RegisterRPCMiddleware(stream lnrpc.RPCMiddlewareResponse) returns (stream lnrpc.RPCMiddlewareRequest);
*/ */
registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall<RPCMiddlewareResponse, RPCMiddlewareRequest> { registerRPCMiddleware(options?: RpcOptions): DuplexStreamingCall<RPCMiddlewareResponse, RPCMiddlewareRequest> {
const method = this.methods[62], opt = this._transport.mergeOptions(options); const method = this.methods[63], opt = this._transport.mergeOptions(options);
return stackIntercept<RPCMiddlewareResponse, RPCMiddlewareRequest>("duplex", this._transport, method, opt); return stackIntercept<RPCMiddlewareResponse, RPCMiddlewareRequest>("duplex", this._transport, method, opt);
} }
/** /**
@ -1686,7 +1724,7 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse); * @generated from protobuf rpc: SendCustomMessage(lnrpc.SendCustomMessageRequest) returns (lnrpc.SendCustomMessageResponse);
*/ */
sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall<SendCustomMessageRequest, SendCustomMessageResponse> { sendCustomMessage(input: SendCustomMessageRequest, options?: RpcOptions): UnaryCall<SendCustomMessageRequest, SendCustomMessageResponse> {
const method = this.methods[63], opt = this._transport.mergeOptions(options); const method = this.methods[64], opt = this._transport.mergeOptions(options);
return stackIntercept<SendCustomMessageRequest, SendCustomMessageResponse>("unary", this._transport, method, opt, input); return stackIntercept<SendCustomMessageRequest, SendCustomMessageResponse>("unary", this._transport, method, opt, input);
} }
/** /**
@ -1694,10 +1732,14 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* SubscribeCustomMessages subscribes to a stream of incoming custom peer * SubscribeCustomMessages subscribes to a stream of incoming custom peer
* messages. * messages.
* *
* To include messages with type outside of the custom range (>= 32768) lnd
* needs to be compiled with the `dev` build tag, and the message type to
* override should be specified in lnd's experimental protocol configuration.
*
* @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage); * @generated from protobuf rpc: SubscribeCustomMessages(lnrpc.SubscribeCustomMessagesRequest) returns (stream lnrpc.CustomMessage);
*/ */
subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall<SubscribeCustomMessagesRequest, CustomMessage> { subscribeCustomMessages(input: SubscribeCustomMessagesRequest, options?: RpcOptions): ServerStreamingCall<SubscribeCustomMessagesRequest, CustomMessage> {
const method = this.methods[64], opt = this._transport.mergeOptions(options); const method = this.methods[65], opt = this._transport.mergeOptions(options);
return stackIntercept<SubscribeCustomMessagesRequest, CustomMessage>("serverStreaming", this._transport, method, opt, input); return stackIntercept<SubscribeCustomMessagesRequest, CustomMessage>("serverStreaming", this._transport, method, opt, input);
} }
/** /**
@ -1709,14 +1751,19 @@ export class LightningClient implements ILightningClient, ServiceInfo {
* @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse); * @generated from protobuf rpc: ListAliases(lnrpc.ListAliasesRequest) returns (lnrpc.ListAliasesResponse);
*/ */
listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall<ListAliasesRequest, ListAliasesResponse> { listAliases(input: ListAliasesRequest, options?: RpcOptions): UnaryCall<ListAliasesRequest, ListAliasesResponse> {
const method = this.methods[65], opt = this._transport.mergeOptions(options); const method = this.methods[66], opt = this._transport.mergeOptions(options);
return stackIntercept<ListAliasesRequest, ListAliasesResponse>("unary", this._transport, method, opt, input); return stackIntercept<ListAliasesRequest, ListAliasesResponse>("unary", this._transport, method, opt, input);
} }
/** /**
* @generated from protobuf rpc: LookupHtlc(lnrpc.LookupHtlcRequest) returns (lnrpc.LookupHtlcResponse); *
* LookupHtlcResolution retrieves a final htlc resolution from the database.
* If the htlc has no final resolution yet, a NotFound grpc status code is
* returned.
*
* @generated from protobuf rpc: LookupHtlcResolution(lnrpc.LookupHtlcResolutionRequest) returns (lnrpc.LookupHtlcResolutionResponse);
*/ */
lookupHtlc(input: LookupHtlcRequest, options?: RpcOptions): UnaryCall<LookupHtlcRequest, LookupHtlcResponse> { lookupHtlcResolution(input: LookupHtlcResolutionRequest, options?: RpcOptions): UnaryCall<LookupHtlcResolutionRequest, LookupHtlcResolutionResponse> {
const method = this.methods[66], opt = this._transport.mergeOptions(options); const method = this.methods[67], opt = this._transport.mergeOptions(options);
return stackIntercept<LookupHtlcRequest, LookupHtlcResponse>("unary", this._transport, method, opt, input); return stackIntercept<LookupHtlcResolutionRequest, LookupHtlcResolutionResponse>("unary", this._transport, method, opt, input);
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -3,16 +3,16 @@
// tslint:disable // tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { WalletUnlocker } from "./walletunlocker.js"; import { WalletUnlocker } from "./walletunlocker";
import type { ChangePasswordResponse } from "./walletunlocker.js"; import type { ChangePasswordResponse } from "./walletunlocker";
import type { ChangePasswordRequest } from "./walletunlocker.js"; import type { ChangePasswordRequest } from "./walletunlocker";
import type { UnlockWalletResponse } from "./walletunlocker.js"; import type { UnlockWalletResponse } from "./walletunlocker";
import type { UnlockWalletRequest } from "./walletunlocker.js"; import type { UnlockWalletRequest } from "./walletunlocker";
import type { InitWalletResponse } from "./walletunlocker.js"; import type { InitWalletResponse } from "./walletunlocker";
import type { InitWalletRequest } from "./walletunlocker.js"; import type { InitWalletRequest } from "./walletunlocker";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { GenSeedResponse } from "./walletunlocker.js"; import type { GenSeedResponse } from "./walletunlocker";
import type { GenSeedRequest } from "./walletunlocker.js"; import type { GenSeedRequest } from "./walletunlocker";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
// //

View file

@ -12,7 +12,7 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime";
import { ChanBackupSnapshot } from "./lightning.js"; import { ChanBackupSnapshot } from "./lightning";
/** /**
* @generated from protobuf message lnrpc.GenSeedRequest * @generated from protobuf message lnrpc.GenSeedRequest
*/ */

View file

@ -101,8 +101,10 @@ service Lightning {
rpc SignMessage (SignMessageRequest) returns (SignMessageResponse); rpc SignMessage (SignMessageRequest) returns (SignMessageResponse);
/* lncli: `verifymessage` /* lncli: `verifymessage`
VerifyMessage verifies a signature over a msg. The signature must be VerifyMessage verifies a signature over a message and recovers the signer's
zbase32 encoded and signed by an active node in the resident node's public key. The signature is only deemed valid if the recovered public key
corresponds to a node key in the public Lightning network. The signature
must be zbase32 encoded and signed by an active node in the resident node's
channel database. In addition to returning the validity of the signature, channel database. In addition to returning the validity of the signature,
VerifyMessage also returns the recovered pubkey from the signature. VerifyMessage also returns the recovered pubkey from the signature.
*/ */
@ -141,6 +143,13 @@ service Lightning {
*/ */
rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
/* lncli: 'getdebuginfo'
GetDebugInfo returns debug information concerning the state of the daemon
and its subsystems. This includes the full configuration and the latest log
entries from the log file.
*/
rpc GetDebugInfo (GetDebugInfoRequest) returns (GetDebugInfoResponse);
/** lncli: `getrecoveryinfo` /** lncli: `getrecoveryinfo`
GetRecoveryInfo returns information concerning the recovery mode including GetRecoveryInfo returns information concerning the recovery mode including
whether it's in a recovery mode, whether the recovery is finished, and the whether it's in a recovery mode, whether the recovery is finished, and the
@ -320,7 +329,7 @@ service Lightning {
optionally specify the add_index and/or the settle_index. If the add_index optionally specify the add_index and/or the settle_index. If the add_index
is specified, then we'll first start by sending add invoice events for all is specified, then we'll first start by sending add invoice events for all
invoices with an add_index greater than the specified value. If the invoices with an add_index greater than the specified value. If the
settle_index is specified, the next, we'll send out all settle events for settle_index is specified, then next, we'll send out all settle events for
invoices with a settle_index greater than the specified value. One or both invoices with a settle_index greater than the specified value. One or both
of these fields can be set. If no fields are set, then we'll only send out of these fields can be set. If no fields are set, then we'll only send out
the latest add/settle events. the latest add/settle events.
@ -339,13 +348,13 @@ service Lightning {
*/ */
rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse); rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse);
/* /* lncli: `deletepayments`
DeletePayment deletes an outgoing payment from DB. Note that it will not DeletePayment deletes an outgoing payment from DB. Note that it will not
attempt to delete an In-Flight payment, since that would be unsafe. attempt to delete an In-Flight payment, since that would be unsafe.
*/ */
rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse); rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse);
/* /* lncli: `deletepayments --all`
DeleteAllPayments deletes all outgoing payments from DB. Note that it will DeleteAllPayments deletes all outgoing payments from DB. Note that it will
not attempt to delete In-Flight payments, since that would be unsafe. not attempt to delete In-Flight payments, since that would be unsafe.
*/ */
@ -477,7 +486,7 @@ service Lightning {
rpc ExportAllChannelBackups (ChanBackupExportRequest) rpc ExportAllChannelBackups (ChanBackupExportRequest)
returns (ChanBackupSnapshot); returns (ChanBackupSnapshot);
/* /* lncli: `verifychanbackup`
VerifyChanBackup allows a caller to verify the integrity of a channel backup VerifyChanBackup allows a caller to verify the integrity of a channel backup
snapshot. This method will accept either a packed Single or a packed Multi. snapshot. This method will accept either a packed Single or a packed Multi.
Specifying both will result in an error. Specifying both will result in an error.
@ -567,6 +576,10 @@ service Lightning {
/* lncli: `subscribecustom` /* lncli: `subscribecustom`
SubscribeCustomMessages subscribes to a stream of incoming custom peer SubscribeCustomMessages subscribes to a stream of incoming custom peer
messages. messages.
To include messages with type outside of the custom range (>= 32768) lnd
needs to be compiled with the `dev` build tag, and the message type to
override should be specified in lnd's experimental protocol configuration.
*/ */
rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest) rpc SubscribeCustomMessages (SubscribeCustomMessagesRequest)
returns (stream CustomMessage); returns (stream CustomMessage);
@ -578,18 +591,26 @@ service Lightning {
*/ */
rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse); rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse);
rpc LookupHtlc (LookupHtlcRequest) returns (LookupHtlcResponse); /*
LookupHtlcResolution retrieves a final htlc resolution from the database.
If the htlc has no final resolution yet, a NotFound grpc status code is
returned.
*/
rpc LookupHtlcResolution (LookupHtlcResolutionRequest)
returns (LookupHtlcResolutionResponse);
} }
message LookupHtlcRequest { message LookupHtlcResolutionRequest {
uint64 chan_id = 1; uint64 chan_id = 1;
uint64 htlc_index = 2; uint64 htlc_index = 2;
} }
message LookupHtlcResponse { message LookupHtlcResolutionResponse {
// Settled is true is the htlc was settled. If false, the htlc was failed.
bool settled = 1; bool settled = 1;
// Offchain indicates whether the htlc was resolved off-chain or on-chain.
bool offchain = 2; bool offchain = 2;
} }
@ -612,6 +633,9 @@ message SendCustomMessageRequest {
bytes peer = 1; bytes peer = 1;
// Message type. This value needs to be in the custom range (>= 32768). // Message type. This value needs to be in the custom range (>= 32768).
// To send a type < custom range, lnd needs to be compiled with the `dev`
// build tag, and the message type to override should be specified in lnd's
// experimental protocol configuration.
uint32 type = 2; uint32 type = 2;
// Raw message data. // Raw message data.
@ -860,7 +884,8 @@ message SendRequest {
repeated FeatureBit dest_features = 15; repeated FeatureBit dest_features = 15;
/* /*
The payment address of the generated invoice. The payment address of the generated invoice. This is also called
payment secret in specifications (e.g. BOLT 11).
*/ */
bytes payment_addr = 16; bytes payment_addr = 16;
} }
@ -1066,6 +1091,18 @@ message LightningAddress {
string host = 2; string host = 2;
} }
enum CoinSelectionStrategy {
// Use the coin selection strategy defined in the global configuration
// (lnd.conf).
STRATEGY_USE_GLOBAL_CONFIG = 0;
// Select the largest available coins first during coin selection.
STRATEGY_LARGEST = 1;
// Randomly select the available coins during coin selection.
STRATEGY_RANDOM = 2;
}
message EstimateFeeRequest { message EstimateFeeRequest {
// The map from addresses to amounts for the transaction. // The map from addresses to amounts for the transaction.
map<string, int64> AddrToAmount = 1; map<string, int64> AddrToAmount = 1;
@ -1080,6 +1117,9 @@ message EstimateFeeRequest {
// Whether unconfirmed outputs should be used as inputs for the transaction. // Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 4; bool spend_unconfirmed = 4;
// The strategy to use for selecting coins during fees estimation.
CoinSelectionStrategy coin_selection_strategy = 5;
} }
message EstimateFeeResponse { message EstimateFeeResponse {
@ -1120,6 +1160,9 @@ message SendManyRequest {
// Whether unconfirmed outputs should be used as inputs for the transaction. // Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 8; bool spend_unconfirmed = 8;
// The strategy to use for selecting coins during sending many requests.
CoinSelectionStrategy coin_selection_strategy = 9;
} }
message SendManyResponse { message SendManyResponse {
// The id of the transaction // The id of the transaction
@ -1147,9 +1190,8 @@ message SendCoinsRequest {
int64 sat_per_byte = 5 [deprecated = true]; int64 sat_per_byte = 5 [deprecated = true];
/* /*
If set, then the amount field will be ignored, and lnd will attempt to If set, the amount field should be unset. It indicates lnd will send all
send all the coins under control of the internal wallet to the specified wallet coins or all selected coins to the specified address.
address.
*/ */
bool send_all = 6; bool send_all = 6;
@ -1162,6 +1204,12 @@ message SendCoinsRequest {
// Whether unconfirmed outputs should be used as inputs for the transaction. // Whether unconfirmed outputs should be used as inputs for the transaction.
bool spend_unconfirmed = 9; bool spend_unconfirmed = 9;
// The strategy to use for selecting coins.
CoinSelectionStrategy coin_selection_strategy = 10;
// A list of selected outpoints as inputs for the transaction.
repeated OutPoint outpoints = 11;
} }
message SendCoinsResponse { message SendCoinsResponse {
// The transaction ID of the transaction // The transaction ID of the transaction
@ -1335,6 +1383,13 @@ enum CommitmentType {
channel before its maturity date. channel before its maturity date.
*/ */
SCRIPT_ENFORCED_LEASE = 4; SCRIPT_ENFORCED_LEASE = 4;
/*
A channel that uses musig2 for the funding output, and the new tapscript
features where relevant.
*/
// TODO(roasbeef): need script enforce mirror type for the above as well?
SIMPLE_TAPROOT = 5;
} }
message ChannelConstraints { message ChannelConstraints {
@ -1524,6 +1579,19 @@ message Channel {
// This is the confirmed / on-chain zero-conf SCID. // This is the confirmed / on-chain zero-conf SCID.
uint64 zero_conf_confirmed_scid = 33; uint64 zero_conf_confirmed_scid = 33;
// The configured alias name of our peer.
string peer_alias = 34;
// This is the peer SCID alias.
uint64 peer_scid_alias = 35 [jstype = JS_STRING];
/*
An optional note-to-self to go along with the channel containing some
useful information. This is only ever stored locally and in no way impacts
the channel's operation.
*/
string memo = 36;
} }
message ListChannelsRequest { message ListChannelsRequest {
@ -1537,6 +1605,11 @@ message ListChannelsRequest {
empty, all channels will be returned. empty, all channels will be returned.
*/ */
bytes peer = 5; bytes peer = 5;
// Informs the server if the peer alias lookup per channel should be
// enabled. It is turned off by default in order to avoid degradation of
// performance for existing clients.
bool peer_alias_lookup = 6;
} }
message ListChannelsResponse { message ListChannelsResponse {
// The list of active channels // The list of active channels
@ -1884,12 +1957,16 @@ message GetInfoResponse {
/* /*
Whether the current node is connected to testnet. This field is Whether the current node is connected to testnet. This field is
deprecated and the network field should be used instead deprecated and the network field should be used instead
**/ */
bool testnet = 10 [deprecated = true]; bool testnet = 10 [deprecated = true];
reserved 11; reserved 11;
// A list of active chains the node is connected to /*
A list of active chains the node is connected to. This will only
ever contain a single entry since LND will only ever have a single
chain backend during its lifetime.
*/
repeated Chain chains = 16; repeated Chain chains = 16;
// The URIs of the current node. // The URIs of the current node.
@ -1905,6 +1982,17 @@ message GetInfoResponse {
Indicates whether the HTLC interceptor API is in always-on mode. Indicates whether the HTLC interceptor API is in always-on mode.
*/ */
bool require_htlc_interceptor = 21; bool require_htlc_interceptor = 21;
// Indicates whether final htlc resolutions are stored on disk.
bool store_final_htlc_resolutions = 22;
}
message GetDebugInfoRequest {
}
message GetDebugInfoResponse {
map<string, string> config = 1;
repeated string log = 2;
} }
message GetRecoveryInfoRequest { message GetRecoveryInfoRequest {
@ -1921,8 +2009,9 @@ message GetRecoveryInfoResponse {
} }
message Chain { message Chain {
// The blockchain the node is on (eg bitcoin, litecoin) // Deprecated. The chain is now always assumed to be bitcoin.
string chain = 1; // The blockchain the node is on (must be bitcoin)
string chain = 1 [deprecated = true];
// The network the node is on (eg regtest, testnet, mainnet) // The network the node is on (eg regtest, testnet, mainnet)
string network = 2; string network = 2;
@ -1982,12 +2071,18 @@ message CloseChannelRequest {
// //
// NOTE: This field is only respected if we're the initiator of the channel. // NOTE: This field is only respected if we're the initiator of the channel.
uint64 max_fee_per_vbyte = 7; uint64 max_fee_per_vbyte = 7;
// If true, then the rpc call will not block while it awaits a closing txid.
// Consequently this RPC call will not return a closing txid if this value
// is set.
bool no_wait = 8;
} }
message CloseStatusUpdate { message CloseStatusUpdate {
oneof update { oneof update {
PendingUpdate close_pending = 1; PendingUpdate close_pending = 1;
ChannelCloseUpdate chan_close = 3; ChannelCloseUpdate chan_close = 3;
InstantUpdate close_instant = 4;
} }
} }
@ -1996,6 +2091,9 @@ message PendingUpdate {
uint32 output_index = 2; uint32 output_index = 2;
} }
message InstantUpdate {
}
message ReadyForPsbtFunding { message ReadyForPsbtFunding {
/* /*
The P2WSH address of the channel funding multisig address that the below The P2WSH address of the channel funding multisig address that the below
@ -2040,6 +2138,9 @@ message BatchOpenChannelRequest {
// An optional label for the batch transaction, limited to 500 characters. // An optional label for the batch transaction, limited to 500 characters.
string label = 6; string label = 6;
// The strategy to use for selecting coins during batch opening channels.
CoinSelectionStrategy coin_selection_strategy = 7;
} }
message BatchOpenChannel { message BatchOpenChannel {
@ -2090,6 +2191,76 @@ message BatchOpenChannel {
the remote peer supports explicit channel negotiation. the remote peer supports explicit channel negotiation.
*/ */
CommitmentType commitment_type = 9; CommitmentType commitment_type = 9;
/*
The maximum amount of coins in millisatoshi that can be pending within
the channel. It only applies to the remote party.
*/
uint64 remote_max_value_in_flight_msat = 10;
/*
The maximum number of concurrent HTLCs we will allow the remote party to add
to the commitment transaction.
*/
uint32 remote_max_htlcs = 11;
/*
Max local csv is the maximum csv delay we will allow for our own commitment
transaction.
*/
uint32 max_local_csv = 12;
/*
If this is true, then a zero-conf channel open will be attempted.
*/
bool zero_conf = 13;
/*
If this is true, then an option-scid-alias channel-type open will be
attempted.
*/
bool scid_alias = 14;
/*
The base fee charged regardless of the number of milli-satoshis sent.
*/
uint64 base_fee = 15;
/*
The fee rate in ppm (parts per million) that will be charged in
proportion of the value of each forwarded HTLC.
*/
uint64 fee_rate = 16;
/*
If use_base_fee is true the open channel announcement will update the
channel base fee with the value specified in base_fee. In the case of
a base_fee of 0 use_base_fee is needed downstream to distinguish whether
to use the default base fee value specified in the config or 0.
*/
bool use_base_fee = 17;
/*
If use_fee_rate is true the open channel announcement will update the
channel fee rate with the value specified in fee_rate. In the case of
a fee_rate of 0 use_fee_rate is needed downstream to distinguish whether
to use the default fee rate value specified in the config or 0.
*/
bool use_fee_rate = 18;
/*
The number of satoshis we require the remote peer to reserve. This value,
if specified, must be above the dust limit and below 20% of the channel
capacity.
*/
uint64 remote_chan_reserve_sat = 19;
/*
An optional note-to-self to go along with the channel containing some
useful information. This is only ever stored locally and in no way impacts
the channel's operation.
*/
string memo = 20;
} }
message BatchOpenChannelResponse { message BatchOpenChannelResponse {
@ -2238,6 +2409,25 @@ message OpenChannelRequest {
capacity. capacity.
*/ */
uint64 remote_chan_reserve_sat = 25; uint64 remote_chan_reserve_sat = 25;
/*
If set, then lnd will attempt to commit all the coins under control of the
internal wallet to open the channel, and the LocalFundingAmount field must
be zero and is ignored.
*/
bool fund_max = 26;
/*
An optional note-to-self to go along with the channel containing some
useful information. This is only ever stored locally and in no way impacts
the channel's operation.
*/
string memo = 27;
/*
A list of selected outpoints that are allocated for channel funding.
*/
repeated OutPoint outpoints = 28;
} }
message OpenStatusUpdate { message OpenStatusUpdate {
oneof update { oneof update {
@ -2319,6 +2509,11 @@ message ChanPointShim {
the value is less than 500,000, or as an absolute height otherwise. the value is less than 500,000, or as an absolute height otherwise.
*/ */
uint32 thaw_height = 6; uint32 thaw_height = 6;
/*
Indicates that the funding output is using a MuSig2 multi-sig output.
*/
bool musig2 = 7;
} }
message PsbtShim { message PsbtShim {
@ -2469,6 +2664,9 @@ message PendingHTLC {
} }
message PendingChannelsRequest { message PendingChannelsRequest {
// Indicates whether to include the raw transaction hex for
// waiting_close_channels.
bool include_raw_tx = 1;
} }
message PendingChannelsResponse { message PendingChannelsResponse {
message PendingChannel { message PendingChannel {
@ -2504,6 +2702,13 @@ message PendingChannelsResponse {
// Whether this channel is advertised to the network or not. // Whether this channel is advertised to the network or not.
bool private = 12; bool private = 12;
/*
An optional note-to-self to go along with the channel containing some
useful information. This is only ever stored locally and in no way
impacts the channel's operation.
*/
string memo = 13;
} }
message PendingOpenChannel { message PendingOpenChannel {
@ -2531,6 +2736,17 @@ message PendingChannelsResponse {
// Previously used for confirmation_height. Do not reuse. // Previously used for confirmation_height. Do not reuse.
reserved 2; reserved 2;
// The number of blocks until the funding transaction is considered
// expired. If this value gets close to zero, there is a risk that the
// channel funding will be canceled by the channel responder. The
// channel should be fee bumped using CPFP (see walletrpc.BumpFee) to
// ensure that the channel confirms in time. Otherwise a force-close
// will be necessary if the channel confirms after the funding
// transaction expires. A negative value means the channel responder has
// very likely canceled the funding and the channel will never become
// fully operational.
int32 funding_expiry_blocks = 3;
} }
message WaitingCloseChannel { message WaitingCloseChannel {
@ -2548,6 +2764,10 @@ message PendingChannelsResponse {
// The transaction id of the closing transaction // The transaction id of the closing transaction
string closing_txid = 4; string closing_txid = 4;
// The raw hex encoded bytes of the closing transaction. Included if
// include_raw_tx in the request is true.
string closing_tx_hex = 5;
} }
message Commitments { message Commitments {
@ -2683,6 +2903,14 @@ message WalletAccountBalance {
} }
message WalletBalanceRequest { message WalletBalanceRequest {
// The wallet account the balance is shown for.
// If this is not specified, the balance of the "default" account is shown.
string account = 1;
// The minimum number of confirmations each one of your outputs used for the
// funding transaction must satisfy. If this is not specified, the default
// value of 1 is used.
int32 min_confs = 2;
} }
message WalletBalanceResponse { message WalletBalanceResponse {
@ -2768,6 +2996,9 @@ message QueryRoutesRequest {
not add any additional block padding on top of final_ctlv_delta. This not add any additional block padding on top of final_ctlv_delta. This
padding of a few blocks needs to be added manually or otherwise failures may padding of a few blocks needs to be added manually or otherwise failures may
happen when a block comes in while the payment is in flight. happen when a block comes in while the payment is in flight.
Note: must not be set if making a payment to a blinded path (delta is
set by the aggregate parameters provided by blinded_payment_paths)
*/ */
int32 final_cltv_delta = 4; int32 final_cltv_delta = 4;
@ -2841,12 +3072,21 @@ message QueryRoutesRequest {
*/ */
repeated lnrpc.RouteHint route_hints = 16; repeated lnrpc.RouteHint route_hints = 16;
/*
An optional blinded path(s) to reach the destination. Note that the
introduction node must be provided as the first hop in the route.
*/
repeated BlindedPaymentPath blinded_payment_paths = 19;
/* /*
Features assumed to be supported by the final node. All transitive feature Features assumed to be supported by the final node. All transitive feature
dependencies must also be set properly. For a given feature bit pair, either dependencies must also be set properly. For a given feature bit pair, either
optional or remote may be set, but not both. If this field is nil or empty, optional or remote may be set, but not both. If this field is nil or empty,
the router will try to load destination features from the graph as a the router will try to load destination features from the graph as a
fallback. fallback.
Note: must not be set if making a payment to a blinded route (features
are provided in blinded_payment_paths).
*/ */
repeated lnrpc.FeatureBit dest_features = 17; repeated lnrpc.FeatureBit dest_features = 17;
@ -2952,6 +3192,32 @@ message Hop {
// The payment metadata to send along with the payment to the payee. // The payment metadata to send along with the payment to the payee.
bytes metadata = 13; bytes metadata = 13;
/*
Blinding point is an optional blinding point included for introduction
nodes in blinded paths. This field is mandatory for hops that represents
the introduction point in a blinded path.
*/
bytes blinding_point = 14;
/*
Encrypted data is a receiver-produced blob of data that provides hops
in a blinded route with forwarding data. As this data is encrypted by
the recipient, we will not be able to parse it - it is essentially an
arbitrary blob of data from our node's perspective. This field is
mandatory for all hops in a blinded path, including the introduction
node.
*/
bytes encrypted_data = 15;
/*
The total amount that is sent to the recipient (possibly across multiple
HTLCs), as specified by the sender when making a payment to a blinded path.
This value is only set in the final hop payload of a blinded payment. This
value is analogous to the MPPRecord that is used for regular (non-blinded)
MPP payments.
*/
uint64 total_amt_msat = 16;
} }
message MPPRecord { message MPPRecord {
@ -2959,7 +3225,8 @@ message MPPRecord {
A unique, random identifier used to authenticate the sender as the intended A unique, random identifier used to authenticate the sender as the intended
payer of a multi-path payment. The payment_addr must be the same for all payer of a multi-path payment. The payment_addr must be the same for all
subpayments, and match the payment_addr provided in the receiver's invoice. subpayments, and match the payment_addr provided in the receiver's invoice.
The same payment_addr must be used on all subpayments. The same payment_addr must be used on all subpayments. This is also called
payment secret in specifications (e.g. BOLT 11).
*/ */
bytes payment_addr = 11; bytes payment_addr = 11;
@ -3089,6 +3356,9 @@ message RoutingPolicy {
// Custom channel update tlv records. // Custom channel update tlv records.
map<uint64, bytes> custom_records = 8; map<uint64, bytes> custom_records = 8;
int32 inbound_fee_base_msat = 9;
int32 inbound_fee_rate_milli_msat = 10;
} }
/* /*
@ -3175,6 +3445,10 @@ message ChanInfoRequest {
output index for the channel. output index for the channel.
*/ */
uint64 chan_id = 1 [jstype = JS_STRING]; uint64 chan_id = 1 [jstype = JS_STRING];
// The channel point of the channel in format funding_txid:output_index. If
// chan_id is specified, this field is ignored.
string chan_point = 2;
} }
message NetworkInfoRequest { message NetworkInfoRequest {
@ -3297,6 +3571,64 @@ message RouteHint {
repeated HopHint hop_hints = 1; repeated HopHint hop_hints = 1;
} }
message BlindedPaymentPath {
// The blinded path to send the payment to.
BlindedPath blinded_path = 1;
// The base fee for the blinded path provided, expressed in msat.
uint64 base_fee_msat = 2;
/*
The proportional fee for the blinded path provided, expressed in parts
per million.
*/
uint32 proportional_fee_rate = 3;
/*
The total CLTV delta for the blinded path provided, including the
final CLTV delta for the receiving node.
*/
uint32 total_cltv_delta = 4;
/*
The minimum hltc size that may be sent over the blinded path, expressed
in msat.
*/
uint64 htlc_min_msat = 5;
/*
The maximum htlc size that may be sent over the blinded path, expressed
in msat.
*/
uint64 htlc_max_msat = 6;
// The feature bits for the route.
repeated FeatureBit features = 7;
}
message BlindedPath {
// The unblinded pubkey of the introduction node for the route.
bytes introduction_node = 1;
// The ephemeral pubkey used by nodes in the blinded route.
bytes blinding_point = 2;
/*
A set of blinded node keys and data blobs for the blinded portion of the
route. Note that the first hop is expected to be the introduction node,
so the route is always expected to have at least one hop.
*/
repeated BlindedHop blinded_hops = 3;
}
message BlindedHop {
// The blinded public key of the node.
bytes blinded_node = 1;
// An encrypted blob of data provided to the blinded node.
bytes encrypted_data = 2;
}
message AMPInvoiceState { message AMPInvoiceState {
// The state the HTLCs associated with this setID are in. // The state the HTLCs associated with this setID are in.
InvoiceHTLCState state = 1; InvoiceHTLCState state = 1;
@ -3351,7 +3683,7 @@ message Invoice {
int64 value_msat = 23; int64 value_msat = 23;
/* /*
Whether this invoice has been fulfilled Whether this invoice has been fulfilled.
The field is deprecated. Use the state field instead (compare to SETTLED). The field is deprecated. Use the state field instead (compare to SETTLED).
*/ */
@ -3359,12 +3691,14 @@ message Invoice {
/* /*
When this invoice was created. When this invoice was created.
Measured in seconds since the unix epoch.
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
int64 creation_date = 7; int64 creation_date = 7;
/* /*
When this invoice was settled. When this invoice was settled.
Measured in seconds since the unix epoch.
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
int64 settle_date = 8; int64 settle_date = 8;
@ -3385,7 +3719,7 @@ message Invoice {
*/ */
bytes description_hash = 10; bytes description_hash = 10;
// Payment request expiry time in seconds. Default is 3600 (1 hour). // Payment request expiry time in seconds. Default is 86400 (24 hours).
int64 expiry = 11; int64 expiry = 11;
// Fallback on-chain address. // Fallback on-chain address.
@ -3401,6 +3735,8 @@ message Invoice {
repeated RouteHint route_hints = 14; repeated RouteHint route_hints = 14;
// Whether this invoice should include routing hints for private channels. // Whether this invoice should include routing hints for private channels.
// Note: When enabled, if value and value_msat are zero, a large number of
// hints with these channels can be included, which might not be desirable.
bool private = 15; bool private = 15;
/* /*
@ -3426,22 +3762,22 @@ message Invoice {
/* /*
The amount that was accepted for this invoice, in satoshis. This will ONLY The amount that was accepted for this invoice, in satoshis. This will ONLY
be set if this invoice has been settled. We provide this field as if the be set if this invoice has been settled or accepted. We provide this field
invoice was created with a zero value, then we need to record what amount as if the invoice was created with a zero value, then we need to record what
was ultimately accepted. Additionally, it's possible that the sender paid amount was ultimately accepted. Additionally, it's possible that the sender
MORE that was specified in the original invoice. So we'll record that here paid MORE that was specified in the original invoice. So we'll record that
as well. here as well.
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
int64 amt_paid_sat = 19; int64 amt_paid_sat = 19;
/* /*
The amount that was accepted for this invoice, in millisatoshis. This will The amount that was accepted for this invoice, in millisatoshis. This will
ONLY be set if this invoice has been settled. We provide this field as if ONLY be set if this invoice has been settled or accepted. We provide this
the invoice was created with a zero value, then we need to record what field as if the invoice was created with a zero value, then we need to
amount was ultimately accepted. Additionally, it's possible that the sender record what amount was ultimately accepted. Additionally, it's possible that
paid MORE that was specified in the original invoice. So we'll record that the sender paid MORE that was specified in the original invoice. So we'll
here as well. record that here as well.
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
int64 amt_paid_msat = 20; int64 amt_paid_msat = 20;
@ -3479,9 +3815,10 @@ message Invoice {
bool is_keysend = 25; bool is_keysend = 25;
/* /*
The payment address of this invoice. This value will be used in MPP The payment address of this invoice. This is also called payment secret in
payments, and also for newer invoices that always require the MPP payload specifications (e.g. BOLT 11). This value will be used in MPP payments, and
for added end-to-end security. also for newer invoices that always require the MPP payload for added
end-to-end security.
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
bytes payment_addr = 26; bytes payment_addr = 26;
@ -3501,6 +3838,48 @@ message Invoice {
Note: Output only, don't specify for creating an invoice. Note: Output only, don't specify for creating an invoice.
*/ */
map<string, AMPInvoiceState> amp_invoice_state = 28; map<string, AMPInvoiceState> amp_invoice_state = 28;
/*
Signals that the invoice should include blinded paths to hide the true
identity of the recipient.
*/
bool is_blinded = 29;
/*
Config values to use when creating blinded paths for this invoice. These
can be used to override the defaults config values provided in by the
global config. This field is only used if is_blinded is true.
*/
BlindedPathConfig blinded_path_config = 30;
}
message BlindedPathConfig {
/*
The minimum number of real hops to include in a blinded path. This doesn't
include our node, so if the minimum is 1, then the path will contain at
minimum our node along with an introduction node hop. If it is zero then
the shortest path will use our node as an introduction node.
*/
optional uint32 min_num_real_hops = 1;
/*
The number of hops to include in a blinded path. This doesn't include our
node, so if it is 1, then the path will contain our node along with an
introduction node or dummy node hop. If paths shorter than NumHops is
found, then they will be padded using dummy hops.
*/
optional uint32 num_hops = 2;
/*
The maximum number of blinded paths to select and add to an invoice.
*/
optional uint32 max_num_paths = 3;
/*
A list of node IDs of nodes that should not be used in any of our generated
blinded paths.
*/
repeated bytes node_omission_list = 4;
} }
enum InvoiceHTLCState { enum InvoiceHTLCState {
@ -3586,9 +3965,9 @@ message AddInvoiceResponse {
uint64 add_index = 16; uint64 add_index = 16;
/* /*
The payment address of the generated invoice. This value should be used The payment address of the generated invoice. This is also called
in all payments for this invoice as we require it for end to end payment secret in specifications (e.g. BOLT 11). This value should be used
security. in all payments for this invoice as we require it for end to end security.
*/ */
bytes payment_addr = 17; bytes payment_addr = 17;
} }
@ -3629,7 +4008,16 @@ message ListInvoiceRequest {
specified index offset. This can be used to paginate backwards. specified index offset. This can be used to paginate backwards.
*/ */
bool reversed = 6; bool reversed = 6;
// If set, returns all invoices with a creation date greater than or equal
// to it. Measured in seconds since the unix epoch.
uint64 creation_date_start = 7;
// If set, returns all invoices with a creation date less than or equal to
// it. Measured in seconds since the unix epoch.
uint64 creation_date_end = 8;
} }
message ListInvoiceResponse { message ListInvoiceResponse {
/* /*
A list of invoices from the time slice of the time series specified in the A list of invoices from the time slice of the time series specified in the
@ -3700,6 +4088,11 @@ enum PaymentFailureReason {
Insufficient local balance. Insufficient local balance.
*/ */
FAILURE_REASON_INSUFFICIENT_BALANCE = 5; FAILURE_REASON_INSUFFICIENT_BALANCE = 5;
/*
The payment was canceled.
*/
FAILURE_REASON_CANCELED = 6;
} }
message Payment { message Payment {
@ -3730,10 +4123,20 @@ message Payment {
string payment_request = 9; string payment_request = 9;
enum PaymentStatus { enum PaymentStatus {
UNKNOWN = 0; // Deprecated. This status will never be returned.
UNKNOWN = 0 [deprecated = true];
// Payment has inflight HTLCs.
IN_FLIGHT = 1; IN_FLIGHT = 1;
// Payment is settled.
SUCCEEDED = 2; SUCCEEDED = 2;
// Payment is failed.
FAILED = 3; FAILED = 3;
// Payment is created and has not attempted any HTLCs.
INITIATED = 4;
} }
// The status of the payment. // The status of the payment.
@ -3828,6 +4231,14 @@ message ListPaymentsRequest {
of payments, as all of them have to be iterated through to be counted. of payments, as all of them have to be iterated through to be counted.
*/ */
bool count_total_payments = 5; bool count_total_payments = 5;
// If set, returns all payments with a creation date greater than or equal
// to it. Measured in seconds since the unix epoch.
uint64 creation_date_start = 6;
// If set, returns all payments with a creation date less than or equal to
// it. Measured in seconds since the unix epoch.
uint64 creation_date_end = 7;
} }
message ListPaymentsResponse { message ListPaymentsResponse {
@ -3873,6 +4284,10 @@ message DeleteAllPaymentsRequest {
Only delete failed HTLCs from payments, not the payment itself. Only delete failed HTLCs from payments, not the payment itself.
*/ */
bool failed_htlcs_only = 2; bool failed_htlcs_only = 2;
// Delete all payments. NOTE: Using this option requires careful
// consideration as it is a destructive operation.
bool all_payments = 3;
} }
message DeletePaymentResponse { message DeletePaymentResponse {
@ -3923,6 +4338,7 @@ message PayReq {
bytes payment_addr = 11; bytes payment_addr = 11;
int64 num_msat = 12; int64 num_msat = 12;
map<uint32, Feature> features = 13; map<uint32, Feature> features = 13;
repeated BlindedPaymentPath blinded_paths = 14;
} }
enum FeatureBit { enum FeatureBit {
@ -3949,6 +4365,8 @@ enum FeatureBit {
ANCHORS_OPT = 21; ANCHORS_OPT = 21;
ANCHORS_ZERO_FEE_HTLC_REQ = 22; ANCHORS_ZERO_FEE_HTLC_REQ = 22;
ANCHORS_ZERO_FEE_HTLC_OPT = 23; ANCHORS_ZERO_FEE_HTLC_OPT = 23;
ROUTE_BLINDING_REQUIRED = 24;
ROUTE_BLINDING_OPTIONAL = 25;
AMP_REQ = 30; AMP_REQ = 30;
AMP_OPT = 31; AMP_OPT = 31;
} }
@ -3978,7 +4396,15 @@ message ChannelFeeReport {
// The effective fee rate in milli-satoshis. Computed by dividing the // The effective fee rate in milli-satoshis. Computed by dividing the
// fee_per_mil value by 1 million. // fee_per_mil value by 1 million.
double fee_rate = 4; double fee_rate = 4;
// The base fee charged regardless of the number of milli-satoshis sent.
int32 inbound_base_fee_msat = 6;
// The amount charged per milli-satoshis transferred expressed in
// millionths of a satoshi.
int32 inbound_fee_per_mil = 7;
} }
message FeeReportResponse { message FeeReportResponse {
// An array of channel fee reports which describes the current fee schedule // An array of channel fee reports which describes the current fee schedule
// for each channel. // for each channel.
@ -3997,6 +4423,16 @@ message FeeReportResponse {
uint64 month_fee_sum = 4; uint64 month_fee_sum = 4;
} }
message InboundFee {
// The inbound base fee charged regardless of the number of milli-satoshis
// received in the channel. By default, only negative values are accepted.
int32 base_fee_msat = 1;
// The effective inbound fee rate in micro-satoshis (parts per million).
// By default, only negative values are accepted.
int32 fee_rate_ppm = 2;
}
message PolicyUpdateRequest { message PolicyUpdateRequest {
oneof scope { oneof scope {
// If set, then this update applies to all currently active channels. // If set, then this update applies to all currently active channels.
@ -4029,7 +4465,12 @@ message PolicyUpdateRequest {
// If true, min_htlc_msat is applied. // If true, min_htlc_msat is applied.
bool min_htlc_msat_specified = 8; bool min_htlc_msat_specified = 8;
// Optional inbound fee. If unset, the previously set value will be
// retained [EXPERIMENTAL].
InboundFee inbound_fee = 10;
} }
enum UpdateFailure { enum UpdateFailure {
UPDATE_FAILURE_UNKNOWN = 0; UPDATE_FAILURE_UNKNOWN = 0;
UPDATE_FAILURE_PENDING = 1; UPDATE_FAILURE_PENDING = 1;
@ -4305,6 +4746,7 @@ message Failure {
EXPIRY_TOO_FAR = 22; EXPIRY_TOO_FAR = 22;
MPP_TIMEOUT = 23; MPP_TIMEOUT = 23;
INVALID_ONION_PAYLOAD = 24; INVALID_ONION_PAYLOAD = 24;
INVALID_ONION_BLINDING = 25;
/* /*
An internal error occurred. An internal error occurred.

View file

@ -137,6 +137,13 @@ service LightningPub {
option (nostr) = true; option (nostr) = true;
} }
rpc ListChannels(structs.Empty) returns (structs.LndChannels) {
option (auth_type) = "Admin";
option (http_method) = "get";
option (http_route) = "/api/admin/channels";
option (nostr) = true;
}
rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) { rpc GetUsageMetrics(structs.Empty) returns (structs.UsageMetrics) {
option (auth_type) = "Metrics"; option (auth_type) = "Metrics";
option (http_method) = "post"; option (http_method) = "post";

View file

@ -108,6 +108,7 @@ message OpenChannel {
int64 lifetime =4 ; int64 lifetime =4 ;
int64 local_balance=5; int64 local_balance=5;
int64 remote_balance = 6; int64 remote_balance = 6;
string label = 7;
} }
message ClosedChannel { message ClosedChannel {
string channel_id = 1; string channel_id = 1;
@ -145,6 +146,10 @@ message LndMetrics {
} }
message LndChannels {
repeated OpenChannel open_channels = 1;
}
message LndGetInfoRequest { message LndGetInfoRequest {
int64 nodeId = 1; int64 nodeId = 1;
} }

View file

@ -8,7 +8,7 @@ import { LightningClient } from '../../../proto/lnd/lightning.client.js'
import { InvoicesClient } from '../../../proto/lnd/invoices.client.js' import { InvoicesClient } from '../../../proto/lnd/invoices.client.js'
import { RouterClient } from '../../../proto/lnd/router.client.js' import { RouterClient } from '../../../proto/lnd/router.client.js'
import { ChainNotifierClient } from '../../../proto/lnd/chainnotifier.client.js' import { ChainNotifierClient } from '../../../proto/lnd/chainnotifier.client.js'
import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse } from '../../../proto/lnd/lightning.js' import { GetInfoResponse, AddressType, NewAddressResponse, AddInvoiceResponse, Invoice_InvoiceState, PayReq, Payment_PaymentStatus, Payment, PaymentFailureReason, SendCoinsResponse, EstimateFeeResponse, ChannelBalanceResponse, TransactionDetails, ListChannelsResponse, ClosedChannelsResponse, PendingChannelsResponse, ForwardingHistoryResponse, CoinSelectionStrategy } from '../../../proto/lnd/lightning.js'
import { OpenChannelReq } from './openChannelReq.js'; import { OpenChannelReq } from './openChannelReq.js';
import { AddInvoiceReq } from './addInvoiceReq.js'; import { AddInvoiceReq } from './addInvoiceReq.js';
import { PayInvoiceReq } from './payInvoiceReq.js'; import { PayInvoiceReq } from './payInvoiceReq.js';
@ -113,12 +113,12 @@ export default class {
return res.response return res.response
} }
async ListPendingChannels(): Promise<PendingChannelsResponse> { async ListPendingChannels(): Promise<PendingChannelsResponse> {
const res = await this.lightning.pendingChannels({}, DeadLineMetadata()) const res = await this.lightning.pendingChannels({ includeRawTx: false }, DeadLineMetadata())
return res.response return res.response
} }
async ListChannels(): Promise<ListChannelsResponse> { async ListChannels(peerLookup = false): Promise<ListChannelsResponse> {
const res = await this.lightning.listChannels({ const res = await this.lightning.listChannels({
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0), peerAliasLookup: peerLookup
}, DeadLineMetadata()) }, DeadLineMetadata())
return res.response return res.response
} }
@ -350,7 +350,8 @@ export default class {
addrToAmount: { [address]: BigInt(amount) }, addrToAmount: { [address]: BigInt(amount) },
minConfs: 1, minConfs: 1,
spendUnconfirmed: false, spendUnconfirmed: false,
targetConf: targetConf targetConf: targetConf,
coinSelectionStrategy: CoinSelectionStrategy.STRATEGY_LARGEST
}) })
return res.response return res.response
} }
@ -385,7 +386,7 @@ export default class {
} }
async GetWalletBalance() { async GetWalletBalance() {
const res = await this.lightning.walletBalance({}, DeadLineMetadata()) const res = await this.lightning.walletBalance({ account: "", minConfs: 1 }, DeadLineMetadata())
return res.response return res.response
} }
@ -404,10 +405,10 @@ export default class {
} }
async GetBalance(): Promise<BalanceInfo> { // TODO: remove this async GetBalance(): Promise<BalanceInfo> { // TODO: remove this
const wRes = await this.lightning.walletBalance({}, DeadLineMetadata()) const wRes = await this.lightning.walletBalance({ account: "", minConfs: 1 }, DeadLineMetadata())
const { confirmedBalance, unconfirmedBalance, totalBalance } = wRes.response const { confirmedBalance, unconfirmedBalance, totalBalance } = wRes.response
const { response } = await this.lightning.listChannels({ const { response } = await this.lightning.listChannels({
activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0) activeOnly: false, inactiveOnly: false, privateOnly: false, publicOnly: false, peer: Buffer.alloc(0), peerAliasLookup: false
}, DeadLineMetadata()) }, DeadLineMetadata())
const channelsBalance = response.channels.map(c => ({ const channelsBalance = response.channels.map(c => ({
channelId: c.chanId, channelId: c.chanId,
@ -424,11 +425,11 @@ export default class {
} }
async GetAllPaidInvoices(max: number) { async GetAllPaidInvoices(max: number) {
const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true }, DeadLineMetadata()) const res = await this.lightning.listInvoices({ indexOffset: 0n, numMaxInvoices: BigInt(max), pendingOnly: false, reversed: true, creationDateEnd: 0n, creationDateStart: 0n }, DeadLineMetadata())
return res.response return res.response
} }
async GetAllPayments(max: number) { async GetAllPayments(max: number) {
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true }) const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset: 0n, maxPayments: BigInt(max), reversed: true, creationDateEnd: 0n, creationDateStart: 0n })
return res.response return res.response
} }
@ -438,7 +439,7 @@ export default class {
} }
const indexOffset = BigInt(paymentIndex - 1) const indexOffset = BigInt(paymentIndex - 1)
const res = await this.lightning.listPayments({ const res = await this.lightning.listPayments({
countTotalPayments: false, includeIncomplete: true, indexOffset, maxPayments: 1n, reversed: false countTotalPayments: false, includeIncomplete: true, indexOffset, maxPayments: 1n, reversed: false, creationDateEnd: 0n, creationDateStart: 0n
}, DeadLineMetadata()) }, DeadLineMetadata())
return res.response return res.response
} }
@ -446,7 +447,7 @@ export default class {
async GetLatestPaymentIndex(from = 0) { async GetLatestPaymentIndex(from = 0) {
let indexOffset = BigInt(from) let indexOffset = BigInt(from)
while (true) { while (true) {
const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset, maxPayments: 0n, reversed: false }, DeadLineMetadata()) const res = await this.lightning.listPayments({ countTotalPayments: false, includeIncomplete: false, indexOffset, maxPayments: 0n, reversed: false, creationDateEnd: 0n, creationDateStart: 0n }, DeadLineMetadata())
if (res.response.payments.length === 0) { if (res.response.payments.length === 0) {
return Number(indexOffset) return Number(indexOffset)
} }

View file

@ -4,6 +4,7 @@ import { getLogger } from "../helpers/logger.js";
import { MainSettings, getDataPath } from "./settings.js"; import { MainSettings, getDataPath } from "./settings.js";
import Storage from "../storage/index.js"; import Storage from "../storage/index.js";
import * as Types from '../../../proto/autogenerated/ts/types.js' import * as Types from '../../../proto/autogenerated/ts/types.js'
import LND from "../lnd/lnd.js";
export class AdminManager { export class AdminManager {
storage: Storage storage: Storage
@ -16,6 +17,7 @@ export class AdminManager {
appNprofilePath: string appNprofilePath: string
interval: NodeJS.Timer interval: NodeJS.Timer
appNprofile: string appNprofile: string
lnd: LND
constructor(mainSettings: MainSettings, storage: Storage) { constructor(mainSettings: MainSettings, storage: Storage) {
this.storage = storage this.storage = storage
this.dataDir = mainSettings.storageSettings.dataDir this.dataDir = mainSettings.storageSettings.dataDir
@ -26,6 +28,10 @@ export class AdminManager {
this.start() this.start()
} }
setLND = (lnd: LND) => {
this.lnd = lnd
}
setAppNprofile = (nprofile: string) => { setAppNprofile = (nprofile: string) => {
this.appNprofile = nprofile this.appNprofile = nprofile
const enrollToken = this.ReadAdminEnrollToken() const enrollToken = this.ReadAdminEnrollToken()
@ -135,4 +141,19 @@ export class AdminManager {
used: inviteToken.used used: inviteToken.used
} }
} }
ListChannels = async (): Promise<Types.LndChannels> => {
const channels = await this.lnd.ListChannels()
return {
open_channels: channels.channels.map(c => ({
active: c.active,
capacity: Number(c.capacity),
local_balance: Number(c.localBalance),
remote_balance: Number(c.remoteBalance),
channel_id: c.chanId,
label: c.peerAlias || c.remotePubkey,
lifetime: Number(c.lifetime)
}))
}
}
} }

View file

@ -36,7 +36,8 @@ export const initMainHandler = async (log: PubLogger, mainSettings: MainSettings
} }
} }
const mainHandler = new Main(reloadedSettings, storageManager, adminManager, utils,unlocker) const mainHandler = new Main(reloadedSettings, storageManager, adminManager, utils, unlocker)
adminManager.setLND(mainHandler.lnd)
await mainHandler.lnd.Warmup() await mainHandler.lnd.Warmup()
if (!reloadedSettings.skipSanityCheck) { if (!reloadedSettings.skipSanityCheck) {
const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd) const sanityChecker = new SanityChecker(storageManager, mainHandler.lnd)

View file

@ -13,6 +13,9 @@ export default (mainHandler: Main): Types.ServerMethods => {
GetLndMetrics: async ({ ctx, req }) => { GetLndMetrics: async ({ ctx, req }) => {
return mainHandler.metricsManager.GetLndMetrics(req) return mainHandler.metricsManager.GetLndMetrics(req)
}, },
ListChannels: async ({ ctx }) => {
return mainHandler.adminManager.ListChannels()
},
EncryptionExchange: async () => { }, EncryptionExchange: async () => { },
Health: async () => { await mainHandler.lnd.Health() }, Health: async () => { await mainHandler.lnd.Health() },
LndGetInfo: async ({ ctx }) => { LndGetInfo: async ({ ctx }) => {