fix metrics page

This commit is contained in:
boufni95 2024-11-25 20:17:50 +00:00
parent d376623276
commit bd433c1259
23 changed files with 12151 additions and 239 deletions

View file

@ -854,6 +854,7 @@ The nostr server will send back a message response, and inside the body there wi
### ClosedChannel ### ClosedChannel
- __capacity__: _number_ - __capacity__: _number_
- __channel_id__: _string_ - __channel_id__: _string_
- __close_tx_timestamp__: _number_
- __closed_height__: _number_ - __closed_height__: _number_
### ClosureMigration ### ClosureMigration
@ -1006,6 +1007,7 @@ The nostr server will send back a message response, and inside the body there wi
- __online_channels__: _number_ - __online_channels__: _number_
- __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_ - __open_channels__: ARRAY of: _[OpenChannel](#OpenChannel)_
- __pending_channels__: _number_ - __pending_channels__: _number_
- __root_ops__: ARRAY of: _[RootOperation](#RootOperation)_
### LndSeed ### LndSeed
- __seed__: ARRAY of: _string_ - __seed__: ARRAY of: _string_
@ -1125,6 +1127,12 @@ The nostr server will send back a message response, and inside the body there wi
### RequestNPubLinkingTokenResponse ### RequestNPubLinkingTokenResponse
- __token__: _string_ - __token__: _string_
### RootOperation
- __amount__: _number_
- __created_at_unix__: _number_
- __op_id__: _string_
- __op_type__: _[OperationType](#OperationType)_
### RoutingEvent ### RoutingEvent
- __event_type__: _string_ - __event_type__: _string_
- __failure_string__: _string_ - __failure_string__: _string_
@ -1231,6 +1239,10 @@ The nostr server will send back a message response, and inside the body there wi
- __MONTH__ - __MONTH__
- __WEEK__ - __WEEK__
### OperationType
- __CHAIN_OP__
- __INVOICE_OP__
### UserOperationType ### UserOperationType
- __INCOMING_INVOICE__ - __INCOMING_INVOICE__
- __INCOMING_TX__ - __INCOMING_TX__

View file

@ -64,6 +64,13 @@ const (
WEEK IntervalType = "WEEK" WEEK IntervalType = "WEEK"
) )
type OperationType string
const (
CHAIN_OP OperationType = "CHAIN_OP"
INVOICE_OP OperationType = "INVOICE_OP"
)
type UserOperationType string type UserOperationType string
const ( const (
@ -177,6 +184,7 @@ type CloseChannelResponse struct {
type ClosedChannel struct { type ClosedChannel struct {
Capacity int64 `json:"capacity"` Capacity int64 `json:"capacity"`
Channel_id string `json:"channel_id"` Channel_id string `json:"channel_id"`
Close_tx_timestamp int64 `json:"close_tx_timestamp"`
Closed_height int64 `json:"closed_height"` Closed_height int64 `json:"closed_height"`
} }
type ClosureMigration struct { type ClosureMigration struct {
@ -329,6 +337,7 @@ type LndNodeMetrics struct {
Online_channels int64 `json:"online_channels"` Online_channels int64 `json:"online_channels"`
Open_channels []OpenChannel `json:"open_channels"` Open_channels []OpenChannel `json:"open_channels"`
Pending_channels int64 `json:"pending_channels"` Pending_channels int64 `json:"pending_channels"`
Root_ops []RootOperation `json:"root_ops"`
} }
type LndSeed struct { type LndSeed struct {
Seed []string `json:"seed"` Seed []string `json:"seed"`
@ -448,6 +457,12 @@ type RequestNPubLinkingTokenRequest struct {
type RequestNPubLinkingTokenResponse struct { type RequestNPubLinkingTokenResponse struct {
Token string `json:"token"` Token string `json:"token"`
} }
type RootOperation struct {
Amount int64 `json:"amount"`
Created_at_unix int64 `json:"created_at_unix"`
Op_id string `json:"op_id"`
Op_type OperationType `json:"op_type"`
}
type RoutingEvent struct { type RoutingEvent struct {
Event_type string `json:"event_type"` Event_type string `json:"event_type"`
Failure_string string `json:"failure_string"` Failure_string string `json:"failure_string"`

View file

@ -344,6 +344,14 @@ export const enumCheckIntervalType = (e?: IntervalType): boolean => {
for (const v in IntervalType) if (e === v) return true for (const v in IntervalType) if (e === v) return true
return false return false
} }
export enum OperationType {
CHAIN_OP = 'CHAIN_OP',
INVOICE_OP = 'INVOICE_OP',
}
export const enumCheckOperationType = (e?: OperationType): boolean => {
for (const v in OperationType) if (e === v) return true
return false
}
export enum UserOperationType { export enum UserOperationType {
INCOMING_INVOICE = 'INCOMING_INVOICE', INCOMING_INVOICE = 'INCOMING_INVOICE',
INCOMING_TX = 'INCOMING_TX', INCOMING_TX = 'INCOMING_TX',
@ -942,6 +950,7 @@ export const CloseChannelResponseValidate = (o?: CloseChannelResponse, opts: Clo
export type ClosedChannel = { export type ClosedChannel = {
capacity: number capacity: number
channel_id: string channel_id: string
close_tx_timestamp: number
closed_height: number closed_height: number
} }
export const ClosedChannelOptionalFields: [] = [] export const ClosedChannelOptionalFields: [] = []
@ -949,6 +958,7 @@ export type ClosedChannelOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: [] checkOptionalsAreSet?: []
capacity_CustomCheck?: (v: number) => boolean capacity_CustomCheck?: (v: number) => boolean
channel_id_CustomCheck?: (v: string) => boolean channel_id_CustomCheck?: (v: string) => boolean
close_tx_timestamp_CustomCheck?: (v: number) => boolean
closed_height_CustomCheck?: (v: number) => boolean closed_height_CustomCheck?: (v: number) => boolean
} }
export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => { export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOptions = {}, path: string = 'ClosedChannel::root.'): Error | null => {
@ -961,6 +971,9 @@ export const ClosedChannelValidate = (o?: ClosedChannel, opts: ClosedChannelOpti
if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`) if (typeof o.channel_id !== 'string') return new Error(`${path}.channel_id: is not a string`)
if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`) if (opts.channel_id_CustomCheck && !opts.channel_id_CustomCheck(o.channel_id)) return new Error(`${path}.channel_id: custom check failed`)
if (typeof o.close_tx_timestamp !== 'number') return new Error(`${path}.close_tx_timestamp: is not a number`)
if (opts.close_tx_timestamp_CustomCheck && !opts.close_tx_timestamp_CustomCheck(o.close_tx_timestamp)) return new Error(`${path}.close_tx_timestamp: custom check failed`)
if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`) if (typeof o.closed_height !== 'number') return new Error(`${path}.closed_height: is not a number`)
if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`) if (opts.closed_height_CustomCheck && !opts.closed_height_CustomCheck(o.closed_height)) return new Error(`${path}.closed_height: custom check failed`)
@ -1820,6 +1833,7 @@ export type LndNodeMetrics = {
online_channels: number online_channels: number
open_channels: OpenChannel[] open_channels: OpenChannel[]
pending_channels: number pending_channels: number
root_ops: RootOperation[]
} }
export const LndNodeMetricsOptionalFields: [] = [] export const LndNodeMetricsOptionalFields: [] = []
export type LndNodeMetricsOptions = OptionsBaseMessage & { export type LndNodeMetricsOptions = OptionsBaseMessage & {
@ -1840,6 +1854,8 @@ export type LndNodeMetricsOptions = OptionsBaseMessage & {
open_channels_ItemOptions?: OpenChannelOptions open_channels_ItemOptions?: OpenChannelOptions
open_channels_CustomCheck?: (v: OpenChannel[]) => boolean open_channels_CustomCheck?: (v: OpenChannel[]) => boolean
pending_channels_CustomCheck?: (v: number) => boolean pending_channels_CustomCheck?: (v: number) => boolean
root_ops_ItemOptions?: RootOperationOptions
root_ops_CustomCheck?: (v: RootOperation[]) => boolean
} }
export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::root.'): Error | null => { export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsOptions = {}, path: string = 'LndNodeMetrics::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message') if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
@ -1898,6 +1914,13 @@ export const LndNodeMetricsValidate = (o?: LndNodeMetrics, opts: LndNodeMetricsO
if (typeof o.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`) if (typeof o.pending_channels !== 'number') return new Error(`${path}.pending_channels: is not a number`)
if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`) if (opts.pending_channels_CustomCheck && !opts.pending_channels_CustomCheck(o.pending_channels)) return new Error(`${path}.pending_channels: custom check failed`)
if (!Array.isArray(o.root_ops)) return new Error(`${path}.root_ops: is not an array`)
for (let index = 0; index < o.root_ops.length; index++) {
const root_opsErr = RootOperationValidate(o.root_ops[index], opts.root_ops_ItemOptions, `${path}.root_ops[${index}]`)
if (root_opsErr !== null) return root_opsErr
}
if (opts.root_ops_CustomCheck && !opts.root_ops_CustomCheck(o.root_ops)) return new Error(`${path}.root_ops: custom check failed`)
return null return null
} }
@ -2582,6 +2605,39 @@ export const RequestNPubLinkingTokenResponseValidate = (o?: RequestNPubLinkingTo
return null return null
} }
export type RootOperation = {
amount: number
created_at_unix: number
op_id: string
op_type: OperationType
}
export const RootOperationOptionalFields: [] = []
export type RootOperationOptions = OptionsBaseMessage & {
checkOptionalsAreSet?: []
amount_CustomCheck?: (v: number) => boolean
created_at_unix_CustomCheck?: (v: number) => boolean
op_id_CustomCheck?: (v: string) => boolean
op_type_CustomCheck?: (v: OperationType) => boolean
}
export const RootOperationValidate = (o?: RootOperation, opts: RootOperationOptions = {}, path: string = 'RootOperation::root.'): Error | null => {
if (opts.checkOptionalsAreSet && opts.allOptionalsAreSet) return new Error(path + ': only one of checkOptionalsAreSet or allOptionalNonDefault can be set for each message')
if (typeof o !== 'object' || o === null) return new Error(path + ': object is not an instance of an object or is null')
if (typeof o.amount !== 'number') return new Error(`${path}.amount: is not a number`)
if (opts.amount_CustomCheck && !opts.amount_CustomCheck(o.amount)) return new Error(`${path}.amount: custom check failed`)
if (typeof o.created_at_unix !== 'number') return new Error(`${path}.created_at_unix: is not a number`)
if (opts.created_at_unix_CustomCheck && !opts.created_at_unix_CustomCheck(o.created_at_unix)) return new Error(`${path}.created_at_unix: custom check failed`)
if (typeof o.op_id !== 'string') return new Error(`${path}.op_id: is not a string`)
if (opts.op_id_CustomCheck && !opts.op_id_CustomCheck(o.op_id)) return new Error(`${path}.op_id: custom check failed`)
if (!enumCheckOperationType(o.op_type)) return new Error(`${path}.op_type: is not a valid OperationType`)
if (opts.op_type_CustomCheck && !opts.op_type_CustomCheck(o.op_type)) return new Error(`${path}.op_type: custom check failed`)
return null
}
export type RoutingEvent = { export type RoutingEvent = {
event_type: string event_type: string
failure_string: string failure_string: string

View file

@ -3,10 +3,10 @@
// 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 { ChainNotifier } from "./chainnotifier.js"; import { ChainNotifier } from "./chainnotifier";
import type { BlockEpoch } from "./chainnotifier.js"; import type { BlockEpoch } from "./chainnotifier";
import type { SpendEvent } from "./chainnotifier.js"; import type { SpendEvent } from "./chainnotifier";
import type { SpendRequest } from "./chainnotifier.js"; import type { SpendRequest } from "./chainnotifier";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { ConfEvent } from "./chainnotifier"; import type { ConfEvent } from "./chainnotifier";
import type { ConfRequest } from "./chainnotifier"; import type { ConfRequest } from "./chainnotifier";

View file

@ -3,18 +3,18 @@
// 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 { Invoices } from "./invoices.js"; import { Invoices } from "./invoices";
import type { LookupInvoiceMsg } from "./invoices.js"; import type { LookupInvoiceMsg } from "./invoices";
import type { SettleInvoiceResp } from "./invoices.js"; import type { SettleInvoiceResp } from "./invoices";
import type { SettleInvoiceMsg } from "./invoices.js"; import type { SettleInvoiceMsg } from "./invoices";
import type { AddHoldInvoiceResp } from "./invoices.js"; import type { AddHoldInvoiceResp } from "./invoices";
import type { AddHoldInvoiceRequest } from "./invoices.js"; import type { AddHoldInvoiceRequest } from "./invoices";
import type { CancelInvoiceResp } from "./invoices.js"; import type { CancelInvoiceResp } from "./invoices";
import type { CancelInvoiceMsg } from "./invoices.js"; import type { CancelInvoiceMsg } from "./invoices";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { Invoice } from "./lightning.js"; import type { Invoice } from "./lightning";
import type { SubscribeSingleInvoiceRequest } from "./invoices.js"; import type { SubscribeSingleInvoiceRequest } from "./invoices";
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

@ -1,7 +1,7 @@
// @generated by protobuf-ts 2.8.1 // @generated by protobuf-ts 2.8.1
// @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3) // @generated from protobuf file "invoices.proto" (package "invoicesrpc", syntax proto3)
// tslint:disable // tslint:disable
import { Invoice } from "./lightning.js"; import { Invoice } from "./lightning";
import { ServiceType } from "@protobuf-ts/runtime-rpc"; import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime";
@ -13,7 +13,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 { RouteHint } from "./lightning.js"; import { RouteHint } from "./lightning";
/** /**
* @generated from protobuf message invoicesrpc.CancelInvoiceMsg * @generated from protobuf message invoicesrpc.CancelInvoiceMsg
*/ */

View file

@ -3,155 +3,138 @@
// 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 { Lightning } from "./lightning.js"; import { Lightning } from "./lightning";
import type { ListAliasesResponse } from "./lightning.js"; import type { LookupHtlcResolutionResponse } from "./lightning";
import type { ListAliasesRequest } from "./lightning.js"; import type { LookupHtlcResolutionRequest } from "./lightning";
import type { CustomMessage } from "./lightning.js"; import type { ListAliasesResponse } from "./lightning";
import type { SubscribeCustomMessagesRequest } from "./lightning.js"; import type { ListAliasesRequest } from "./lightning";
import type { SendCustomMessageResponse } from "./lightning.js"; import type { CustomMessage } from "./lightning";
import type { SendCustomMessageRequest } from "./lightning.js"; import type { SubscribeCustomMessagesRequest } from "./lightning";
import type { RPCMiddlewareRequest } from "./lightning.js"; import type { SendCustomMessageResponse } from "./lightning";
import type { RPCMiddlewareResponse } from "./lightning.js"; import type { SendCustomMessageRequest } from "./lightning";
import type { CheckMacPermResponse } from "./lightning.js"; import type { RPCMiddlewareRequest } from "./lightning";
import type { CheckMacPermRequest } from "./lightning.js"; import type { RPCMiddlewareResponse } from "./lightning";
import type { ListPermissionsResponse } from "./lightning.js"; import type { CheckMacPermResponse } from "./lightning";
import type { ListPermissionsRequest } from "./lightning.js"; import type { CheckMacPermRequest } from "./lightning";
import type { DeleteMacaroonIDResponse } from "./lightning.js"; import type { ListPermissionsResponse } from "./lightning";
import type { DeleteMacaroonIDRequest } from "./lightning.js"; import type { ListPermissionsRequest } from "./lightning";
import type { ListMacaroonIDsResponse } from "./lightning.js"; import type { DeleteMacaroonIDResponse } from "./lightning";
import type { ListMacaroonIDsRequest } from "./lightning.js"; import type { DeleteMacaroonIDRequest } from "./lightning";
import type { BakeMacaroonResponse } from "./lightning.js"; import type { ListMacaroonIDsResponse } from "./lightning";
import type { BakeMacaroonRequest } from "./lightning.js"; import type { ListMacaroonIDsRequest } from "./lightning";
import type { ChannelBackupSubscription } from "./lightning.js"; import type { BakeMacaroonResponse } from "./lightning";
import type { RestoreBackupResponse } from "./lightning.js"; import type { BakeMacaroonRequest } from "./lightning";
import type { RestoreChanBackupRequest } from "./lightning.js"; import type { ChannelBackupSubscription } from "./lightning";
import type { VerifyChanBackupResponse } from "./lightning.js"; import type { RestoreBackupResponse } from "./lightning";
import type { ChanBackupSnapshot } from "./lightning.js"; import type { RestoreChanBackupRequest } from "./lightning";
import type { ChanBackupExportRequest } from "./lightning.js"; import type { VerifyChanBackupResponse } from "./lightning";
import type { ChannelBackup } from "./lightning.js"; import type { ChanBackupSnapshot } from "./lightning";
import type { ExportChannelBackupRequest } from "./lightning.js"; import type { ChanBackupExportRequest } from "./lightning";
import type { ForwardingHistoryResponse } from "./lightning.js"; import type { ChannelBackup } from "./lightning";
import type { ForwardingHistoryRequest } from "./lightning.js"; import type { ExportChannelBackupRequest } from "./lightning";
import type { PolicyUpdateResponse } from "./lightning.js"; import type { ForwardingHistoryResponse } from "./lightning";
import type { PolicyUpdateRequest } from "./lightning.js"; import type { ForwardingHistoryRequest } from "./lightning";
import type { FeeReportResponse } from "./lightning.js"; import type { PolicyUpdateResponse } from "./lightning";
import type { FeeReportRequest } from "./lightning.js"; import type { PolicyUpdateRequest } from "./lightning";
import type { DebugLevelResponse } from "./lightning.js"; import type { FeeReportResponse } from "./lightning";
import type { DebugLevelRequest } from "./lightning.js"; import type { FeeReportRequest } from "./lightning";
import type { GraphTopologyUpdate } from "./lightning.js"; import type { DebugLevelResponse } from "./lightning";
import type { GraphTopologySubscription } from "./lightning.js"; import type { DebugLevelRequest } from "./lightning";
import type { StopResponse } from "./lightning.js"; import type { GraphTopologyUpdate } from "./lightning";
import type { StopRequest } from "./lightning.js"; import type { GraphTopologySubscription } from "./lightning";
import type { NetworkInfo } from "./lightning.js"; import type { StopResponse } from "./lightning";
import type { NetworkInfoRequest } from "./lightning.js"; import type { StopRequest } from "./lightning";
import type { QueryRoutesResponse } from "./lightning.js"; import type { NetworkInfo } from "./lightning";
import type { QueryRoutesRequest } from "./lightning.js"; import type { NetworkInfoRequest } from "./lightning";
import type { NodeInfo } from "./lightning.js"; import type { QueryRoutesResponse } from "./lightning";
import type { NodeInfoRequest } from "./lightning.js"; import type { QueryRoutesRequest } from "./lightning";
import type { ChannelEdge } from "./lightning.js"; import type { NodeInfo } from "./lightning";
import type { ChanInfoRequest } from "./lightning.js"; import type { NodeInfoRequest } from "./lightning";
import type { NodeMetricsResponse } from "./lightning.js"; import type { ChannelEdge } from "./lightning";
import type { NodeMetricsRequest } from "./lightning.js"; import type { ChanInfoRequest } from "./lightning";
import type { ChannelGraph } from "./lightning.js"; import type { NodeMetricsResponse } from "./lightning";
import type { ChannelGraphRequest } from "./lightning.js"; import type { NodeMetricsRequest } from "./lightning";
import type { DeleteAllPaymentsResponse } from "./lightning.js"; import type { ChannelGraph } from "./lightning";
import type { DeleteAllPaymentsRequest } from "./lightning.js"; import type { ChannelGraphRequest } from "./lightning";
import type { DeletePaymentResponse } from "./lightning.js"; import type { DeleteAllPaymentsResponse } from "./lightning";
import type { DeletePaymentRequest } from "./lightning.js"; import type { DeleteAllPaymentsRequest } from "./lightning";
import type { ListPaymentsResponse } from "./lightning.js"; import type { DeletePaymentResponse } from "./lightning";
import type { ListPaymentsRequest } from "./lightning.js"; import type { DeletePaymentRequest } from "./lightning";
import type { PayReq } from "./lightning.js"; import type { ListPaymentsResponse } from "./lightning";
import type { PayReqString } from "./lightning.js"; import type { ListPaymentsRequest } from "./lightning";
import type { InvoiceSubscription } from "./lightning.js"; import type { PayReq } from "./lightning";
import type { PaymentHash } from "./lightning.js"; import type { PayReqString } from "./lightning";
import type { ListInvoiceResponse } from "./lightning.js"; import type { InvoiceSubscription } from "./lightning";
import type { ListInvoiceRequest } from "./lightning.js"; import type { PaymentHash } from "./lightning";
import type { AddInvoiceResponse } from "./lightning.js"; import type { ListInvoiceResponse } from "./lightning";
import type { Invoice } from "./lightning.js"; import type { ListInvoiceRequest } from "./lightning";
import type { SendToRouteRequest } from "./lightning.js"; import type { AddInvoiceResponse } from "./lightning";
import type { SendResponse } from "./lightning.js"; import type { Invoice } from "./lightning";
import type { SendRequest } from "./lightning.js"; import type { SendToRouteRequest } from "./lightning";
import type { AbandonChannelResponse } from "./lightning.js"; import type { SendResponse } from "./lightning";
import type { AbandonChannelRequest } from "./lightning.js"; import type { SendRequest } from "./lightning";
import type { CloseStatusUpdate } from "./lightning.js"; import type { AbandonChannelResponse } from "./lightning";
import type { CloseChannelRequest } from "./lightning.js"; import type { AbandonChannelRequest } from "./lightning";
import type { ChannelAcceptRequest } from "./lightning.js"; import type { CloseStatusUpdate } from "./lightning";
import type { ChannelAcceptResponse } from "./lightning.js"; import type { CloseChannelRequest } from "./lightning";
import type { ChannelAcceptRequest } from "./lightning";
import type { ChannelAcceptResponse } from "./lightning";
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { FundingStateStepResp } from "./lightning.js"; import type { FundingStateStepResp } from "./lightning";
import type { FundingTransitionMsg } from "./lightning.js"; import type { FundingTransitionMsg } from "./lightning";
import type { BatchOpenChannelResponse } from "./lightning.js"; import type { BatchOpenChannelResponse } from "./lightning";
import type { BatchOpenChannelRequest } from "./lightning.js"; import type { BatchOpenChannelRequest } from "./lightning";
import type { OpenStatusUpdate } from "./lightning.js"; import type { OpenStatusUpdate } from "./lightning";
import type { ChannelPoint } from "./lightning.js"; import type { ChannelPoint } from "./lightning";
import type { OpenChannelRequest } from "./lightning.js"; import type { OpenChannelRequest } from "./lightning";
import type { ClosedChannelsResponse } from "./lightning.js"; import type { ClosedChannelsResponse } from "./lightning";
import type { ClosedChannelsRequest } from "./lightning.js"; import type { ClosedChannelsRequest } from "./lightning";
import type { ChannelEventUpdate } from "./lightning.js"; import type { ChannelEventUpdate } from "./lightning";
import type { ChannelEventSubscription } from "./lightning.js"; import type { ChannelEventSubscription } from "./lightning";
import type { ListChannelsResponse } from "./lightning.js"; import type { ListChannelsResponse } from "./lightning";
import type { ListChannelsRequest } from "./lightning.js"; import type { ListChannelsRequest } from "./lightning";
import type { PendingChannelsResponse } from "./lightning.js"; import type { PendingChannelsResponse } from "./lightning";
import type { PendingChannelsRequest } from "./lightning.js"; import type { PendingChannelsRequest } from "./lightning";
import type { GetRecoveryInfoResponse } from "./lightning.js"; import type { GetRecoveryInfoResponse } from "./lightning";
import type { GetRecoveryInfoRequest } from "./lightning.js"; import type { GetRecoveryInfoRequest } from "./lightning";
import type { GetInfoResponse } from "./lightning.js"; import type { GetDebugInfoResponse } from "./lightning";
import type { GetInfoRequest } from "./lightning.js"; import type { GetDebugInfoRequest } from "./lightning";
import type { PeerEvent } from "./lightning.js"; import type { GetInfoResponse } from "./lightning";
import type { PeerEventSubscription } from "./lightning.js"; import type { GetInfoRequest } from "./lightning";
import type { ListPeersResponse } from "./lightning.js"; import type { PeerEvent } from "./lightning";
import type { ListPeersRequest } from "./lightning.js"; import type { PeerEventSubscription } from "./lightning";
import type { DisconnectPeerResponse } from "./lightning.js"; import type { ListPeersResponse } from "./lightning";
import type { DisconnectPeerRequest } from "./lightning.js"; import type { ListPeersRequest } from "./lightning";
import type { ConnectPeerResponse } from "./lightning.js"; import type { DisconnectPeerResponse } from "./lightning";
import type { ConnectPeerRequest } from "./lightning.js"; import type { DisconnectPeerRequest } from "./lightning";
import type { VerifyMessageResponse } from "./lightning.js"; import type { ConnectPeerResponse } from "./lightning";
import type { VerifyMessageRequest } from "./lightning.js"; import type { ConnectPeerRequest } from "./lightning";
import type { SignMessageResponse } from "./lightning.js"; import type { VerifyMessageResponse } from "./lightning";
import type { SignMessageRequest } from "./lightning.js"; import type { VerifyMessageRequest } from "./lightning";
import type { NewAddressResponse } from "./lightning.js"; import type { SignMessageResponse } from "./lightning";
import type { NewAddressRequest } from "./lightning.js"; import type { SignMessageRequest } from "./lightning";
import type { SendManyResponse } from "./lightning.js"; import type { NewAddressResponse } from "./lightning";
import type { SendManyRequest } from "./lightning.js"; import type { NewAddressRequest } from "./lightning";
import type { Transaction } from "./lightning.js"; import type { SendManyResponse } from "./lightning";
import type { SendManyRequest } from "./lightning";
import type { Transaction } from "./lightning";
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { ListUnspentResponse } from "./lightning.js"; import type { ListUnspentResponse } from "./lightning";
import type { ListUnspentRequest } from "./lightning.js"; import type { ListUnspentRequest } from "./lightning";
import type { SendCoinsResponse } from "./lightning.js"; import type { SendCoinsResponse } from "./lightning";
import type { SendCoinsRequest } from "./lightning.js"; import type { SendCoinsRequest } from "./lightning";
import type { EstimateFeeResponse } from "./lightning.js"; import type { EstimateFeeResponse } from "./lightning";
import type { EstimateFeeRequest } from "./lightning.js"; import type { EstimateFeeRequest } from "./lightning";
import type { TransactionDetails } from "./lightning.js"; import type { TransactionDetails } from "./lightning";
import type { GetTransactionsRequest } from "./lightning.js"; import type { GetTransactionsRequest } from "./lightning";
import type { ChannelBalanceResponse } from "./lightning.js"; import type { ChannelBalanceResponse } from "./lightning";
import type { ChannelBalanceRequest } from "./lightning.js"; import type { ChannelBalanceRequest } from "./lightning";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { WalletBalanceResponse } from "./lightning.js"; import type { WalletBalanceResponse } from "./lightning";
import type { WalletBalanceRequest } from "./lightning.js"; import type { WalletBalanceRequest } from "./lightning";
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";
// // Comments in this file will be directly parsed into the API // Documentation as descriptions of the associated method, message, or field. // These descriptions should go right above the definition of the object, and // can be in either block or // comment format. // // An RPC method can be matched to an lncli command by placing a line in the // beginning of the description in exactly the following format: // lncli: `methodname` // // Failure to specify the exact name of the command will cause documentation // generation to fail. // // More information on how exactly the gRPC documentation is generated from // this proto file can be found here: // https://github.com/lightninglabs/lightning-api
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
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/** /**
* Lightning is the main RPC server of the daemon. * Lightning is the main RPC server of the daemon.
@ -847,22 +830,7 @@ export interface ILightningClient {
*/ */
lookupHtlcResolution(input: LookupHtlcResolutionRequest, options?: RpcOptions): UnaryCall<LookupHtlcResolutionRequest, LookupHtlcResolutionResponse>; lookupHtlcResolution(input: LookupHtlcResolutionRequest, options?: RpcOptions): UnaryCall<LookupHtlcResolutionRequest, LookupHtlcResolutionResponse>;
} }
// // // Comments in this file will be directly parsed into the API // Documentation as descriptions of the associated method, message, or field. // These descriptions should go right above the definition of the object, and // can be in either block or // comment format. // // An RPC method can be matched to an lncli command by placing a line in the // beginning of the description in exactly the following format: // lncli: `methodname` // // Failure to specify the exact name of the command will cause documentation // generation to fail. // // More information on how exactly the gRPC documentation is generated from // this proto file can be found here: // https://github.com/lightninglabs/lightning-api
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/** /**
* Lightning is the main RPC server of the daemon. * Lightning is the main RPC server of the daemon.

View file

@ -3,40 +3,40 @@
// 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 { Router } from "./router.js"; import { Router } from "./router";
import type { UpdateChanStatusResponse } from "./router.js"; import type { UpdateChanStatusResponse } from "./router";
import type { UpdateChanStatusRequest } from "./router.js"; import type { UpdateChanStatusRequest } from "./router";
import type { ForwardHtlcInterceptRequest } from "./router.js"; import type { ForwardHtlcInterceptRequest } from "./router";
import type { ForwardHtlcInterceptResponse } from "./router.js"; import type { ForwardHtlcInterceptResponse } from "./router";
import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc"; import type { DuplexStreamingCall } from "@protobuf-ts/runtime-rpc";
import type { PaymentStatus } from "./router.js"; import type { PaymentStatus } from "./router";
import type { HtlcEvent } from "./router.js"; import type { HtlcEvent } from "./router";
import type { SubscribeHtlcEventsRequest } from "./router.js"; import type { SubscribeHtlcEventsRequest } from "./router";
import type { BuildRouteResponse } from "./router.js"; import type { BuildRouteResponse } from "./router";
import type { BuildRouteRequest } from "./router.js"; import type { BuildRouteRequest } from "./router";
import type { QueryProbabilityResponse } from "./router.js"; import type { QueryProbabilityResponse } from "./router";
import type { QueryProbabilityRequest } from "./router.js"; import type { QueryProbabilityRequest } from "./router";
import type { SetMissionControlConfigResponse } from "./router.js"; import type { SetMissionControlConfigResponse } from "./router";
import type { SetMissionControlConfigRequest } from "./router.js"; import type { SetMissionControlConfigRequest } from "./router";
import type { GetMissionControlConfigResponse } from "./router.js"; import type { GetMissionControlConfigResponse } from "./router";
import type { GetMissionControlConfigRequest } from "./router.js"; import type { GetMissionControlConfigRequest } from "./router";
import type { XImportMissionControlResponse } from "./router.js"; import type { XImportMissionControlResponse } from "./router";
import type { XImportMissionControlRequest } from "./router.js"; import type { XImportMissionControlRequest } from "./router";
import type { QueryMissionControlResponse } from "./router.js"; import type { QueryMissionControlResponse } from "./router";
import type { QueryMissionControlRequest } from "./router.js"; import type { QueryMissionControlRequest } from "./router";
import type { ResetMissionControlResponse } from "./router.js"; import type { ResetMissionControlResponse } from "./router";
import type { ResetMissionControlRequest } from "./router.js"; import type { ResetMissionControlRequest } from "./router";
import type { HTLCAttempt } from "./lightning.js"; import type { HTLCAttempt } from "./lightning";
import type { SendToRouteResponse } from "./router.js"; import type { SendToRouteResponse } from "./router";
import type { SendToRouteRequest } from "./router.js"; import type { SendToRouteRequest } from "./router";
import type { RouteFeeResponse } from "./router.js"; import type { RouteFeeResponse } from "./router";
import type { RouteFeeRequest } from "./router.js"; import type { RouteFeeRequest } from "./router";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { TrackPaymentsRequest } from "./router.js"; import type { TrackPaymentsRequest } from "./router";
import type { TrackPaymentRequest } from "./router.js"; import type { TrackPaymentRequest } from "./router";
import { stackIntercept } from "@protobuf-ts/runtime-rpc"; import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { Payment } from "./lightning.js"; import type { Payment } from "./lightning";
import type { SendPaymentRequest } from "./router.js"; import type { SendPaymentRequest } from "./router";
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

@ -1,7 +1,7 @@
// @generated by protobuf-ts 2.8.1 // @generated by protobuf-ts 2.8.1
// @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3) // @generated from protobuf file "router.proto" (package "routerrpc", syntax proto3)
// tslint:disable // tslint:disable
import { Payment } from "./lightning.js"; import { Payment } from "./lightning";
import { ServiceType } from "@protobuf-ts/runtime-rpc"; import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime"; import type { IBinaryWriter } from "@protobuf-ts/runtime";
@ -13,13 +13,13 @@ 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 { ChannelPoint } from "./lightning.js"; import { ChannelPoint } from "./lightning";
import { HTLCAttempt } from "./lightning.js"; import { HTLCAttempt } from "./lightning";
import { Failure_FailureCode } from "./lightning.js"; import { Failure_FailureCode } from "./lightning";
import { Failure } from "./lightning.js"; import { Failure } from "./lightning";
import { Route } from "./lightning.js"; import { Route } from "./lightning";
import { FeatureBit } from "./lightning.js"; import { FeatureBit } from "./lightning";
import { RouteHint } from "./lightning.js"; import { RouteHint } from "./lightning";
/** /**
* @generated from protobuf message routerrpc.SendPaymentRequest * @generated from protobuf message routerrpc.SendPaymentRequest
*/ */

394
proto/lnd/signer.client.ts Normal file
View file

@ -0,0 +1,394 @@
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "signer.proto" (package "signrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { Signer } from "./signer";
import type { MuSig2CleanupResponse } from "./signer";
import type { MuSig2CleanupRequest } from "./signer";
import type { MuSig2CombineSigResponse } from "./signer";
import type { MuSig2CombineSigRequest } from "./signer";
import type { MuSig2SignResponse } from "./signer";
import type { MuSig2SignRequest } from "./signer";
import type { MuSig2RegisterNoncesResponse } from "./signer";
import type { MuSig2RegisterNoncesRequest } from "./signer";
import type { MuSig2SessionResponse } from "./signer";
import type { MuSig2SessionRequest } from "./signer";
import type { MuSig2CombineKeysResponse } from "./signer";
import type { MuSig2CombineKeysRequest } from "./signer";
import type { SharedKeyResponse } from "./signer";
import type { SharedKeyRequest } from "./signer";
import type { VerifyMessageResp } from "./signer";
import type { VerifyMessageReq } from "./signer";
import type { SignMessageResp } from "./signer";
import type { SignMessageReq } from "./signer";
import type { InputScriptResp } from "./signer";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { SignResp } from "./signer";
import type { SignReq } from "./signer";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
/**
* Signer is a service that gives access to the signing functionality of the
* daemon's wallet.
*
* @generated from protobuf service signrpc.Signer
*/
export interface ISignerClient {
/**
*
* SignOutputRaw is a method that can be used to generated a signature for a
* set of inputs/outputs to a transaction. Each request specifies details
* concerning how the outputs should be signed, which keys they should be
* signed with, and also any optional tweaks. The return value is a fixed
* 64-byte signature (the same format as we use on the wire in Lightning).
*
* If we are unable to sign using the specified keys, then an error will be
* returned.
*
* @generated from protobuf rpc: SignOutputRaw(signrpc.SignReq) returns (signrpc.SignResp);
*/
signOutputRaw(input: SignReq, options?: RpcOptions): UnaryCall<SignReq, SignResp>;
/**
*
* ComputeInputScript generates a complete InputIndex for the passed
* transaction with the signature as defined within the passed SignDescriptor.
* This method should be capable of generating the proper input script for both
* regular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh
* output.
*
* Note that when using this method to sign inputs belonging to the wallet,
* the only items of the SignDescriptor that need to be populated are pkScript
* in the TxOut field, the value in that same field, and finally the input
* index.
*
* @generated from protobuf rpc: ComputeInputScript(signrpc.SignReq) returns (signrpc.InputScriptResp);
*/
computeInputScript(input: SignReq, options?: RpcOptions): UnaryCall<SignReq, InputScriptResp>;
/**
*
* SignMessage signs a message with the key specified in the key locator. The
* returned signature is fixed-size LN wire format encoded.
*
* The main difference to SignMessage in the main RPC is that a specific key is
* used to sign the message instead of the node identity private key.
*
* @generated from protobuf rpc: SignMessage(signrpc.SignMessageReq) returns (signrpc.SignMessageResp);
*/
signMessage(input: SignMessageReq, options?: RpcOptions): UnaryCall<SignMessageReq, SignMessageResp>;
/**
*
* VerifyMessage verifies a signature over a message using the public key
* provided. The signature must be fixed-size LN wire format encoded.
*
* The main difference to VerifyMessage in the main RPC is that the public key
* used to sign the message does not have to be a node known to the network.
*
* @generated from protobuf rpc: VerifyMessage(signrpc.VerifyMessageReq) returns (signrpc.VerifyMessageResp);
*/
verifyMessage(input: VerifyMessageReq, options?: RpcOptions): UnaryCall<VerifyMessageReq, VerifyMessageResp>;
/**
*
* DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key
* derivation between the ephemeral public key in the request and the node's
* key specified in the key_desc parameter. Either a key locator or a raw
* public key is expected in the key_desc, if neither is supplied, defaults to
* the node's identity private key:
* P_shared = privKeyNode * ephemeralPubkey
* The resulting shared public key is serialized in the compressed format and
* hashed with sha256, resulting in the final key length of 256bit.
*
* @generated from protobuf rpc: DeriveSharedKey(signrpc.SharedKeyRequest) returns (signrpc.SharedKeyResponse);
*/
deriveSharedKey(input: SharedKeyRequest, options?: RpcOptions): UnaryCall<SharedKeyRequest, SharedKeyResponse>;
/**
*
* MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used
* to calculate the combined MuSig2 public key from a list of all participating
* signers' public keys. This RPC is completely stateless and deterministic and
* does not create any signing session. It can be used to determine the Taproot
* public key that should be put in an on-chain output once all public keys are
* known. A signing session is only needed later when that output should be
* _spent_ again.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CombineKeys(signrpc.MuSig2CombineKeysRequest) returns (signrpc.MuSig2CombineKeysResponse);
*/
muSig2CombineKeys(input: MuSig2CombineKeysRequest, options?: RpcOptions): UnaryCall<MuSig2CombineKeysRequest, MuSig2CombineKeysResponse>;
/**
*
* MuSig2CreateSession (experimental!) creates a new MuSig2 signing session
* using the local key identified by the key locator. The complete list of all
* public keys of all signing parties must be provided, including the public
* key of the local signing key. If nonces of other parties are already known,
* they can be submitted as well to reduce the number of RPC calls necessary
* later on.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CreateSession(signrpc.MuSig2SessionRequest) returns (signrpc.MuSig2SessionResponse);
*/
muSig2CreateSession(input: MuSig2SessionRequest, options?: RpcOptions): UnaryCall<MuSig2SessionRequest, MuSig2SessionResponse>;
/**
*
* MuSig2RegisterNonces (experimental!) registers one or more public nonces of
* other signing participants for a session identified by its ID. This RPC can
* be called multiple times until all nonces are registered.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2RegisterNonces(signrpc.MuSig2RegisterNoncesRequest) returns (signrpc.MuSig2RegisterNoncesResponse);
*/
muSig2RegisterNonces(input: MuSig2RegisterNoncesRequest, options?: RpcOptions): UnaryCall<MuSig2RegisterNoncesRequest, MuSig2RegisterNoncesResponse>;
/**
*
* MuSig2Sign (experimental!) creates a partial signature using the local
* signing key that was specified when the session was created. This can only
* be called when all public nonces of all participants are known and have been
* registered with the session. If this node isn't responsible for combining
* all the partial signatures, then the cleanup flag should be set, indicating
* that the session can be removed from memory once the signature was produced.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2Sign(signrpc.MuSig2SignRequest) returns (signrpc.MuSig2SignResponse);
*/
muSig2Sign(input: MuSig2SignRequest, options?: RpcOptions): UnaryCall<MuSig2SignRequest, MuSig2SignResponse>;
/**
*
* MuSig2CombineSig (experimental!) combines the given partial signature(s)
* with the local one, if it already exists. Once a partial signature of all
* participants is registered, the final signature will be combined and
* returned.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CombineSig(signrpc.MuSig2CombineSigRequest) returns (signrpc.MuSig2CombineSigResponse);
*/
muSig2CombineSig(input: MuSig2CombineSigRequest, options?: RpcOptions): UnaryCall<MuSig2CombineSigRequest, MuSig2CombineSigResponse>;
/**
*
* MuSig2Cleanup (experimental!) allows a caller to clean up a session early in
* cases where it's obvious that the signing session won't succeed and the
* resources can be released.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2Cleanup(signrpc.MuSig2CleanupRequest) returns (signrpc.MuSig2CleanupResponse);
*/
muSig2Cleanup(input: MuSig2CleanupRequest, options?: RpcOptions): UnaryCall<MuSig2CleanupRequest, MuSig2CleanupResponse>;
}
/**
* Signer is a service that gives access to the signing functionality of the
* daemon's wallet.
*
* @generated from protobuf service signrpc.Signer
*/
export class SignerClient implements ISignerClient, ServiceInfo {
typeName = Signer.typeName;
methods = Signer.methods;
options = Signer.options;
constructor(private readonly _transport: RpcTransport) {
}
/**
*
* SignOutputRaw is a method that can be used to generated a signature for a
* set of inputs/outputs to a transaction. Each request specifies details
* concerning how the outputs should be signed, which keys they should be
* signed with, and also any optional tweaks. The return value is a fixed
* 64-byte signature (the same format as we use on the wire in Lightning).
*
* If we are unable to sign using the specified keys, then an error will be
* returned.
*
* @generated from protobuf rpc: SignOutputRaw(signrpc.SignReq) returns (signrpc.SignResp);
*/
signOutputRaw(input: SignReq, options?: RpcOptions): UnaryCall<SignReq, SignResp> {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept<SignReq, SignResp>("unary", this._transport, method, opt, input);
}
/**
*
* ComputeInputScript generates a complete InputIndex for the passed
* transaction with the signature as defined within the passed SignDescriptor.
* This method should be capable of generating the proper input script for both
* regular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh
* output.
*
* Note that when using this method to sign inputs belonging to the wallet,
* the only items of the SignDescriptor that need to be populated are pkScript
* in the TxOut field, the value in that same field, and finally the input
* index.
*
* @generated from protobuf rpc: ComputeInputScript(signrpc.SignReq) returns (signrpc.InputScriptResp);
*/
computeInputScript(input: SignReq, options?: RpcOptions): UnaryCall<SignReq, InputScriptResp> {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
return stackIntercept<SignReq, InputScriptResp>("unary", this._transport, method, opt, input);
}
/**
*
* SignMessage signs a message with the key specified in the key locator. The
* returned signature is fixed-size LN wire format encoded.
*
* The main difference to SignMessage in the main RPC is that a specific key is
* used to sign the message instead of the node identity private key.
*
* @generated from protobuf rpc: SignMessage(signrpc.SignMessageReq) returns (signrpc.SignMessageResp);
*/
signMessage(input: SignMessageReq, options?: RpcOptions): UnaryCall<SignMessageReq, SignMessageResp> {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept<SignMessageReq, SignMessageResp>("unary", this._transport, method, opt, input);
}
/**
*
* VerifyMessage verifies a signature over a message using the public key
* provided. The signature must be fixed-size LN wire format encoded.
*
* The main difference to VerifyMessage in the main RPC is that the public key
* used to sign the message does not have to be a node known to the network.
*
* @generated from protobuf rpc: VerifyMessage(signrpc.VerifyMessageReq) returns (signrpc.VerifyMessageResp);
*/
verifyMessage(input: VerifyMessageReq, options?: RpcOptions): UnaryCall<VerifyMessageReq, VerifyMessageResp> {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
return stackIntercept<VerifyMessageReq, VerifyMessageResp>("unary", this._transport, method, opt, input);
}
/**
*
* DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key
* derivation between the ephemeral public key in the request and the node's
* key specified in the key_desc parameter. Either a key locator or a raw
* public key is expected in the key_desc, if neither is supplied, defaults to
* the node's identity private key:
* P_shared = privKeyNode * ephemeralPubkey
* The resulting shared public key is serialized in the compressed format and
* hashed with sha256, resulting in the final key length of 256bit.
*
* @generated from protobuf rpc: DeriveSharedKey(signrpc.SharedKeyRequest) returns (signrpc.SharedKeyResponse);
*/
deriveSharedKey(input: SharedKeyRequest, options?: RpcOptions): UnaryCall<SharedKeyRequest, SharedKeyResponse> {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
return stackIntercept<SharedKeyRequest, SharedKeyResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used
* to calculate the combined MuSig2 public key from a list of all participating
* signers' public keys. This RPC is completely stateless and deterministic and
* does not create any signing session. It can be used to determine the Taproot
* public key that should be put in an on-chain output once all public keys are
* known. A signing session is only needed later when that output should be
* _spent_ again.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CombineKeys(signrpc.MuSig2CombineKeysRequest) returns (signrpc.MuSig2CombineKeysResponse);
*/
muSig2CombineKeys(input: MuSig2CombineKeysRequest, options?: RpcOptions): UnaryCall<MuSig2CombineKeysRequest, MuSig2CombineKeysResponse> {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2CombineKeysRequest, MuSig2CombineKeysResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2CreateSession (experimental!) creates a new MuSig2 signing session
* using the local key identified by the key locator. The complete list of all
* public keys of all signing parties must be provided, including the public
* key of the local signing key. If nonces of other parties are already known,
* they can be submitted as well to reduce the number of RPC calls necessary
* later on.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CreateSession(signrpc.MuSig2SessionRequest) returns (signrpc.MuSig2SessionResponse);
*/
muSig2CreateSession(input: MuSig2SessionRequest, options?: RpcOptions): UnaryCall<MuSig2SessionRequest, MuSig2SessionResponse> {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2SessionRequest, MuSig2SessionResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2RegisterNonces (experimental!) registers one or more public nonces of
* other signing participants for a session identified by its ID. This RPC can
* be called multiple times until all nonces are registered.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2RegisterNonces(signrpc.MuSig2RegisterNoncesRequest) returns (signrpc.MuSig2RegisterNoncesResponse);
*/
muSig2RegisterNonces(input: MuSig2RegisterNoncesRequest, options?: RpcOptions): UnaryCall<MuSig2RegisterNoncesRequest, MuSig2RegisterNoncesResponse> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2RegisterNoncesRequest, MuSig2RegisterNoncesResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2Sign (experimental!) creates a partial signature using the local
* signing key that was specified when the session was created. This can only
* be called when all public nonces of all participants are known and have been
* registered with the session. If this node isn't responsible for combining
* all the partial signatures, then the cleanup flag should be set, indicating
* that the session can be removed from memory once the signature was produced.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2Sign(signrpc.MuSig2SignRequest) returns (signrpc.MuSig2SignResponse);
*/
muSig2Sign(input: MuSig2SignRequest, options?: RpcOptions): UnaryCall<MuSig2SignRequest, MuSig2SignResponse> {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2SignRequest, MuSig2SignResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2CombineSig (experimental!) combines the given partial signature(s)
* with the local one, if it already exists. Once a partial signature of all
* participants is registered, the final signature will be combined and
* returned.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2CombineSig(signrpc.MuSig2CombineSigRequest) returns (signrpc.MuSig2CombineSigResponse);
*/
muSig2CombineSig(input: MuSig2CombineSigRequest, options?: RpcOptions): UnaryCall<MuSig2CombineSigRequest, MuSig2CombineSigResponse> {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2CombineSigRequest, MuSig2CombineSigResponse>("unary", this._transport, method, opt, input);
}
/**
*
* MuSig2Cleanup (experimental!) allows a caller to clean up a session early in
* cases where it's obvious that the signing session won't succeed and the
* resources can be released.
*
* NOTE: The MuSig2 BIP is not final yet and therefore this API must be
* considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
* releases. Backward compatibility is not guaranteed!
*
* @generated from protobuf rpc: MuSig2Cleanup(signrpc.MuSig2CleanupRequest) returns (signrpc.MuSig2CleanupResponse);
*/
muSig2Cleanup(input: MuSig2CleanupRequest, options?: RpcOptions): UnaryCall<MuSig2CleanupRequest, MuSig2CleanupResponse> {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept<MuSig2CleanupRequest, MuSig2CleanupResponse>("unary", this._transport, method, opt, input);
}
}

2502
proto/lnd/signer.ts Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,958 @@
// @generated by protobuf-ts 2.8.1
// @generated from protobuf file "walletkit.proto" (package "walletrpc", syntax proto3)
// tslint:disable
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
import { WalletKit } from "./walletkit";
import type { FinalizePsbtResponse } from "./walletkit";
import type { FinalizePsbtRequest } from "./walletkit";
import type { SignPsbtResponse } from "./walletkit";
import type { SignPsbtRequest } from "./walletkit";
import type { FundPsbtResponse } from "./walletkit";
import type { FundPsbtRequest } from "./walletkit";
import type { LabelTransactionResponse } from "./walletkit";
import type { LabelTransactionRequest } from "./walletkit";
import type { ListSweepsResponse } from "./walletkit";
import type { ListSweepsRequest } from "./walletkit";
import type { BumpForceCloseFeeResponse } from "./walletkit";
import type { BumpForceCloseFeeRequest } from "./walletkit";
import type { BumpFeeResponse } from "./walletkit";
import type { BumpFeeRequest } from "./walletkit";
import type { PendingSweepsResponse } from "./walletkit";
import type { PendingSweepsRequest } from "./walletkit";
import type { EstimateFeeResponse } from "./walletkit";
import type { EstimateFeeRequest } from "./walletkit";
import type { SendOutputsResponse } from "./walletkit";
import type { SendOutputsRequest } from "./walletkit";
import type { RemoveTransactionResponse } from "./walletkit";
import type { PublishResponse } from "./walletkit";
import type { Transaction as Transaction$ } from "./walletkit";
import type { ImportTapscriptResponse } from "./walletkit";
import type { ImportTapscriptRequest } from "./walletkit";
import type { ImportPublicKeyResponse } from "./walletkit";
import type { ImportPublicKeyRequest } from "./walletkit";
import type { ImportAccountResponse } from "./walletkit";
import type { ImportAccountRequest } from "./walletkit";
import type { VerifyMessageWithAddrResponse } from "./walletkit";
import type { VerifyMessageWithAddrRequest } from "./walletkit";
import type { SignMessageWithAddrResponse } from "./walletkit";
import type { SignMessageWithAddrRequest } from "./walletkit";
import type { ListAddressesResponse } from "./walletkit";
import type { ListAddressesRequest } from "./walletkit";
import type { RequiredReserveResponse } from "./walletkit";
import type { RequiredReserveRequest } from "./walletkit";
import type { ListAccountsResponse } from "./walletkit";
import type { ListAccountsRequest } from "./walletkit";
import type { Transaction } from "./lightning";
import type { GetTransactionRequest } from "./walletkit";
import type { AddrResponse } from "./walletkit";
import type { AddrRequest } from "./walletkit";
import type { KeyLocator } from "./signer";
import type { KeyDescriptor } from "./signer";
import type { KeyReq } from "./walletkit";
import type { ListLeasesResponse } from "./walletkit";
import type { ListLeasesRequest } from "./walletkit";
import type { ReleaseOutputResponse } from "./walletkit";
import type { ReleaseOutputRequest } from "./walletkit";
import type { LeaseOutputResponse } from "./walletkit";
import type { LeaseOutputRequest } from "./walletkit";
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
import type { ListUnspentResponse } from "./walletkit";
import type { ListUnspentRequest } from "./walletkit";
import type { UnaryCall } from "@protobuf-ts/runtime-rpc";
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
//
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/**
* WalletKit is a service that gives access to the core functionalities of the
* daemon's wallet.
*
* @generated from protobuf service walletrpc.WalletKit
*/
export interface IWalletKitClient {
/**
*
* ListUnspent returns a list of all utxos spendable by the wallet with a
* number of confirmations between the specified minimum and maximum. By
* default, all utxos are listed. To list only the unconfirmed utxos, set
* the unconfirmed_only to true.
*
* @generated from protobuf rpc: ListUnspent(walletrpc.ListUnspentRequest) returns (walletrpc.ListUnspentResponse);
*/
listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall<ListUnspentRequest, ListUnspentResponse>;
/**
* lncli: `wallet leaseoutput`
* LeaseOutput locks an output to the given ID, preventing it from being
* available for any future coin selection attempts. The absolute time of the
* lock's expiration is returned. The expiration of the lock can be extended by
* successive invocations of this RPC. Outputs can be unlocked before their
* expiration through `ReleaseOutput`.
*
* @generated from protobuf rpc: LeaseOutput(walletrpc.LeaseOutputRequest) returns (walletrpc.LeaseOutputResponse);
*/
leaseOutput(input: LeaseOutputRequest, options?: RpcOptions): UnaryCall<LeaseOutputRequest, LeaseOutputResponse>;
/**
* lncli: `wallet releaseoutput`
* ReleaseOutput unlocks an output, allowing it to be available for coin
* selection if it remains unspent. The ID should match the one used to
* originally lock the output.
*
* @generated from protobuf rpc: ReleaseOutput(walletrpc.ReleaseOutputRequest) returns (walletrpc.ReleaseOutputResponse);
*/
releaseOutput(input: ReleaseOutputRequest, options?: RpcOptions): UnaryCall<ReleaseOutputRequest, ReleaseOutputResponse>;
/**
* lncli: `wallet listleases`
* ListLeases lists all currently locked utxos.
*
* @generated from protobuf rpc: ListLeases(walletrpc.ListLeasesRequest) returns (walletrpc.ListLeasesResponse);
*/
listLeases(input: ListLeasesRequest, options?: RpcOptions): UnaryCall<ListLeasesRequest, ListLeasesResponse>;
/**
*
* DeriveNextKey attempts to derive the *next* key within the key family
* (account in BIP43) specified. This method should return the next external
* child within this branch.
*
* @generated from protobuf rpc: DeriveNextKey(walletrpc.KeyReq) returns (signrpc.KeyDescriptor);
*/
deriveNextKey(input: KeyReq, options?: RpcOptions): UnaryCall<KeyReq, KeyDescriptor>;
/**
*
* DeriveKey attempts to derive an arbitrary key specified by the passed
* KeyLocator.
*
* @generated from protobuf rpc: DeriveKey(signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
*/
deriveKey(input: KeyLocator, options?: RpcOptions): UnaryCall<KeyLocator, KeyDescriptor>;
/**
*
* NextAddr returns the next unused address within the wallet.
*
* @generated from protobuf rpc: NextAddr(walletrpc.AddrRequest) returns (walletrpc.AddrResponse);
*/
nextAddr(input: AddrRequest, options?: RpcOptions): UnaryCall<AddrRequest, AddrResponse>;
/**
* lncli: `wallet gettx`
* GetTransaction returns details for a transaction found in the wallet.
*
* @generated from protobuf rpc: GetTransaction(walletrpc.GetTransactionRequest) returns (lnrpc.Transaction);
*/
getTransaction(input: GetTransactionRequest, options?: RpcOptions): UnaryCall<GetTransactionRequest, Transaction>;
/**
* lncli: `wallet accounts list`
* ListAccounts retrieves all accounts belonging to the wallet by default. A
* name and key scope filter can be provided to filter through all of the
* wallet accounts and return only those matching.
*
* @generated from protobuf rpc: ListAccounts(walletrpc.ListAccountsRequest) returns (walletrpc.ListAccountsResponse);
*/
listAccounts(input: ListAccountsRequest, options?: RpcOptions): UnaryCall<ListAccountsRequest, ListAccountsResponse>;
/**
* lncli: `wallet requiredreserve`
* RequiredReserve returns the minimum amount of satoshis that should be kept
* in the wallet in order to fee bump anchor channels if necessary. The value
* scales with the number of public anchor channels but is capped at a maximum.
*
* @generated from protobuf rpc: RequiredReserve(walletrpc.RequiredReserveRequest) returns (walletrpc.RequiredReserveResponse);
*/
requiredReserve(input: RequiredReserveRequest, options?: RpcOptions): UnaryCall<RequiredReserveRequest, RequiredReserveResponse>;
/**
* lncli: `wallet addresses list`
* ListAddresses retrieves all the addresses along with their balance. An
* account name filter can be provided to filter through all of the
* wallet accounts and return the addresses of only those matching.
*
* @generated from protobuf rpc: ListAddresses(walletrpc.ListAddressesRequest) returns (walletrpc.ListAddressesResponse);
*/
listAddresses(input: ListAddressesRequest, options?: RpcOptions): UnaryCall<ListAddressesRequest, ListAddressesResponse>;
/**
* lncli: `wallet addresses signmessage`
* SignMessageWithAddr returns the compact signature (base64 encoded) created
* with the private key of the provided address. This requires the address
* to be solely based on a public key lock (no scripts). Obviously the internal
* lnd wallet has to possess the private key of the address otherwise
* an error is returned.
*
* This method aims to provide full compatibility with the bitcoin-core and
* btcd implementation. Bitcoin-core's algorithm is not specified in a
* BIP and only applicable for legacy addresses. This method enhances the
* signing for additional address types: P2WKH, NP2WKH, P2TR.
* For P2TR addresses this represents a special case. ECDSA is used to create
* a compact signature which makes the public key of the signature recoverable.
*
* @generated from protobuf rpc: SignMessageWithAddr(walletrpc.SignMessageWithAddrRequest) returns (walletrpc.SignMessageWithAddrResponse);
*/
signMessageWithAddr(input: SignMessageWithAddrRequest, options?: RpcOptions): UnaryCall<SignMessageWithAddrRequest, SignMessageWithAddrResponse>;
/**
* lncli: `wallet addresses verifymessage`
* VerifyMessageWithAddr returns the validity and the recovered public key of
* the provided compact signature (base64 encoded). The verification is
* twofold. First the validity of the signature itself is checked and then
* it is verified that the recovered public key of the signature equals
* the public key of the provided address. There is no dependence on the
* private key of the address therefore also external addresses are allowed
* to verify signatures.
* Supported address types are P2PKH, P2WKH, NP2WKH, P2TR.
*
* This method is the counterpart of the related signing method
* (SignMessageWithAddr) and aims to provide full compatibility to
* bitcoin-core's implementation. Although bitcoin-core/btcd only provide
* this functionality for legacy addresses this function enhances it to
* the address types: P2PKH, P2WKH, NP2WKH, P2TR.
*
* The verification for P2TR addresses is a special case and requires the
* ECDSA compact signature to compare the reovered public key to the internal
* taproot key. The compact ECDSA signature format was used because there
* are still no known compact signature schemes for schnorr signatures.
*
* @generated from protobuf rpc: VerifyMessageWithAddr(walletrpc.VerifyMessageWithAddrRequest) returns (walletrpc.VerifyMessageWithAddrResponse);
*/
verifyMessageWithAddr(input: VerifyMessageWithAddrRequest, options?: RpcOptions): UnaryCall<VerifyMessageWithAddrRequest, VerifyMessageWithAddrResponse>;
/**
* lncli: `wallet accounts import`
* ImportAccount imports an account backed by an account extended public key.
* The master key fingerprint denotes the fingerprint of the root key
* corresponding to the account public key (also known as the key with
* derivation path m/). This may be required by some hardware wallets for
* proper identification and signing.
*
* The address type can usually be inferred from the key's version, but may be
* required for certain keys to map them into the proper scope.
*
* For BIP-0044 keys, an address type must be specified as we intend to not
* support importing BIP-0044 keys into the wallet using the legacy
* pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force
* the standard BIP-0049 derivation scheme, while a witness address type will
* force the standard BIP-0084 derivation scheme.
*
* For BIP-0049 keys, an address type must also be specified to make a
* distinction between the standard BIP-0049 address schema (nested witness
* pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys
* externally, witness pubkeys internally).
*
* NOTE: Events (deposits/spends) for keys derived from an account will only be
* detected by lnd if they happen after the import. Rescans to detect past
* events will be supported later on.
*
* @generated from protobuf rpc: ImportAccount(walletrpc.ImportAccountRequest) returns (walletrpc.ImportAccountResponse);
*/
importAccount(input: ImportAccountRequest, options?: RpcOptions): UnaryCall<ImportAccountRequest, ImportAccountResponse>;
/**
* lncli: `wallet accounts import-pubkey`
* ImportPublicKey imports a public key as watch-only into the wallet. The
* public key is converted into a simple address of the given type and that
* address script is watched on chain. For Taproot keys, this will only watch
* the BIP-0086 style output script. Use ImportTapscript for more advanced key
* spend or script spend outputs.
*
* NOTE: Events (deposits/spends) for a key will only be detected by lnd if
* they happen after the import. Rescans to detect past events will be
* supported later on.
*
* @generated from protobuf rpc: ImportPublicKey(walletrpc.ImportPublicKeyRequest) returns (walletrpc.ImportPublicKeyResponse);
*/
importPublicKey(input: ImportPublicKeyRequest, options?: RpcOptions): UnaryCall<ImportPublicKeyRequest, ImportPublicKeyResponse>;
/**
*
* ImportTapscript imports a Taproot script and internal key and adds the
* resulting Taproot output key as a watch-only output script into the wallet.
* For BIP-0086 style Taproot keys (no root hash commitment and no script spend
* path) use ImportPublicKey.
*
* NOTE: Events (deposits/spends) for a key will only be detected by lnd if
* they happen after the import. Rescans to detect past events will be
* supported later on.
*
* NOTE: Taproot keys imported through this RPC currently _cannot_ be used for
* funding PSBTs. Only tracking the balance and UTXOs is currently supported.
*
* @generated from protobuf rpc: ImportTapscript(walletrpc.ImportTapscriptRequest) returns (walletrpc.ImportTapscriptResponse);
*/
importTapscript(input: ImportTapscriptRequest, options?: RpcOptions): UnaryCall<ImportTapscriptRequest, ImportTapscriptResponse>;
/**
* lncli: `wallet publishtx`
* PublishTransaction attempts to publish the passed transaction to the
* network. Once this returns without an error, the wallet will continually
* attempt to re-broadcast the transaction on start up, until it enters the
* chain.
*
* @generated from protobuf rpc: PublishTransaction(walletrpc.Transaction) returns (walletrpc.PublishResponse);
*/
publishTransaction(input: Transaction$, options?: RpcOptions): UnaryCall<Transaction$, PublishResponse>;
/**
* lncli: `wallet removetx`
* RemoveTransaction attempts to remove the provided transaction from the
* internal transaction store of the wallet.
*
* @generated from protobuf rpc: RemoveTransaction(walletrpc.GetTransactionRequest) returns (walletrpc.RemoveTransactionResponse);
*/
removeTransaction(input: GetTransactionRequest, options?: RpcOptions): UnaryCall<GetTransactionRequest, RemoveTransactionResponse>;
/**
*
* SendOutputs is similar to the existing sendmany call in Bitcoind, and
* allows the caller to create a transaction that sends to several outputs at
* once. This is ideal when wanting to batch create a set of transactions.
*
* @generated from protobuf rpc: SendOutputs(walletrpc.SendOutputsRequest) returns (walletrpc.SendOutputsResponse);
*/
sendOutputs(input: SendOutputsRequest, options?: RpcOptions): UnaryCall<SendOutputsRequest, SendOutputsResponse>;
/**
* lncli: `wallet estimatefeerate`
* EstimateFee attempts to query the internal fee estimator of the wallet to
* determine the fee (in sat/kw) to attach to a transaction in order to
* achieve the confirmation target.
*
* @generated from protobuf rpc: EstimateFee(walletrpc.EstimateFeeRequest) returns (walletrpc.EstimateFeeResponse);
*/
estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall<EstimateFeeRequest, EstimateFeeResponse>;
/**
* lncli: `wallet pendingsweeps`
* PendingSweeps returns lists of on-chain outputs that lnd is currently
* attempting to sweep within its central batching engine. Outputs with similar
* fee rates are batched together in order to sweep them within a single
* transaction.
*
* NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to
* remain supported. This is an advanced API that depends on the internals of
* the UtxoSweeper, so things may change.
*
* @generated from protobuf rpc: PendingSweeps(walletrpc.PendingSweepsRequest) returns (walletrpc.PendingSweepsResponse);
*/
pendingSweeps(input: PendingSweepsRequest, options?: RpcOptions): UnaryCall<PendingSweepsRequest, PendingSweepsResponse>;
/**
* lncli: `wallet bumpfee`
* BumpFee is an endpoint that allows users to interact with lnd's sweeper
* directly. It takes an outpoint from an unconfirmed transaction and sends it
* to the sweeper for potential fee bumping. Depending on whether the outpoint
* has been registered in the sweeper (an existing input, e.g., an anchor
* output) or not (a new input, e.g., an unconfirmed wallet utxo), this will
* either be an RBF or CPFP attempt.
*
* When receiving an input, lnds sweeper needs to understand its time
* sensitivity to make economical fee bumps - internally a fee function is
* created using the deadline and budget to guide the process. When the
* deadline is approaching, the fee function will increase the fee rate and
* perform an RBF.
*
* When a force close happens, all the outputs from the force closing
* transaction will be registered in the sweeper. The sweeper will then handle
* the creation, publish, and fee bumping of the sweeping transactions.
* Everytime a new block comes in, unless the sweeping transaction is
* confirmed, an RBF is attempted. To interfere with this automatic process,
* users can use BumpFee to specify customized fee rate, budget, deadline, and
* whether the sweep should happen immediately. It's recommended to call
* `ListSweeps` to understand the shape of the existing sweeping transaction
* first - depending on the number of inputs in this transaction, the RBF
* requirements can be quite different.
*
* This RPC also serves useful when wanting to perform a Child-Pays-For-Parent
* (CPFP), where the child transaction pays for its parent's fee. This can be
* done by specifying an outpoint within the low fee transaction that is under
* the control of the wallet.
*
* @generated from protobuf rpc: BumpFee(walletrpc.BumpFeeRequest) returns (walletrpc.BumpFeeResponse);
*/
bumpFee(input: BumpFeeRequest, options?: RpcOptions): UnaryCall<BumpFeeRequest, BumpFeeResponse>;
/**
* lncli: `wallet bumpforceclosefee`
* BumpForceCloseFee is an endpoint that allows users to bump the fee of a
* channel force close. This only works for channels with option_anchors.
*
* @generated from protobuf rpc: BumpForceCloseFee(walletrpc.BumpForceCloseFeeRequest) returns (walletrpc.BumpForceCloseFeeResponse);
*/
bumpForceCloseFee(input: BumpForceCloseFeeRequest, options?: RpcOptions): UnaryCall<BumpForceCloseFeeRequest, BumpForceCloseFeeResponse>;
/**
* lncli: `wallet listsweeps`
* ListSweeps returns a list of the sweep transactions our node has produced.
* Note that these sweeps may not be confirmed yet, as we record sweeps on
* broadcast, not confirmation.
*
* @generated from protobuf rpc: ListSweeps(walletrpc.ListSweepsRequest) returns (walletrpc.ListSweepsResponse);
*/
listSweeps(input: ListSweepsRequest, options?: RpcOptions): UnaryCall<ListSweepsRequest, ListSweepsResponse>;
/**
* lncli: `wallet labeltx`
* LabelTransaction adds a label to a transaction. If the transaction already
* has a label the call will fail unless the overwrite bool is set. This will
* overwrite the existing transaction label. Labels must not be empty, and
* cannot exceed 500 characters.
*
* @generated from protobuf rpc: LabelTransaction(walletrpc.LabelTransactionRequest) returns (walletrpc.LabelTransactionResponse);
*/
labelTransaction(input: LabelTransactionRequest, options?: RpcOptions): UnaryCall<LabelTransactionRequest, LabelTransactionResponse>;
/**
* lncli: `wallet psbt fund`
* FundPsbt creates a fully populated PSBT that contains enough inputs to fund
* the outputs specified in the template. There are three ways a user can
* specify what we call the template (a list of inputs and outputs to use in
* the PSBT): Either as a PSBT packet directly with no coin selection (using
* the legacy "psbt" field), a PSBT with advanced coin selection support (using
* the new "coin_select" field) or as a raw RPC message (using the "raw"
* field).
* The legacy "psbt" and "raw" modes, the following restrictions apply:
* 1. If there are no inputs specified in the template, coin selection is
* performed automatically.
* 2. If the template does contain any inputs, it is assumed that full
* coin selection happened externally and no additional inputs are added. If
* the specified inputs aren't enough to fund the outputs with the given fee
* rate, an error is returned.
*
* The new "coin_select" mode does not have these restrictions and allows the
* user to specify a PSBT with inputs and outputs and still perform coin
* selection on top of that.
* For all modes this RPC requires any inputs that are specified to be locked
* by the user (if they belong to this node in the first place).
*
* After either selecting or verifying the inputs, all input UTXOs are locked
* with an internal app ID.
*
* NOTE: If this method returns without an error, it is the caller's
* responsibility to either spend the locked UTXOs (by finalizing and then
* publishing the transaction) or to unlock/release the locked UTXOs in case of
* an error on the caller's side.
*
* @generated from protobuf rpc: FundPsbt(walletrpc.FundPsbtRequest) returns (walletrpc.FundPsbtResponse);
*/
fundPsbt(input: FundPsbtRequest, options?: RpcOptions): UnaryCall<FundPsbtRequest, FundPsbtResponse>;
/**
*
* SignPsbt expects a partial transaction with all inputs and outputs fully
* declared and tries to sign all unsigned inputs that have all required fields
* (UTXO information, BIP32 derivation information, witness or sig scripts)
* set.
* If no error is returned, the PSBT is ready to be given to the next signer or
* to be finalized if lnd was the last signer.
*
* NOTE: This RPC only signs inputs (and only those it can sign), it does not
* perform any other tasks (such as coin selection, UTXO locking or
* input/output/fee value validation, PSBT finalization). Any input that is
* incomplete will be skipped.
*
* @generated from protobuf rpc: SignPsbt(walletrpc.SignPsbtRequest) returns (walletrpc.SignPsbtResponse);
*/
signPsbt(input: SignPsbtRequest, options?: RpcOptions): UnaryCall<SignPsbtRequest, SignPsbtResponse>;
/**
* lncli: `wallet psbt finalize`
* FinalizePsbt expects a partial transaction with all inputs and outputs fully
* declared and tries to sign all inputs that belong to the wallet. Lnd must be
* the last signer of the transaction. That means, if there are any unsigned
* non-witness inputs or inputs without UTXO information attached or inputs
* without witness data that do not belong to lnd's wallet, this method will
* fail. If no error is returned, the PSBT is ready to be extracted and the
* final TX within to be broadcast.
*
* NOTE: This method does NOT publish the transaction once finalized. It is the
* caller's responsibility to either publish the transaction on success or
* unlock/release any locked UTXOs in case of an error in this method.
*
* @generated from protobuf rpc: FinalizePsbt(walletrpc.FinalizePsbtRequest) returns (walletrpc.FinalizePsbtResponse);
*/
finalizePsbt(input: FinalizePsbtRequest, options?: RpcOptions): UnaryCall<FinalizePsbtRequest, FinalizePsbtResponse>;
}
//
// Comments in this file will be directly parsed into the API
// Documentation as descriptions of the associated method, message, or field.
// These descriptions should go right above the definition of the object, and
// can be in either block or // comment format.
//
// An RPC method can be matched to an lncli command by placing a line in the
// beginning of the description in exactly the following format:
// lncli: `methodname`
//
// Failure to specify the exact name of the command will cause documentation
// generation to fail.
//
// More information on how exactly the gRPC documentation is generated from
// this proto file can be found here:
// https://github.com/lightninglabs/lightning-api
/**
* WalletKit is a service that gives access to the core functionalities of the
* daemon's wallet.
*
* @generated from protobuf service walletrpc.WalletKit
*/
export class WalletKitClient implements IWalletKitClient, ServiceInfo {
typeName = WalletKit.typeName;
methods = WalletKit.methods;
options = WalletKit.options;
constructor(private readonly _transport: RpcTransport) {
}
/**
*
* ListUnspent returns a list of all utxos spendable by the wallet with a
* number of confirmations between the specified minimum and maximum. By
* default, all utxos are listed. To list only the unconfirmed utxos, set
* the unconfirmed_only to true.
*
* @generated from protobuf rpc: ListUnspent(walletrpc.ListUnspentRequest) returns (walletrpc.ListUnspentResponse);
*/
listUnspent(input: ListUnspentRequest, options?: RpcOptions): UnaryCall<ListUnspentRequest, ListUnspentResponse> {
const method = this.methods[0], opt = this._transport.mergeOptions(options);
return stackIntercept<ListUnspentRequest, ListUnspentResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet leaseoutput`
* LeaseOutput locks an output to the given ID, preventing it from being
* available for any future coin selection attempts. The absolute time of the
* lock's expiration is returned. The expiration of the lock can be extended by
* successive invocations of this RPC. Outputs can be unlocked before their
* expiration through `ReleaseOutput`.
*
* @generated from protobuf rpc: LeaseOutput(walletrpc.LeaseOutputRequest) returns (walletrpc.LeaseOutputResponse);
*/
leaseOutput(input: LeaseOutputRequest, options?: RpcOptions): UnaryCall<LeaseOutputRequest, LeaseOutputResponse> {
const method = this.methods[1], opt = this._transport.mergeOptions(options);
return stackIntercept<LeaseOutputRequest, LeaseOutputResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet releaseoutput`
* ReleaseOutput unlocks an output, allowing it to be available for coin
* selection if it remains unspent. The ID should match the one used to
* originally lock the output.
*
* @generated from protobuf rpc: ReleaseOutput(walletrpc.ReleaseOutputRequest) returns (walletrpc.ReleaseOutputResponse);
*/
releaseOutput(input: ReleaseOutputRequest, options?: RpcOptions): UnaryCall<ReleaseOutputRequest, ReleaseOutputResponse> {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept<ReleaseOutputRequest, ReleaseOutputResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet listleases`
* ListLeases lists all currently locked utxos.
*
* @generated from protobuf rpc: ListLeases(walletrpc.ListLeasesRequest) returns (walletrpc.ListLeasesResponse);
*/
listLeases(input: ListLeasesRequest, options?: RpcOptions): UnaryCall<ListLeasesRequest, ListLeasesResponse> {
const method = this.methods[3], opt = this._transport.mergeOptions(options);
return stackIntercept<ListLeasesRequest, ListLeasesResponse>("unary", this._transport, method, opt, input);
}
/**
*
* DeriveNextKey attempts to derive the *next* key within the key family
* (account in BIP43) specified. This method should return the next external
* child within this branch.
*
* @generated from protobuf rpc: DeriveNextKey(walletrpc.KeyReq) returns (signrpc.KeyDescriptor);
*/
deriveNextKey(input: KeyReq, options?: RpcOptions): UnaryCall<KeyReq, KeyDescriptor> {
const method = this.methods[4], opt = this._transport.mergeOptions(options);
return stackIntercept<KeyReq, KeyDescriptor>("unary", this._transport, method, opt, input);
}
/**
*
* DeriveKey attempts to derive an arbitrary key specified by the passed
* KeyLocator.
*
* @generated from protobuf rpc: DeriveKey(signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
*/
deriveKey(input: KeyLocator, options?: RpcOptions): UnaryCall<KeyLocator, KeyDescriptor> {
const method = this.methods[5], opt = this._transport.mergeOptions(options);
return stackIntercept<KeyLocator, KeyDescriptor>("unary", this._transport, method, opt, input);
}
/**
*
* NextAddr returns the next unused address within the wallet.
*
* @generated from protobuf rpc: NextAddr(walletrpc.AddrRequest) returns (walletrpc.AddrResponse);
*/
nextAddr(input: AddrRequest, options?: RpcOptions): UnaryCall<AddrRequest, AddrResponse> {
const method = this.methods[6], opt = this._transport.mergeOptions(options);
return stackIntercept<AddrRequest, AddrResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet gettx`
* GetTransaction returns details for a transaction found in the wallet.
*
* @generated from protobuf rpc: GetTransaction(walletrpc.GetTransactionRequest) returns (lnrpc.Transaction);
*/
getTransaction(input: GetTransactionRequest, options?: RpcOptions): UnaryCall<GetTransactionRequest, Transaction> {
const method = this.methods[7], opt = this._transport.mergeOptions(options);
return stackIntercept<GetTransactionRequest, Transaction>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet accounts list`
* ListAccounts retrieves all accounts belonging to the wallet by default. A
* name and key scope filter can be provided to filter through all of the
* wallet accounts and return only those matching.
*
* @generated from protobuf rpc: ListAccounts(walletrpc.ListAccountsRequest) returns (walletrpc.ListAccountsResponse);
*/
listAccounts(input: ListAccountsRequest, options?: RpcOptions): UnaryCall<ListAccountsRequest, ListAccountsResponse> {
const method = this.methods[8], opt = this._transport.mergeOptions(options);
return stackIntercept<ListAccountsRequest, ListAccountsResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet requiredreserve`
* RequiredReserve returns the minimum amount of satoshis that should be kept
* in the wallet in order to fee bump anchor channels if necessary. The value
* scales with the number of public anchor channels but is capped at a maximum.
*
* @generated from protobuf rpc: RequiredReserve(walletrpc.RequiredReserveRequest) returns (walletrpc.RequiredReserveResponse);
*/
requiredReserve(input: RequiredReserveRequest, options?: RpcOptions): UnaryCall<RequiredReserveRequest, RequiredReserveResponse> {
const method = this.methods[9], opt = this._transport.mergeOptions(options);
return stackIntercept<RequiredReserveRequest, RequiredReserveResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet addresses list`
* ListAddresses retrieves all the addresses along with their balance. An
* account name filter can be provided to filter through all of the
* wallet accounts and return the addresses of only those matching.
*
* @generated from protobuf rpc: ListAddresses(walletrpc.ListAddressesRequest) returns (walletrpc.ListAddressesResponse);
*/
listAddresses(input: ListAddressesRequest, options?: RpcOptions): UnaryCall<ListAddressesRequest, ListAddressesResponse> {
const method = this.methods[10], opt = this._transport.mergeOptions(options);
return stackIntercept<ListAddressesRequest, ListAddressesResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet addresses signmessage`
* SignMessageWithAddr returns the compact signature (base64 encoded) created
* with the private key of the provided address. This requires the address
* to be solely based on a public key lock (no scripts). Obviously the internal
* lnd wallet has to possess the private key of the address otherwise
* an error is returned.
*
* This method aims to provide full compatibility with the bitcoin-core and
* btcd implementation. Bitcoin-core's algorithm is not specified in a
* BIP and only applicable for legacy addresses. This method enhances the
* signing for additional address types: P2WKH, NP2WKH, P2TR.
* For P2TR addresses this represents a special case. ECDSA is used to create
* a compact signature which makes the public key of the signature recoverable.
*
* @generated from protobuf rpc: SignMessageWithAddr(walletrpc.SignMessageWithAddrRequest) returns (walletrpc.SignMessageWithAddrResponse);
*/
signMessageWithAddr(input: SignMessageWithAddrRequest, options?: RpcOptions): UnaryCall<SignMessageWithAddrRequest, SignMessageWithAddrResponse> {
const method = this.methods[11], opt = this._transport.mergeOptions(options);
return stackIntercept<SignMessageWithAddrRequest, SignMessageWithAddrResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet addresses verifymessage`
* VerifyMessageWithAddr returns the validity and the recovered public key of
* the provided compact signature (base64 encoded). The verification is
* twofold. First the validity of the signature itself is checked and then
* it is verified that the recovered public key of the signature equals
* the public key of the provided address. There is no dependence on the
* private key of the address therefore also external addresses are allowed
* to verify signatures.
* Supported address types are P2PKH, P2WKH, NP2WKH, P2TR.
*
* This method is the counterpart of the related signing method
* (SignMessageWithAddr) and aims to provide full compatibility to
* bitcoin-core's implementation. Although bitcoin-core/btcd only provide
* this functionality for legacy addresses this function enhances it to
* the address types: P2PKH, P2WKH, NP2WKH, P2TR.
*
* The verification for P2TR addresses is a special case and requires the
* ECDSA compact signature to compare the reovered public key to the internal
* taproot key. The compact ECDSA signature format was used because there
* are still no known compact signature schemes for schnorr signatures.
*
* @generated from protobuf rpc: VerifyMessageWithAddr(walletrpc.VerifyMessageWithAddrRequest) returns (walletrpc.VerifyMessageWithAddrResponse);
*/
verifyMessageWithAddr(input: VerifyMessageWithAddrRequest, options?: RpcOptions): UnaryCall<VerifyMessageWithAddrRequest, VerifyMessageWithAddrResponse> {
const method = this.methods[12], opt = this._transport.mergeOptions(options);
return stackIntercept<VerifyMessageWithAddrRequest, VerifyMessageWithAddrResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet accounts import`
* ImportAccount imports an account backed by an account extended public key.
* The master key fingerprint denotes the fingerprint of the root key
* corresponding to the account public key (also known as the key with
* derivation path m/). This may be required by some hardware wallets for
* proper identification and signing.
*
* The address type can usually be inferred from the key's version, but may be
* required for certain keys to map them into the proper scope.
*
* For BIP-0044 keys, an address type must be specified as we intend to not
* support importing BIP-0044 keys into the wallet using the legacy
* pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force
* the standard BIP-0049 derivation scheme, while a witness address type will
* force the standard BIP-0084 derivation scheme.
*
* For BIP-0049 keys, an address type must also be specified to make a
* distinction between the standard BIP-0049 address schema (nested witness
* pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys
* externally, witness pubkeys internally).
*
* NOTE: Events (deposits/spends) for keys derived from an account will only be
* detected by lnd if they happen after the import. Rescans to detect past
* events will be supported later on.
*
* @generated from protobuf rpc: ImportAccount(walletrpc.ImportAccountRequest) returns (walletrpc.ImportAccountResponse);
*/
importAccount(input: ImportAccountRequest, options?: RpcOptions): UnaryCall<ImportAccountRequest, ImportAccountResponse> {
const method = this.methods[13], opt = this._transport.mergeOptions(options);
return stackIntercept<ImportAccountRequest, ImportAccountResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet accounts import-pubkey`
* ImportPublicKey imports a public key as watch-only into the wallet. The
* public key is converted into a simple address of the given type and that
* address script is watched on chain. For Taproot keys, this will only watch
* the BIP-0086 style output script. Use ImportTapscript for more advanced key
* spend or script spend outputs.
*
* NOTE: Events (deposits/spends) for a key will only be detected by lnd if
* they happen after the import. Rescans to detect past events will be
* supported later on.
*
* @generated from protobuf rpc: ImportPublicKey(walletrpc.ImportPublicKeyRequest) returns (walletrpc.ImportPublicKeyResponse);
*/
importPublicKey(input: ImportPublicKeyRequest, options?: RpcOptions): UnaryCall<ImportPublicKeyRequest, ImportPublicKeyResponse> {
const method = this.methods[14], opt = this._transport.mergeOptions(options);
return stackIntercept<ImportPublicKeyRequest, ImportPublicKeyResponse>("unary", this._transport, method, opt, input);
}
/**
*
* ImportTapscript imports a Taproot script and internal key and adds the
* resulting Taproot output key as a watch-only output script into the wallet.
* For BIP-0086 style Taproot keys (no root hash commitment and no script spend
* path) use ImportPublicKey.
*
* NOTE: Events (deposits/spends) for a key will only be detected by lnd if
* they happen after the import. Rescans to detect past events will be
* supported later on.
*
* NOTE: Taproot keys imported through this RPC currently _cannot_ be used for
* funding PSBTs. Only tracking the balance and UTXOs is currently supported.
*
* @generated from protobuf rpc: ImportTapscript(walletrpc.ImportTapscriptRequest) returns (walletrpc.ImportTapscriptResponse);
*/
importTapscript(input: ImportTapscriptRequest, options?: RpcOptions): UnaryCall<ImportTapscriptRequest, ImportTapscriptResponse> {
const method = this.methods[15], opt = this._transport.mergeOptions(options);
return stackIntercept<ImportTapscriptRequest, ImportTapscriptResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet publishtx`
* PublishTransaction attempts to publish the passed transaction to the
* network. Once this returns without an error, the wallet will continually
* attempt to re-broadcast the transaction on start up, until it enters the
* chain.
*
* @generated from protobuf rpc: PublishTransaction(walletrpc.Transaction) returns (walletrpc.PublishResponse);
*/
publishTransaction(input: Transaction$, options?: RpcOptions): UnaryCall<Transaction$, PublishResponse> {
const method = this.methods[16], opt = this._transport.mergeOptions(options);
return stackIntercept<Transaction$, PublishResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet removetx`
* RemoveTransaction attempts to remove the provided transaction from the
* internal transaction store of the wallet.
*
* @generated from protobuf rpc: RemoveTransaction(walletrpc.GetTransactionRequest) returns (walletrpc.RemoveTransactionResponse);
*/
removeTransaction(input: GetTransactionRequest, options?: RpcOptions): UnaryCall<GetTransactionRequest, RemoveTransactionResponse> {
const method = this.methods[17], opt = this._transport.mergeOptions(options);
return stackIntercept<GetTransactionRequest, RemoveTransactionResponse>("unary", this._transport, method, opt, input);
}
/**
*
* SendOutputs is similar to the existing sendmany call in Bitcoind, and
* allows the caller to create a transaction that sends to several outputs at
* once. This is ideal when wanting to batch create a set of transactions.
*
* @generated from protobuf rpc: SendOutputs(walletrpc.SendOutputsRequest) returns (walletrpc.SendOutputsResponse);
*/
sendOutputs(input: SendOutputsRequest, options?: RpcOptions): UnaryCall<SendOutputsRequest, SendOutputsResponse> {
const method = this.methods[18], opt = this._transport.mergeOptions(options);
return stackIntercept<SendOutputsRequest, SendOutputsResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet estimatefeerate`
* EstimateFee attempts to query the internal fee estimator of the wallet to
* determine the fee (in sat/kw) to attach to a transaction in order to
* achieve the confirmation target.
*
* @generated from protobuf rpc: EstimateFee(walletrpc.EstimateFeeRequest) returns (walletrpc.EstimateFeeResponse);
*/
estimateFee(input: EstimateFeeRequest, options?: RpcOptions): UnaryCall<EstimateFeeRequest, EstimateFeeResponse> {
const method = this.methods[19], opt = this._transport.mergeOptions(options);
return stackIntercept<EstimateFeeRequest, EstimateFeeResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet pendingsweeps`
* PendingSweeps returns lists of on-chain outputs that lnd is currently
* attempting to sweep within its central batching engine. Outputs with similar
* fee rates are batched together in order to sweep them within a single
* transaction.
*
* NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to
* remain supported. This is an advanced API that depends on the internals of
* the UtxoSweeper, so things may change.
*
* @generated from protobuf rpc: PendingSweeps(walletrpc.PendingSweepsRequest) returns (walletrpc.PendingSweepsResponse);
*/
pendingSweeps(input: PendingSweepsRequest, options?: RpcOptions): UnaryCall<PendingSweepsRequest, PendingSweepsResponse> {
const method = this.methods[20], opt = this._transport.mergeOptions(options);
return stackIntercept<PendingSweepsRequest, PendingSweepsResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet bumpfee`
* BumpFee is an endpoint that allows users to interact with lnd's sweeper
* directly. It takes an outpoint from an unconfirmed transaction and sends it
* to the sweeper for potential fee bumping. Depending on whether the outpoint
* has been registered in the sweeper (an existing input, e.g., an anchor
* output) or not (a new input, e.g., an unconfirmed wallet utxo), this will
* either be an RBF or CPFP attempt.
*
* When receiving an input, lnds sweeper needs to understand its time
* sensitivity to make economical fee bumps - internally a fee function is
* created using the deadline and budget to guide the process. When the
* deadline is approaching, the fee function will increase the fee rate and
* perform an RBF.
*
* When a force close happens, all the outputs from the force closing
* transaction will be registered in the sweeper. The sweeper will then handle
* the creation, publish, and fee bumping of the sweeping transactions.
* Everytime a new block comes in, unless the sweeping transaction is
* confirmed, an RBF is attempted. To interfere with this automatic process,
* users can use BumpFee to specify customized fee rate, budget, deadline, and
* whether the sweep should happen immediately. It's recommended to call
* `ListSweeps` to understand the shape of the existing sweeping transaction
* first - depending on the number of inputs in this transaction, the RBF
* requirements can be quite different.
*
* This RPC also serves useful when wanting to perform a Child-Pays-For-Parent
* (CPFP), where the child transaction pays for its parent's fee. This can be
* done by specifying an outpoint within the low fee transaction that is under
* the control of the wallet.
*
* @generated from protobuf rpc: BumpFee(walletrpc.BumpFeeRequest) returns (walletrpc.BumpFeeResponse);
*/
bumpFee(input: BumpFeeRequest, options?: RpcOptions): UnaryCall<BumpFeeRequest, BumpFeeResponse> {
const method = this.methods[21], opt = this._transport.mergeOptions(options);
return stackIntercept<BumpFeeRequest, BumpFeeResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet bumpforceclosefee`
* BumpForceCloseFee is an endpoint that allows users to bump the fee of a
* channel force close. This only works for channels with option_anchors.
*
* @generated from protobuf rpc: BumpForceCloseFee(walletrpc.BumpForceCloseFeeRequest) returns (walletrpc.BumpForceCloseFeeResponse);
*/
bumpForceCloseFee(input: BumpForceCloseFeeRequest, options?: RpcOptions): UnaryCall<BumpForceCloseFeeRequest, BumpForceCloseFeeResponse> {
const method = this.methods[22], opt = this._transport.mergeOptions(options);
return stackIntercept<BumpForceCloseFeeRequest, BumpForceCloseFeeResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet listsweeps`
* ListSweeps returns a list of the sweep transactions our node has produced.
* Note that these sweeps may not be confirmed yet, as we record sweeps on
* broadcast, not confirmation.
*
* @generated from protobuf rpc: ListSweeps(walletrpc.ListSweepsRequest) returns (walletrpc.ListSweepsResponse);
*/
listSweeps(input: ListSweepsRequest, options?: RpcOptions): UnaryCall<ListSweepsRequest, ListSweepsResponse> {
const method = this.methods[23], opt = this._transport.mergeOptions(options);
return stackIntercept<ListSweepsRequest, ListSweepsResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet labeltx`
* LabelTransaction adds a label to a transaction. If the transaction already
* has a label the call will fail unless the overwrite bool is set. This will
* overwrite the existing transaction label. Labels must not be empty, and
* cannot exceed 500 characters.
*
* @generated from protobuf rpc: LabelTransaction(walletrpc.LabelTransactionRequest) returns (walletrpc.LabelTransactionResponse);
*/
labelTransaction(input: LabelTransactionRequest, options?: RpcOptions): UnaryCall<LabelTransactionRequest, LabelTransactionResponse> {
const method = this.methods[24], opt = this._transport.mergeOptions(options);
return stackIntercept<LabelTransactionRequest, LabelTransactionResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet psbt fund`
* FundPsbt creates a fully populated PSBT that contains enough inputs to fund
* the outputs specified in the template. There are three ways a user can
* specify what we call the template (a list of inputs and outputs to use in
* the PSBT): Either as a PSBT packet directly with no coin selection (using
* the legacy "psbt" field), a PSBT with advanced coin selection support (using
* the new "coin_select" field) or as a raw RPC message (using the "raw"
* field).
* The legacy "psbt" and "raw" modes, the following restrictions apply:
* 1. If there are no inputs specified in the template, coin selection is
* performed automatically.
* 2. If the template does contain any inputs, it is assumed that full
* coin selection happened externally and no additional inputs are added. If
* the specified inputs aren't enough to fund the outputs with the given fee
* rate, an error is returned.
*
* The new "coin_select" mode does not have these restrictions and allows the
* user to specify a PSBT with inputs and outputs and still perform coin
* selection on top of that.
* For all modes this RPC requires any inputs that are specified to be locked
* by the user (if they belong to this node in the first place).
*
* After either selecting or verifying the inputs, all input UTXOs are locked
* with an internal app ID.
*
* NOTE: If this method returns without an error, it is the caller's
* responsibility to either spend the locked UTXOs (by finalizing and then
* publishing the transaction) or to unlock/release the locked UTXOs in case of
* an error on the caller's side.
*
* @generated from protobuf rpc: FundPsbt(walletrpc.FundPsbtRequest) returns (walletrpc.FundPsbtResponse);
*/
fundPsbt(input: FundPsbtRequest, options?: RpcOptions): UnaryCall<FundPsbtRequest, FundPsbtResponse> {
const method = this.methods[25], opt = this._transport.mergeOptions(options);
return stackIntercept<FundPsbtRequest, FundPsbtResponse>("unary", this._transport, method, opt, input);
}
/**
*
* SignPsbt expects a partial transaction with all inputs and outputs fully
* declared and tries to sign all unsigned inputs that have all required fields
* (UTXO information, BIP32 derivation information, witness or sig scripts)
* set.
* If no error is returned, the PSBT is ready to be given to the next signer or
* to be finalized if lnd was the last signer.
*
* NOTE: This RPC only signs inputs (and only those it can sign), it does not
* perform any other tasks (such as coin selection, UTXO locking or
* input/output/fee value validation, PSBT finalization). Any input that is
* incomplete will be skipped.
*
* @generated from protobuf rpc: SignPsbt(walletrpc.SignPsbtRequest) returns (walletrpc.SignPsbtResponse);
*/
signPsbt(input: SignPsbtRequest, options?: RpcOptions): UnaryCall<SignPsbtRequest, SignPsbtResponse> {
const method = this.methods[26], opt = this._transport.mergeOptions(options);
return stackIntercept<SignPsbtRequest, SignPsbtResponse>("unary", this._transport, method, opt, input);
}
/**
* lncli: `wallet psbt finalize`
* FinalizePsbt expects a partial transaction with all inputs and outputs fully
* declared and tries to sign all inputs that belong to the wallet. Lnd must be
* the last signer of the transaction. That means, if there are any unsigned
* non-witness inputs or inputs without UTXO information attached or inputs
* without witness data that do not belong to lnd's wallet, this method will
* fail. If no error is returned, the PSBT is ready to be extracted and the
* final TX within to be broadcast.
*
* NOTE: This method does NOT publish the transaction once finalized. It is the
* caller's responsibility to either publish the transaction on success or
* unlock/release any locked UTXOs in case of an error in this method.
*
* @generated from protobuf rpc: FinalizePsbt(walletrpc.FinalizePsbtRequest) returns (walletrpc.FinalizePsbtResponse);
*/
finalizePsbt(input: FinalizePsbtRequest, options?: RpcOptions): UnaryCall<FinalizePsbtRequest, FinalizePsbtResponse> {
const method = this.methods[27], opt = this._transport.mergeOptions(options);
return stackIntercept<FinalizePsbtRequest, FinalizePsbtResponse>("unary", this._transport, method, opt, input);
}
}

5641
proto/lnd/walletkit.ts Normal file

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
*/ */

709
proto/others/signer.proto Normal file
View file

@ -0,0 +1,709 @@
syntax = "proto3";
package signrpc;
option go_package = "github.com/lightningnetwork/lnd/lnrpc/signrpc";
// Signer is a service that gives access to the signing functionality of the
// daemon's wallet.
service Signer {
/*
SignOutputRaw is a method that can be used to generated a signature for a
set of inputs/outputs to a transaction. Each request specifies details
concerning how the outputs should be signed, which keys they should be
signed with, and also any optional tweaks. The return value is a fixed
64-byte signature (the same format as we use on the wire in Lightning).
If we are unable to sign using the specified keys, then an error will be
returned.
*/
rpc SignOutputRaw (SignReq) returns (SignResp);
/*
ComputeInputScript generates a complete InputIndex for the passed
transaction with the signature as defined within the passed SignDescriptor.
This method should be capable of generating the proper input script for both
regular p2wkh/p2tr outputs and p2wkh outputs nested within a regular p2sh
output.
Note that when using this method to sign inputs belonging to the wallet,
the only items of the SignDescriptor that need to be populated are pkScript
in the TxOut field, the value in that same field, and finally the input
index.
*/
rpc ComputeInputScript (SignReq) returns (InputScriptResp);
/*
SignMessage signs a message with the key specified in the key locator. The
returned signature is fixed-size LN wire format encoded.
The main difference to SignMessage in the main RPC is that a specific key is
used to sign the message instead of the node identity private key.
*/
rpc SignMessage (SignMessageReq) returns (SignMessageResp);
/*
VerifyMessage verifies a signature over a message using the public key
provided. The signature must be fixed-size LN wire format encoded.
The main difference to VerifyMessage in the main RPC is that the public key
used to sign the message does not have to be a node known to the network.
*/
rpc VerifyMessage (VerifyMessageReq) returns (VerifyMessageResp);
/*
DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key
derivation between the ephemeral public key in the request and the node's
key specified in the key_desc parameter. Either a key locator or a raw
public key is expected in the key_desc, if neither is supplied, defaults to
the node's identity private key:
P_shared = privKeyNode * ephemeralPubkey
The resulting shared public key is serialized in the compressed format and
hashed with sha256, resulting in the final key length of 256bit.
*/
rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse);
/*
MuSig2CombineKeys (experimental!) is a stateless helper RPC that can be used
to calculate the combined MuSig2 public key from a list of all participating
signers' public keys. This RPC is completely stateless and deterministic and
does not create any signing session. It can be used to determine the Taproot
public key that should be put in an on-chain output once all public keys are
known. A signing session is only needed later when that output should be
_spent_ again.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2CombineKeys (MuSig2CombineKeysRequest)
returns (MuSig2CombineKeysResponse);
/*
MuSig2CreateSession (experimental!) creates a new MuSig2 signing session
using the local key identified by the key locator. The complete list of all
public keys of all signing parties must be provided, including the public
key of the local signing key. If nonces of other parties are already known,
they can be submitted as well to reduce the number of RPC calls necessary
later on.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2CreateSession (MuSig2SessionRequest)
returns (MuSig2SessionResponse);
/*
MuSig2RegisterNonces (experimental!) registers one or more public nonces of
other signing participants for a session identified by its ID. This RPC can
be called multiple times until all nonces are registered.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2RegisterNonces (MuSig2RegisterNoncesRequest)
returns (MuSig2RegisterNoncesResponse);
/*
MuSig2Sign (experimental!) creates a partial signature using the local
signing key that was specified when the session was created. This can only
be called when all public nonces of all participants are known and have been
registered with the session. If this node isn't responsible for combining
all the partial signatures, then the cleanup flag should be set, indicating
that the session can be removed from memory once the signature was produced.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2Sign (MuSig2SignRequest) returns (MuSig2SignResponse);
/*
MuSig2CombineSig (experimental!) combines the given partial signature(s)
with the local one, if it already exists. Once a partial signature of all
participants is registered, the final signature will be combined and
returned.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2CombineSig (MuSig2CombineSigRequest)
returns (MuSig2CombineSigResponse);
/*
MuSig2Cleanup (experimental!) allows a caller to clean up a session early in
cases where it's obvious that the signing session won't succeed and the
resources can be released.
NOTE: The MuSig2 BIP is not final yet and therefore this API must be
considered to be HIGHLY EXPERIMENTAL and subject to change in upcoming
releases. Backward compatibility is not guaranteed!
*/
rpc MuSig2Cleanup (MuSig2CleanupRequest) returns (MuSig2CleanupResponse);
}
message KeyLocator {
// The family of key being identified.
int32 key_family = 1;
// The precise index of the key being identified.
int32 key_index = 2;
}
message KeyDescriptor {
/*
The raw bytes of the public key in the key pair being identified. Either
this or the KeyLocator must be specified.
*/
bytes raw_key_bytes = 1;
/*
The key locator that identifies which private key to use for signing.
Either this or the raw bytes of the target public key must be specified.
*/
KeyLocator key_loc = 2;
}
message TxOut {
// The value of the output being spent.
int64 value = 1;
// The script of the output being spent.
bytes pk_script = 2;
}
enum SignMethod {
/*
Specifies that a SegWit v0 (p2wkh, np2wkh, p2wsh) input script should be
signed.
*/
SIGN_METHOD_WITNESS_V0 = 0;
/*
Specifies that a SegWit v1 (p2tr) input should be signed by using the
BIP0086 method (commit to internal key only).
*/
SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086 = 1;
/*
Specifies that a SegWit v1 (p2tr) input should be signed by using a given
taproot hash to commit to in addition to the internal key.
*/
SIGN_METHOD_TAPROOT_KEY_SPEND = 2;
/*
Specifies that a SegWit v1 (p2tr) input should be spent using the script
path and that a specific leaf script should be signed for.
*/
SIGN_METHOD_TAPROOT_SCRIPT_SPEND = 3;
}
message SignDescriptor {
/*
A descriptor that precisely describes *which* key to use for signing. This
may provide the raw public key directly, or require the Signer to re-derive
the key according to the populated derivation path.
Note that if the key descriptor was obtained through walletrpc.DeriveKey,
then the key locator MUST always be provided, since the derived keys are not
persisted unlike with DeriveNextKey.
*/
KeyDescriptor key_desc = 1;
/*
A scalar value that will be added to the private key corresponding to the
above public key to obtain the private key to be used to sign this input.
This value is typically derived via the following computation:
* derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N
*/
bytes single_tweak = 2;
/*
A private key that will be used in combination with its corresponding
private key to derive the private key that is to be used to sign the target
input. Within the Lightning protocol, this value is typically the
commitment secret from a previously revoked commitment transaction. This
value is in combination with two hash values, and the original private key
to derive the private key to be used when signing.
* k = (privKey*sha256(pubKey || tweakPub) +
tweakPriv*sha256(tweakPub || pubKey)) mod N
*/
bytes double_tweak = 3;
/*
The 32 byte input to the taproot tweak derivation that is used to derive
the output key from an internal key: outputKey = internalKey +
tagged_hash("tapTweak", internalKey || tapTweak).
When doing a BIP 86 spend, this field can be an empty byte slice.
When doing a normal key path spend, with the output key committing to an
actual script root, then this field should be: the tapscript root hash.
*/
bytes tap_tweak = 10;
/*
The full script required to properly redeem the output. This field will
only be populated if a p2tr, p2wsh or a p2sh output is being signed. If a
taproot script path spend is being attempted, then this should be the raw
leaf script.
*/
bytes witness_script = 4;
/*
A description of the output being spent. The value and script MUST be
provided.
*/
TxOut output = 5;
/*
The target sighash type that should be used when generating the final
sighash, and signature.
*/
uint32 sighash = 7;
/*
The target input within the transaction that should be signed.
*/
int32 input_index = 8;
/*
The sign method specifies how the input should be signed. Depending on the
method, either the tap_tweak, witness_script or both need to be specified.
Defaults to SegWit v0 signing to be backward compatible with older RPC
clients.
*/
SignMethod sign_method = 9;
}
message SignReq {
// The raw bytes of the transaction to be signed.
bytes raw_tx_bytes = 1;
// A set of sign descriptors, for each input to be signed.
repeated SignDescriptor sign_descs = 2;
/*
The full list of UTXO information for each of the inputs being spent. This
is required when spending one or more taproot (SegWit v1) outputs.
*/
repeated TxOut prev_outputs = 3;
}
message SignResp {
/*
A set of signatures realized in a fixed 64-byte format ordered in ascending
input order.
*/
repeated bytes raw_sigs = 1;
}
message InputScript {
// The serializes witness stack for the specified input.
repeated bytes witness = 1;
/*
The optional sig script for the specified witness that will only be set if
the input specified is a nested p2sh witness program.
*/
bytes sig_script = 2;
}
message InputScriptResp {
// The set of fully valid input scripts requested.
repeated InputScript input_scripts = 1;
}
message SignMessageReq {
/*
The message to be signed. When using REST, this field must be encoded as
base64.
*/
bytes msg = 1;
// The key locator that identifies which key to use for signing.
KeyLocator key_loc = 2;
// Double-SHA256 hash instead of just the default single round.
bool double_hash = 3;
/*
Use the compact (pubkey recoverable) format instead of the raw lnwire
format. This option cannot be used with Schnorr signatures.
*/
bool compact_sig = 4;
/*
Use Schnorr signature. This option cannot be used with compact format.
*/
bool schnorr_sig = 5;
/*
The optional Taproot tweak bytes to apply to the private key before creating
a Schnorr signature. The private key is tweaked as described in BIP-341:
privKey + h_tapTweak(internalKey || tapTweak)
*/
bytes schnorr_sig_tap_tweak = 6;
/*
An optional tag that can be provided when taking a tagged hash of a
message. This option can only be used when schnorr_sig is true.
*/
bytes tag = 7;
}
message SignMessageResp {
/*
The signature for the given message in the fixed-size LN wire format.
*/
bytes signature = 1;
}
message VerifyMessageReq {
// The message over which the signature is to be verified. When using
// REST, this field must be encoded as base64.
bytes msg = 1;
/*
The fixed-size LN wire encoded signature to be verified over the given
message. When using REST, this field must be encoded as base64.
*/
bytes signature = 2;
/*
The public key the signature has to be valid for. When using REST, this
field must be encoded as base64. If the is_schnorr_sig option is true, then
the public key is expected to be in the 32-byte x-only serialization
according to BIP-340.
*/
bytes pubkey = 3;
/*
Specifies if the signature is a Schnorr signature.
*/
bool is_schnorr_sig = 4;
/*
An optional tag that can be provided when taking a tagged hash of a
message. This option can only be used when is_schnorr_sig is true.
*/
bytes tag = 5;
}
message VerifyMessageResp {
// Whether the signature was valid over the given message.
bool valid = 1;
}
message SharedKeyRequest {
// The ephemeral public key to use for the DH key derivation.
bytes ephemeral_pubkey = 1;
/*
Deprecated. The optional key locator of the local key that should be used.
If this parameter is not set then the node's identity private key will be
used.
*/
KeyLocator key_loc = 2 [deprecated = true];
/*
A key descriptor describes the key used for performing ECDH. Either a key
locator or a raw public key is expected, if neither is supplied, defaults to
the node's identity private key.
*/
KeyDescriptor key_desc = 3;
}
message SharedKeyResponse {
// The shared public key, hashed with sha256.
bytes shared_key = 1;
}
message TweakDesc {
/*
Tweak is the 32-byte value that will modify the public key.
*/
bytes tweak = 1;
/*
Specifies if the target key should be converted to an x-only public key
before tweaking. If true, then the public key will be mapped to an x-only
key before the tweaking operation is applied.
*/
bool is_x_only = 2;
}
message TaprootTweakDesc {
/*
The root hash of the tapscript tree if a script path is committed to. If
the MuSig2 key put on chain doesn't also commit to a script path (BIP-0086
key spend only), then this needs to be empty and the key_spend_only field
below must be set to true. This is required because gRPC cannot
differentiate between a zero-size byte slice and a nil byte slice (both
would be serialized the same way). So the extra boolean is required.
*/
bytes script_root = 1;
/*
Indicates that the above script_root is expected to be empty because this
is a BIP-0086 key spend only commitment where only the internal key is
committed to instead of also including a script root hash.
*/
bool key_spend_only = 2;
}
enum MuSig2Version {
/*
The default value on the RPC is zero for enums so we need to represent an
invalid/undefined version by default to make sure clients upgrade their
software to set the version explicitly.
*/
MUSIG2_VERSION_UNDEFINED = 0;
/*
The version of MuSig2 that lnd 0.15.x shipped with, which corresponds to the
version v0.4.0 of the MuSig2 BIP draft.
*/
MUSIG2_VERSION_V040 = 1;
/*
The current version of MuSig2 which corresponds to the version v1.0.0rc2 of
the MuSig2 BIP draft.
*/
MUSIG2_VERSION_V100RC2 = 2;
}
message MuSig2CombineKeysRequest {
/*
A list of all public keys (serialized in 32-byte x-only format for v0.4.0
and 33-byte compressed format for v1.0.0rc2!) participating in the signing
session. The list will always be sorted lexicographically internally. This
must include the local key which is described by the above key_loc.
*/
repeated bytes all_signer_pubkeys = 1;
/*
A series of optional generic tweaks to be applied to the aggregated
public key.
*/
repeated TweakDesc tweaks = 2;
/*
An optional taproot specific tweak that must be specified if the MuSig2
combined key will be used as the main taproot key of a taproot output
on-chain.
*/
TaprootTweakDesc taproot_tweak = 3;
/*
The mandatory version of the MuSig2 BIP draft to use. This is necessary to
differentiate between the changes that were made to the BIP while this
experimental RPC was already released. Some of those changes affect how the
combined key and nonces are created.
*/
MuSig2Version version = 4;
}
message MuSig2CombineKeysResponse {
/*
The combined public key (in the 32-byte x-only format) with all tweaks
applied to it. If a taproot tweak is specified, this corresponds to the
taproot key that can be put into the on-chain output.
*/
bytes combined_key = 1;
/*
The raw combined public key (in the 32-byte x-only format) before any tweaks
are applied to it. If a taproot tweak is specified, this corresponds to the
internal key that needs to be put into the witness if the script spend path
is used.
*/
bytes taproot_internal_key = 2;
/*
The version of the MuSig2 BIP that was used to combine the keys.
*/
MuSig2Version version = 4;
}
message MuSig2SessionRequest {
/*
The key locator that identifies which key to use for signing.
*/
KeyLocator key_loc = 1;
/*
A list of all public keys (serialized in 32-byte x-only format for v0.4.0
and 33-byte compressed format for v1.0.0rc2!) participating in the signing
session. The list will always be sorted lexicographically internally. This
must include the local key which is described by the above key_loc.
*/
repeated bytes all_signer_pubkeys = 2;
/*
An optional list of all public nonces of other signing participants that
might already be known.
*/
repeated bytes other_signer_public_nonces = 3;
/*
A series of optional generic tweaks to be applied to the aggregated
public key.
*/
repeated TweakDesc tweaks = 4;
/*
An optional taproot specific tweak that must be specified if the MuSig2
combined key will be used as the main taproot key of a taproot output
on-chain.
*/
TaprootTweakDesc taproot_tweak = 5;
/*
The mandatory version of the MuSig2 BIP draft to use. This is necessary to
differentiate between the changes that were made to the BIP while this
experimental RPC was already released. Some of those changes affect how the
combined key and nonces are created.
*/
MuSig2Version version = 6;
/*
A set of pre generated secret local nonces to use in the musig2 session.
This field is optional. This can be useful for protocols that need to send
nonces ahead of time before the set of signer keys are known. This value
MUST be 97 bytes and be the concatenation of two CSPRNG generated 32 byte
values and local public key used for signing as specified in the key_loc
field.
*/
bytes pregenerated_local_nonce = 7;
}
message MuSig2SessionResponse {
/*
The unique ID that represents this signing session. A session can be used
for producing a signature a single time. If the signing fails for any
reason, a new session with the same participants needs to be created.
*/
bytes session_id = 1;
/*
The combined public key (in the 32-byte x-only format) with all tweaks
applied to it. If a taproot tweak is specified, this corresponds to the
taproot key that can be put into the on-chain output.
*/
bytes combined_key = 2;
/*
The raw combined public key (in the 32-byte x-only format) before any tweaks
are applied to it. If a taproot tweak is specified, this corresponds to the
internal key that needs to be put into the witness if the script spend path
is used.
*/
bytes taproot_internal_key = 3;
/*
The two public nonces the local signer uses, combined into a single value
of 66 bytes. Can be split into the two 33-byte points to get the individual
nonces.
*/
bytes local_public_nonces = 4;
/*
Indicates whether all nonces required to start the signing process are known
now.
*/
bool have_all_nonces = 5;
/*
The version of the MuSig2 BIP that was used to create the session.
*/
MuSig2Version version = 6;
}
message MuSig2RegisterNoncesRequest {
/*
The unique ID of the signing session those nonces should be registered with.
*/
bytes session_id = 1;
/*
A list of all public nonces of other signing participants that should be
registered.
*/
repeated bytes other_signer_public_nonces = 3;
}
message MuSig2RegisterNoncesResponse {
/*
Indicates whether all nonces required to start the signing process are known
now.
*/
bool have_all_nonces = 1;
}
message MuSig2SignRequest {
/*
The unique ID of the signing session to use for signing.
*/
bytes session_id = 1;
/*
The 32-byte SHA256 digest of the message to sign.
*/
bytes message_digest = 2;
/*
Cleanup indicates that after signing, the session state can be cleaned up,
since another participant is going to be responsible for combining the
partial signatures.
*/
bool cleanup = 3;
}
message MuSig2SignResponse {
/*
The partial signature created by the local signer.
*/
bytes local_partial_signature = 1;
}
message MuSig2CombineSigRequest {
/*
The unique ID of the signing session to combine the signatures for.
*/
bytes session_id = 1;
/*
The list of all other participants' partial signatures to add to the current
session.
*/
repeated bytes other_partial_signatures = 2;
}
message MuSig2CombineSigResponse {
/*
Indicates whether all partial signatures required to create a final, full
signature are known yet. If this is true, then the final_signature field is
set, otherwise it is empty.
*/
bool have_all_signatures = 1;
/*
The final, full signature that is valid for the combined public key.
*/
bytes final_signature = 2;
}
message MuSig2CleanupRequest {
/*
The unique ID of the signing session that should be removed/cleaned up.
*/
bytes session_id = 1;
}
message MuSig2CleanupResponse {
}

1568
proto/others/walletkit.proto Normal file

File diff suppressed because it is too large Load diff

View file

@ -119,12 +119,23 @@ message ClosedChannel {
string channel_id = 1; string channel_id = 1;
int64 capacity = 2; int64 capacity = 2;
int64 closed_height =4; int64 closed_height =4;
int64 close_tx_timestamp = 5;
} }
message GraphPoint { message GraphPoint {
int64 x = 1; int64 x = 1;
int64 y = 2; int64 y = 2;
} }
enum OperationType {
CHAIN_OP = 0;
INVOICE_OP = 1;
}
message RootOperation {
OperationType op_type = 1;
string op_id = 2;
int64 amount = 3;
int64 created_at_unix = 4;
}
message LndNodeMetrics { message LndNodeMetrics {
repeated GraphPoint chain_balance = 1; repeated GraphPoint chain_balance = 1;
@ -138,6 +149,7 @@ message LndNodeMetrics {
repeated ClosedChannel closed_channels = 9; repeated ClosedChannel closed_channels = 9;
int64 forwarding_events = 11; int64 forwarding_events = 11;
int64 forwarding_fees = 12; int64 forwarding_fees = 12;
repeated RootOperation root_ops = 13;
} }
message LndMetrics { message LndMetrics {

View file

@ -19,6 +19,7 @@ import { HtlcEvent_EventType } from '../../../proto/lnd/router.js';
import { LiquidityProvider, LiquidityRequest } from '../main/liquidityProvider.js'; import { LiquidityProvider, LiquidityRequest } from '../main/liquidityProvider.js';
import { Utils } from '../helpers/utilsWrapper.js'; import { Utils } from '../helpers/utilsWrapper.js';
import { TxPointSettings } from '../storage/stateBundler.js'; import { TxPointSettings } from '../storage/stateBundler.js';
import { WalletKitClient } from '../../../proto/lnd/walletkit.client.js';
const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline }) const DeadLineMetadata = (deadline = 10 * 1000) => ({ deadline: Date.now() + deadline })
const deadLndRetrySeconds = 5 const deadLndRetrySeconds = 5
type TxActionOptions = { useProvider: boolean, from: 'user' | 'system' } type TxActionOptions = { useProvider: boolean, from: 'user' | 'system' }
@ -27,6 +28,7 @@ export default class {
invoices: InvoicesClient invoices: InvoicesClient
router: RouterClient router: RouterClient
chainNotifier: ChainNotifierClient chainNotifier: ChainNotifierClient
walletKit: WalletKitClient
settings: LndSettings settings: LndSettings
ready = false ready = false
latestKnownBlockHeigh = 0 latestKnownBlockHeigh = 0
@ -67,6 +69,7 @@ export default class {
this.invoices = new InvoicesClient(transport) this.invoices = new InvoicesClient(transport)
this.router = new RouterClient(transport) this.router = new RouterClient(transport)
this.chainNotifier = new ChainNotifierClient(transport) this.chainNotifier = new ChainNotifierClient(transport)
this.walletKit = new WalletKitClient(transport)
this.liquidProvider = liquidProvider this.liquidProvider = liquidProvider
} }
@ -507,6 +510,11 @@ export default class {
} }
async GetTx(txid: string) {
const res = await this.walletKit.getTransaction({ txid }, DeadLineMetadata())
return res.response
}
async AddPeer(pub: string, host: string, port: number) { async AddPeer(pub: string, host: string, port: number) {
const res = await this.lightning.connectPeer({ const res = await this.lightning.connectPeer({
addr: { addr: {

View file

@ -148,7 +148,10 @@ export default class {
return this.storage.StartTransaction(async tx => { return this.storage.StartTransaction(async tx => {
const { blockHeight } = await this.lnd.GetInfo() const { blockHeight } = await this.lnd.GetInfo()
const userAddress = await this.storage.paymentStorage.GetAddressOwner(address, tx) const userAddress = await this.storage.paymentStorage.GetAddressOwner(address, tx)
if (!userAddress) { return } if (!userAddress) {
await this.metricsManager.AddRootAddressPaid(address, txOutput, amount)
return
}
const internal = used === 'internal' const internal = used === 'internal'
let log = getLogger({}) let log = getLogger({})
if (!userAddress.linkedApplication) { if (!userAddress.linkedApplication) {
@ -188,7 +191,10 @@ export default class {
return this.storage.StartTransaction(async tx => { return this.storage.StartTransaction(async tx => {
let log = getLogger({}) let log = getLogger({})
const userInvoice = await this.storage.paymentStorage.GetInvoiceOwner(paymentRequest, tx) const userInvoice = await this.storage.paymentStorage.GetInvoiceOwner(paymentRequest, tx)
if (!userInvoice) { return } if (!userInvoice) {
await this.metricsManager.AddRootInvoicePaid(paymentRequest, amount)
return
}
const internal = used === 'internal' const internal = used === 'internal'
if (userInvoice.paid_at_unix > 0 && internal) { log("cannot pay internally, invoice already paid"); return } if (userInvoice.paid_at_unix > 0 && internal) { log("cannot pay internally, invoice already paid"); return }
if (userInvoice.paid_at_unix > 0 && !internal && userInvoice.paidByLnd) { log("invoice already paid by lnd"); return } if (userInvoice.paid_at_unix > 0 && !internal && userInvoice.paidByLnd) { log("invoice already paid by lnd"); return }

View file

@ -9,6 +9,8 @@ import LND from '../lnd/lnd.js'
import HtlcTracker from './htlcTracker.js' import HtlcTracker from './htlcTracker.js'
const maxEvents = 100_000 const maxEvents = 100_000
export default class Handler { export default class Handler {
storage: Storage storage: Storage
lnd: LND lnd: LND
htlcTracker: HtlcTracker htlcTracker: HtlcTracker
@ -215,10 +217,17 @@ export default class Handler {
async GetLndMetrics(req: Types.LndMetricsRequest): Promise<Types.LndMetrics> { async GetLndMetrics(req: Types.LndMetricsRequest): Promise<Types.LndMetrics> {
const { openChannels, totalActive, totalInactive } = await this.GetChannelsInfo() const [chansInfo, pendingChansInfo, closedChansInfo, routing, rootOps] = await Promise.all([
const { totalPendingOpen, totalPendingClose } = await this.GetPendingChannelsInfo() this.GetChannelsInfo(),
const { channels: closedChannels } = await this.lnd.ListClosedChannels() this.GetPendingChannelsInfo(),
const rawRouting = await this.storage.metricsStorage.GetChannelRouting({ from: req.from_unix, to: req.to_unix }) this.lnd.ListClosedChannels(),
this.storage.metricsStorage.GetChannelRouting({ from: req.from_unix, to: req.to_unix }),
this.storage.metricsStorage.GetRootOperations({ from: req.from_unix, to: req.to_unix })
])
const { openChannels, totalActive, totalInactive } = chansInfo
const { totalPendingOpen, totalPendingClose } = pendingChansInfo
const { channels: closedChannels } = closedChansInfo
const rawRouting = routing
let totalEvents = 0 let totalEvents = 0
let totalFees = 0 let totalFees = 0
rawRouting.forEach(r => { rawRouting.forEach(r => {
@ -242,7 +251,10 @@ export default class Handler {
externalBalance.push({ x: e.block_height, y: e.external_balance }) externalBalance.push({ x: e.block_height, y: e.external_balance })
} }
}) })
const closed = await Promise.all(closedChannels.map(async c => {
const tx = await this.lnd.GetTx(c.closingTxHash)
return { capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight, close_tx_timestamp: Number(tx.timeStamp) }
}))
return { return {
nodes: [{ nodes: [{
chain_balance: chainBalance, chain_balance: chainBalance,
@ -252,11 +264,28 @@ export default class Handler {
pending_channels: totalPendingOpen, pending_channels: totalPendingOpen,
offline_channels: totalInactive, offline_channels: totalInactive,
online_channels: totalActive, online_channels: totalActive,
closed_channels: closedChannels.map(c => ({ capacity: Number(c.capacity), channel_id: c.chanId, closed_height: c.closeHeight })), closed_channels: closed,
open_channels: openChannels.map(c => ({ channel_point: c.channelPoint, active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance), label: c.peerAlias })), open_channels: openChannels.map(c => ({ channel_point: c.channelPoint, active: c.active, capacity: Number(c.capacity), channel_id: c.chanId, lifetime: Number(c.lifetime), local_balance: Number(c.localBalance), remote_balance: Number(c.remoteBalance), label: c.peerAlias })),
forwarding_events: totalEvents, forwarding_events: totalEvents,
forwarding_fees: totalFees forwarding_fees: totalFees,
root_ops: rootOps.map(r => ({ amount: r.operation_amount, created_at_unix: r.created_at.getTime(), op_id: r.operation_identifier, op_type: mapRootOpType(r.operation_type) })),
}], }],
} }
} }
async AddRootAddressPaid(address: string, txOutput: { hash: string; index: number }, amount: number) {
await this.storage.metricsStorage.AddRootOperation("chain", `${address}:${txOutput.hash}:${txOutput.index}`, amount)
}
async AddRootInvoicePaid(paymentRequest: string, amount: number) {
await this.storage.metricsStorage.AddRootOperation("invoice", paymentRequest, amount)
}
}
const mapRootOpType = (opType: string): Types.OperationType => {
switch (opType) {
case "chain": return Types.OperationType.CHAIN_OP
case "invoice": return Types.OperationType.INVOICE_OP
default: throw new Error("Unknown operation type")
}
} }

View file

@ -0,0 +1,22 @@
import { Entity, PrimaryGeneratedColumn, Column, Index, Check, CreateDateColumn, UpdateDateColumn } from "typeorm"
@Entity()
export class RootOperation {
@PrimaryGeneratedColumn()
serial_id: number
@Column()
operation_type: string
@Column()
operation_amount: number
@Column()
operation_identifier: string
@CreateDateColumn()
created_at: Date
@UpdateDateColumn()
updated_at: Date
}

View file

@ -5,8 +5,10 @@ import TransactionsQueue, { TX } from "./transactionsQueue.js";
import { StorageSettings } from "./index.js"; import { StorageSettings } from "./index.js";
import { newMetricsDb } from "./db.js"; import { newMetricsDb } from "./db.js";
import { ChannelRouting } from "./entity/ChannelRouting.js"; import { ChannelRouting } from "./entity/ChannelRouting.js";
import { RootOperation } from "./entity/RootOperation.js";
export default class { export default class {
DB: DataSource | EntityManager DB: DataSource | EntityManager
settings: StorageSettings settings: StorageSettings
txQueue: TransactionsQueue txQueue: TransactionsQueue
@ -98,6 +100,16 @@ export default class {
await repo.update(existing.serial_id, { latest_index_offset: event.latest_index_offset }) await repo.update(existing.serial_id, { latest_index_offset: event.latest_index_offset })
} }
} }
async AddRootOperation(opType: string, id: string, amount: number, entityManager = this.DB) {
const newOp = entityManager.getRepository(RootOperation).create({ operation_type: opType, operation_amount: amount, operation_identifier: id })
return this.txQueue.PushToQueue<RootOperation>({ exec: async db => db.getRepository(RootOperation).save(newOp), dbTx: false })
}
async GetRootOperations({ from, to }: { from?: number, to?: number }, entityManager = this.DB) {
const q = getTimeQuery({ from, to })
return entityManager.getRepository(RootOperation).find(q)
}
} }
const getTimeQuery = ({ from, to }: { from?: number, to?: number }): FindManyOptions<{ created_at: Date }> => { const getTimeQuery = ({ from, to }: { from?: number, to?: number }): FindManyOptions<{ created_at: Date }> => {