hodl-lnd_grpc 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,332 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: lnd.proto for package 'lnrpc'
3
+
4
+ require 'grpc'
5
+ require 'lnd_grpc_pb'
6
+
7
+ module Lnrpc
8
+ module WalletUnlocker
9
+ # *
10
+ # Comments in this file will be directly parsed into the API
11
+ # Documentation as descriptions of the associated method, message, or field.
12
+ # These descriptions should go right above the definition of the object, and
13
+ # can be in either block or /// comment format.
14
+ #
15
+ # One edge case exists where a // comment followed by a /// comment in the
16
+ # next line will cause the description not to show up in the documentation. In
17
+ # that instance, simply separate the two comments with a blank line.
18
+ #
19
+ # An RPC method can be matched to an lncli command by placing a line in the
20
+ # beginning of the description in exactly the following format:
21
+ # lncli: `methodname`
22
+ #
23
+ # Failure to specify the exact name of the command will cause documentation
24
+ # generation to fail.
25
+ #
26
+ # More information on how exactly the gRPC documentation is generated from
27
+ # this proto file can be found here:
28
+ # https://github.com/lightninglabs/lightning-api
29
+ #
30
+ # The WalletUnlocker service is used to set up a wallet password for
31
+ # lnd at first startup, and unlock a previously set up wallet.
32
+ class Service
33
+
34
+ include GRPC::GenericService
35
+
36
+ self.marshal_class_method = :encode
37
+ self.unmarshal_class_method = :decode
38
+ self.service_name = 'lnrpc.WalletUnlocker'
39
+
40
+ # *
41
+ # GenSeed is the first method that should be used to instantiate a new lnd
42
+ # instance. This method allows a caller to generate a new aezeed cipher seed
43
+ # given an optional passphrase. If provided, the passphrase will be necessary
44
+ # to decrypt the cipherseed to expose the internal wallet seed.
45
+ #
46
+ # Once the cipherseed is obtained and verified by the user, the InitWallet
47
+ # method should be used to commit the newly generated seed, and create the
48
+ # wallet.
49
+ rpc :GenSeed, GenSeedRequest, GenSeedResponse
50
+ # *
51
+ # InitWallet is used when lnd is starting up for the first time to fully
52
+ # initialize the daemon and its internal wallet. At the very least a wallet
53
+ # password must be provided. This will be used to encrypt sensitive material
54
+ # on disk.
55
+ #
56
+ # In the case of a recovery scenario, the user can also specify their aezeed
57
+ # mnemonic and passphrase. If set, then the daemon will use this prior state
58
+ # to initialize its internal wallet.
59
+ #
60
+ # Alternatively, this can be used along with the GenSeed RPC to obtain a
61
+ # seed, then present it to the user. Once it has been verified by the user,
62
+ # the seed can be fed into this RPC in order to commit the new wallet.
63
+ rpc :InitWallet, InitWalletRequest, InitWalletResponse
64
+ # * lncli: `unlock`
65
+ # UnlockWallet is used at startup of lnd to provide a password to unlock
66
+ # the wallet database.
67
+ rpc :UnlockWallet, UnlockWalletRequest, UnlockWalletResponse
68
+ # * lncli: `changepassword`
69
+ # ChangePassword changes the password of the encrypted wallet. This will
70
+ # automatically unlock the wallet database if successful.
71
+ rpc :ChangePassword, ChangePasswordRequest, ChangePasswordResponse
72
+ end
73
+
74
+ Stub = Service.rpc_stub_class
75
+ end
76
+ module Lightning
77
+ class Service
78
+
79
+ include GRPC::GenericService
80
+
81
+ self.marshal_class_method = :encode
82
+ self.unmarshal_class_method = :decode
83
+ self.service_name = 'lnrpc.Lightning'
84
+
85
+ # * lncli: `walletbalance`
86
+ # WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
87
+ # confirmed unspent outputs and all unconfirmed unspent outputs under control
88
+ # of the wallet.
89
+ rpc :WalletBalance, WalletBalanceRequest, WalletBalanceResponse
90
+ # * lncli: `channelbalance`
91
+ # ChannelBalance returns the total funds available across all open channels
92
+ # in satoshis.
93
+ rpc :ChannelBalance, ChannelBalanceRequest, ChannelBalanceResponse
94
+ # * lncli: `listchaintxns`
95
+ # GetTransactions returns a list describing all the known transactions
96
+ # relevant to the wallet.
97
+ rpc :GetTransactions, GetTransactionsRequest, TransactionDetails
98
+ # * lncli: `sendcoins`
99
+ # SendCoins executes a request to send coins to a particular address. Unlike
100
+ # SendMany, this RPC call only allows creating a single output at a time. If
101
+ # neither target_conf, or sat_per_byte are set, then the internal wallet will
102
+ # consult its fee model to determine a fee for the default confirmation
103
+ # target.
104
+ rpc :SendCoins, SendCoinsRequest, SendCoinsResponse
105
+ # * lncli: `listunspent`
106
+ # ListUnspent returns a list of all utxos spendable by the wallet with a
107
+ # number of confirmations between the specified minimum and maximum.
108
+ rpc :ListUnspent, ListUnspentRequest, ListUnspentResponse
109
+ # *
110
+ # SubscribeTransactions creates a uni-directional stream from the server to
111
+ # the client in which any newly discovered transactions relevant to the
112
+ # wallet are sent over.
113
+ rpc :SubscribeTransactions, GetTransactionsRequest, stream(Transaction)
114
+ # * lncli: `sendmany`
115
+ # SendMany handles a request for a transaction that creates multiple specified
116
+ # outputs in parallel. If neither target_conf, or sat_per_byte are set, then
117
+ # the internal wallet will consult its fee model to determine a fee for the
118
+ # default confirmation target.
119
+ rpc :SendMany, SendManyRequest, SendManyResponse
120
+ # * lncli: `newaddress`
121
+ # NewAddress creates a new address under control of the local wallet.
122
+ rpc :NewAddress, NewAddressRequest, NewAddressResponse
123
+ # * lncli: `signmessage`
124
+ # SignMessage signs a message with this node's private key. The returned
125
+ # signature string is `zbase32` encoded and pubkey recoverable, meaning that
126
+ # only the message digest and signature are needed for verification.
127
+ rpc :SignMessage, SignMessageRequest, SignMessageResponse
128
+ # * lncli: `verifymessage`
129
+ # VerifyMessage verifies a signature over a msg. The signature must be
130
+ # zbase32 encoded and signed by an active node in the resident node's
131
+ # channel database. In addition to returning the validity of the signature,
132
+ # VerifyMessage also returns the recovered pubkey from the signature.
133
+ rpc :VerifyMessage, VerifyMessageRequest, VerifyMessageResponse
134
+ # * lncli: `connect`
135
+ # ConnectPeer attempts to establish a connection to a remote peer. This is at
136
+ # the networking level, and is used for communication between nodes. This is
137
+ # distinct from establishing a channel with a peer.
138
+ rpc :ConnectPeer, ConnectPeerRequest, ConnectPeerResponse
139
+ # * lncli: `disconnect`
140
+ # DisconnectPeer attempts to disconnect one peer from another identified by a
141
+ # given pubKey. In the case that we currently have a pending or active channel
142
+ # with the target peer, then this action will be not be allowed.
143
+ rpc :DisconnectPeer, DisconnectPeerRequest, DisconnectPeerResponse
144
+ # * lncli: `listpeers`
145
+ # ListPeers returns a verbose listing of all currently active peers.
146
+ rpc :ListPeers, ListPeersRequest, ListPeersResponse
147
+ # * lncli: `getinfo`
148
+ # GetInfo returns general information concerning the lightning node including
149
+ # it's identity pubkey, alias, the chains it is connected to, and information
150
+ # concerning the number of open+pending channels.
151
+ rpc :GetInfo, GetInfoRequest, GetInfoResponse
152
+ # TODO(roasbeef): merge with below with bool?
153
+ #
154
+ # * lncli: `pendingchannels`
155
+ # PendingChannels returns a list of all the channels that are currently
156
+ # considered "pending". A channel is pending if it has finished the funding
157
+ # workflow and is waiting for confirmations for the funding txn, or is in the
158
+ # process of closure, either initiated cooperatively or non-cooperatively.
159
+ rpc :PendingChannels, PendingChannelsRequest, PendingChannelsResponse
160
+ # * lncli: `listchannels`
161
+ # ListChannels returns a description of all the open channels that this node
162
+ # is a participant in.
163
+ rpc :ListChannels, ListChannelsRequest, ListChannelsResponse
164
+ # * lncli: `closedchannels`
165
+ # ClosedChannels returns a description of all the closed channels that
166
+ # this node was a participant in.
167
+ rpc :ClosedChannels, ClosedChannelsRequest, ClosedChannelsResponse
168
+ # *
169
+ # OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
170
+ # call is meant to be consumed by clients to the REST proxy. As with all
171
+ # other sync calls, all byte slices are intended to be populated as hex
172
+ # encoded strings.
173
+ rpc :OpenChannelSync, OpenChannelRequest, ChannelPoint
174
+ # * lncli: `openchannel`
175
+ # OpenChannel attempts to open a singly funded channel specified in the
176
+ # request to a remote peer. Users are able to specify a target number of
177
+ # blocks that the funding transaction should be confirmed in, or a manual fee
178
+ # rate to us for the funding transaction. If neither are specified, then a
179
+ # lax block confirmation target is used.
180
+ rpc :OpenChannel, OpenChannelRequest, stream(OpenStatusUpdate)
181
+ # * lncli: `closechannel`
182
+ # CloseChannel attempts to close an active channel identified by its channel
183
+ # outpoint (ChannelPoint). The actions of this method can additionally be
184
+ # augmented to attempt a force close after a timeout period in the case of an
185
+ # inactive peer. If a non-force close (cooperative closure) is requested,
186
+ # then the user can specify either a target number of blocks until the
187
+ # closure transaction is confirmed, or a manual fee rate. If neither are
188
+ # specified, then a default lax, block confirmation target is used.
189
+ rpc :CloseChannel, CloseChannelRequest, stream(CloseStatusUpdate)
190
+ # * lncli: `abandonchannel`
191
+ # AbandonChannel removes all channel state from the database except for a
192
+ # close summary. This method can be used to get rid of permanently unusable
193
+ # channels due to bugs fixed in newer versions of lnd. Only available
194
+ # when in debug builds of lnd.
195
+ rpc :AbandonChannel, AbandonChannelRequest, AbandonChannelResponse
196
+ # * lncli: `sendpayment`
197
+ # SendPayment dispatches a bi-directional streaming RPC for sending payments
198
+ # through the Lightning Network. A single RPC invocation creates a persistent
199
+ # bi-directional stream allowing clients to rapidly send payments through the
200
+ # Lightning Network with a single persistent connection.
201
+ rpc :SendPayment, stream(SendRequest), stream(SendResponse)
202
+ # *
203
+ # SendPaymentSync is the synchronous non-streaming version of SendPayment.
204
+ # This RPC is intended to be consumed by clients of the REST proxy.
205
+ # Additionally, this RPC expects the destination's public key and the payment
206
+ # hash (if any) to be encoded as hex strings.
207
+ rpc :SendPaymentSync, SendRequest, SendResponse
208
+ # * lncli: `sendtoroute`
209
+ # SendToRoute is a bi-directional streaming RPC for sending payment through
210
+ # the Lightning Network. This method differs from SendPayment in that it
211
+ # allows users to specify a full route manually. This can be used for things
212
+ # like rebalancing, and atomic swaps.
213
+ rpc :SendToRoute, stream(SendToRouteRequest), stream(SendResponse)
214
+ # *
215
+ # SendToRouteSync is a synchronous version of SendToRoute. It Will block
216
+ # until the payment either fails or succeeds.
217
+ rpc :SendToRouteSync, SendToRouteRequest, SendResponse
218
+ # * lncli: `addinvoice`
219
+ # AddInvoice attempts to add a new invoice to the invoice database. Any
220
+ # duplicated invoices are rejected, therefore all invoices *must* have a
221
+ # unique payment preimage.
222
+ rpc :AddInvoice, Invoice, AddInvoiceResponse
223
+ # * lncli: `listinvoices`
224
+ # ListInvoices returns a list of all the invoices currently stored within the
225
+ # database. Any active debug invoices are ignored. It has full support for
226
+ # paginated responses, allowing users to query for specific invoices through
227
+ # their add_index. This can be done by using either the first_index_offset or
228
+ # last_index_offset fields included in the response as the index_offset of the
229
+ # next request. The reversed flag is set by default in order to paginate
230
+ # backwards. If you wish to paginate forwards, you must explicitly set the
231
+ # flag to false. If none of the parameters are specified, then the last 100
232
+ # invoices will be returned.
233
+ rpc :ListInvoices, ListInvoiceRequest, ListInvoiceResponse
234
+ # * lncli: `lookupinvoice`
235
+ # LookupInvoice attempts to look up an invoice according to its payment hash.
236
+ # The passed payment hash *must* be exactly 32 bytes, if not, an error is
237
+ # returned.
238
+ rpc :LookupInvoice, PaymentHash, Invoice
239
+ # *
240
+ # SubscribeInvoices returns a uni-directional stream (server -> client) for
241
+ # notifying the client of newly added/settled invoices. The caller can
242
+ # optionally specify the add_index and/or the settle_index. If the add_index
243
+ # is specified, then we'll first start by sending add invoice events for all
244
+ # invoices with an add_index greater than the specified value. If the
245
+ # settle_index is specified, the next, we'll send out all settle events for
246
+ # invoices with a settle_index greater than the specified value. One or both
247
+ # of these fields can be set. If no fields are set, then we'll only send out
248
+ # the latest add/settle events.
249
+ rpc :SubscribeInvoices, InvoiceSubscription, stream(Invoice)
250
+ # * lncli: `decodepayreq`
251
+ # DecodePayReq takes an encoded payment request string and attempts to decode
252
+ # it, returning a full description of the conditions encoded within the
253
+ # payment request.
254
+ rpc :DecodePayReq, PayReqString, PayReq
255
+ # * lncli: `listpayments`
256
+ # ListPayments returns a list of all outgoing payments.
257
+ rpc :ListPayments, ListPaymentsRequest, ListPaymentsResponse
258
+ # *
259
+ # DeleteAllPayments deletes all outgoing payments from DB.
260
+ rpc :DeleteAllPayments, DeleteAllPaymentsRequest, DeleteAllPaymentsResponse
261
+ # * lncli: `describegraph`
262
+ # DescribeGraph returns a description of the latest graph state from the
263
+ # point of view of the node. The graph information is partitioned into two
264
+ # components: all the nodes/vertexes, and all the edges that connect the
265
+ # vertexes themselves. As this is a directed graph, the edges also contain
266
+ # the node directional specific routing policy which includes: the time lock
267
+ # delta, fee information, etc.
268
+ rpc :DescribeGraph, ChannelGraphRequest, ChannelGraph
269
+ # * lncli: `getchaninfo`
270
+ # GetChanInfo returns the latest authenticated network announcement for the
271
+ # given channel identified by its channel ID: an 8-byte integer which
272
+ # uniquely identifies the location of transaction's funding output within the
273
+ # blockchain.
274
+ rpc :GetChanInfo, ChanInfoRequest, ChannelEdge
275
+ # * lncli: `getnodeinfo`
276
+ # GetNodeInfo returns the latest advertised, aggregated, and authenticated
277
+ # channel information for the specified node identified by its public key.
278
+ rpc :GetNodeInfo, NodeInfoRequest, NodeInfo
279
+ # * lncli: `queryroutes`
280
+ # QueryRoutes attempts to query the daemon's Channel Router for a possible
281
+ # route to a target destination capable of carrying a specific amount of
282
+ # satoshis. The retuned route contains the full details required to craft and
283
+ # send an HTLC, also including the necessary information that should be
284
+ # present within the Sphinx packet encapsulated within the HTLC.
285
+ rpc :QueryRoutes, QueryRoutesRequest, QueryRoutesResponse
286
+ # * lncli: `getnetworkinfo`
287
+ # GetNetworkInfo returns some basic stats about the known channel graph from
288
+ # the point of view of the node.
289
+ rpc :GetNetworkInfo, NetworkInfoRequest, NetworkInfo
290
+ # * lncli: `stop`
291
+ # StopDaemon will send a shutdown request to the interrupt handler, triggering
292
+ # a graceful shutdown of the daemon.
293
+ rpc :StopDaemon, StopRequest, StopResponse
294
+ # *
295
+ # SubscribeChannelGraph launches a streaming RPC that allows the caller to
296
+ # receive notifications upon any changes to the channel graph topology from
297
+ # the point of view of the responding node. Events notified include: new
298
+ # nodes coming online, nodes updating their authenticated attributes, new
299
+ # channels being advertised, updates in the routing policy for a directional
300
+ # channel edge, and when channels are closed on-chain.
301
+ rpc :SubscribeChannelGraph, GraphTopologySubscription, stream(GraphTopologyUpdate)
302
+ # * lncli: `debuglevel`
303
+ # DebugLevel allows a caller to programmatically set the logging verbosity of
304
+ # lnd. The logging can be targeted according to a coarse daemon-wide logging
305
+ # level, or in a granular fashion to specify the logging for a target
306
+ # sub-system.
307
+ rpc :DebugLevel, DebugLevelRequest, DebugLevelResponse
308
+ # * lncli: `feereport`
309
+ # FeeReport allows the caller to obtain a report detailing the current fee
310
+ # schedule enforced by the node globally for each channel.
311
+ rpc :FeeReport, FeeReportRequest, FeeReportResponse
312
+ # * lncli: `updatechanpolicy`
313
+ # UpdateChannelPolicy allows the caller to update the fee schedule and
314
+ # channel policies for all channels globally, or a particular channel.
315
+ rpc :UpdateChannelPolicy, PolicyUpdateRequest, PolicyUpdateResponse
316
+ # * lncli: `fwdinghistory`
317
+ # ForwardingHistory allows the caller to query the htlcswitch for a record of
318
+ # all HTLC's forwarded within the target time range, and integer offset
319
+ # within that time range. If no time-range is specified, then the first chunk
320
+ # of the past 24 hrs of forwarding history are returned.
321
+ #
322
+ # A list of forwarding events are returned. The size of each forwarding event
323
+ # is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
324
+ # As a result each message can only contain 50k entries. Each response has
325
+ # the index offset of the last entry. The index offset can be provided to the
326
+ # request to allow the caller to skip a series of records.
327
+ rpc :ForwardingHistory, ForwardingHistoryRequest, ForwardingHistoryResponse
328
+ end
329
+
330
+ Stub = Service.rpc_stub_class
331
+ end
332
+ end
@@ -0,0 +1,5 @@
1
+ module Hodl
2
+ module LndGrpc
3
+ VERSION = "0.2.0"
4
+ end
5
+ end
@@ -0,0 +1,2061 @@
1
+ syntax = "proto3";
2
+
3
+ import "google/api/annotations.proto";
4
+
5
+ package lnrpc;
6
+
7
+ option go_package = "github.com/lightningnetwork/lnd/lnrpc";
8
+
9
+ /**
10
+ * Comments in this file will be directly parsed into the API
11
+ * Documentation as descriptions of the associated method, message, or field.
12
+ * These descriptions should go right above the definition of the object, and
13
+ * can be in either block or /// comment format.
14
+ *
15
+ * One edge case exists where a // comment followed by a /// comment in the
16
+ * next line will cause the description not to show up in the documentation. In
17
+ * that instance, simply separate the two comments with a blank line.
18
+ *
19
+ * An RPC method can be matched to an lncli command by placing a line in the
20
+ * beginning of the description in exactly the following format:
21
+ * lncli: `methodname`
22
+ *
23
+ * Failure to specify the exact name of the command will cause documentation
24
+ * generation to fail.
25
+ *
26
+ * More information on how exactly the gRPC documentation is generated from
27
+ * this proto file can be found here:
28
+ * https://github.com/lightninglabs/lightning-api
29
+ */
30
+
31
+ // The WalletUnlocker service is used to set up a wallet password for
32
+ // lnd at first startup, and unlock a previously set up wallet.
33
+ service WalletUnlocker {
34
+ /**
35
+ GenSeed is the first method that should be used to instantiate a new lnd
36
+ instance. This method allows a caller to generate a new aezeed cipher seed
37
+ given an optional passphrase. If provided, the passphrase will be necessary
38
+ to decrypt the cipherseed to expose the internal wallet seed.
39
+
40
+ Once the cipherseed is obtained and verified by the user, the InitWallet
41
+ method should be used to commit the newly generated seed, and create the
42
+ wallet.
43
+ */
44
+ rpc GenSeed(GenSeedRequest) returns (GenSeedResponse) {
45
+ option (google.api.http) = {
46
+ get: "/v1/genseed"
47
+ };
48
+ }
49
+
50
+ /**
51
+ InitWallet is used when lnd is starting up for the first time to fully
52
+ initialize the daemon and its internal wallet. At the very least a wallet
53
+ password must be provided. This will be used to encrypt sensitive material
54
+ on disk.
55
+
56
+ In the case of a recovery scenario, the user can also specify their aezeed
57
+ mnemonic and passphrase. If set, then the daemon will use this prior state
58
+ to initialize its internal wallet.
59
+
60
+ Alternatively, this can be used along with the GenSeed RPC to obtain a
61
+ seed, then present it to the user. Once it has been verified by the user,
62
+ the seed can be fed into this RPC in order to commit the new wallet.
63
+ */
64
+ rpc InitWallet(InitWalletRequest) returns (InitWalletResponse) {
65
+ option (google.api.http) = {
66
+ post: "/v1/initwallet"
67
+ body: "*"
68
+ };
69
+ }
70
+
71
+ /** lncli: `unlock`
72
+ UnlockWallet is used at startup of lnd to provide a password to unlock
73
+ the wallet database.
74
+ */
75
+ rpc UnlockWallet(UnlockWalletRequest) returns (UnlockWalletResponse) {
76
+ option (google.api.http) = {
77
+ post: "/v1/unlockwallet"
78
+ body: "*"
79
+ };
80
+ }
81
+
82
+ /** lncli: `changepassword`
83
+ ChangePassword changes the password of the encrypted wallet. This will
84
+ automatically unlock the wallet database if successful.
85
+ */
86
+ rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse) {
87
+ option (google.api.http) = {
88
+ post: "/v1/changepassword"
89
+ body: "*"
90
+ };
91
+ }
92
+ }
93
+
94
+ message GenSeedRequest {
95
+ /**
96
+ aezeed_passphrase is an optional user provided passphrase that will be used
97
+ to encrypt the generated aezeed cipher seed.
98
+ */
99
+ bytes aezeed_passphrase = 1;
100
+
101
+ /**
102
+ seed_entropy is an optional 16-bytes generated via CSPRNG. If not
103
+ specified, then a fresh set of randomness will be used to create the seed.
104
+ */
105
+ bytes seed_entropy = 2;
106
+ }
107
+ message GenSeedResponse {
108
+ /**
109
+ cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
110
+ cipher seed obtained by the user. This field is optional, as if not
111
+ provided, then the daemon will generate a new cipher seed for the user.
112
+ Otherwise, then the daemon will attempt to recover the wallet state linked
113
+ to this cipher seed.
114
+ */
115
+ repeated string cipher_seed_mnemonic = 1;
116
+
117
+ /**
118
+ enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
119
+ cipher text before run through our mnemonic encoding scheme.
120
+ */
121
+ bytes enciphered_seed = 2;
122
+ }
123
+
124
+ message InitWalletRequest {
125
+ /**
126
+ wallet_password is the passphrase that should be used to encrypt the
127
+ wallet. This MUST be at least 8 chars in length. After creation, this
128
+ password is required to unlock the daemon.
129
+ */
130
+ bytes wallet_password = 1;
131
+
132
+ /**
133
+ cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
134
+ cipher seed obtained by the user. This may have been generated by the
135
+ GenSeed method, or be an existing seed.
136
+ */
137
+ repeated string cipher_seed_mnemonic = 2;
138
+
139
+ /**
140
+ aezeed_passphrase is an optional user provided passphrase that will be used
141
+ to encrypt the generated aezeed cipher seed.
142
+ */
143
+ bytes aezeed_passphrase = 3;
144
+
145
+ /**
146
+ recovery_window is an optional argument specifying the address lookahead
147
+ when restoring a wallet seed. The recovery window applies to each
148
+ invdividual branch of the BIP44 derivation paths. Supplying a recovery
149
+ window of zero indicates that no addresses should be recovered, such after
150
+ the first initialization of the wallet.
151
+ */
152
+ int32 recovery_window = 4;
153
+ }
154
+ message InitWalletResponse {
155
+ }
156
+
157
+ message UnlockWalletRequest {
158
+ /**
159
+ wallet_password should be the current valid passphrase for the daemon. This
160
+ will be required to decrypt on-disk material that the daemon requires to
161
+ function properly.
162
+ */
163
+ bytes wallet_password = 1;
164
+
165
+ /**
166
+ recovery_window is an optional argument specifying the address lookahead
167
+ when restoring a wallet seed. The recovery window applies to each
168
+ invdividual branch of the BIP44 derivation paths. Supplying a recovery
169
+ window of zero indicates that no addresses should be recovered, such after
170
+ the first initialization of the wallet.
171
+ */
172
+ int32 recovery_window = 2;
173
+ }
174
+ message UnlockWalletResponse {}
175
+
176
+ message ChangePasswordRequest {
177
+ /**
178
+ current_password should be the current valid passphrase used to unlock the
179
+ daemon.
180
+ */
181
+ bytes current_password = 1;
182
+
183
+ /**
184
+ new_password should be the new passphrase that will be needed to unlock the
185
+ daemon.
186
+ */
187
+ bytes new_password = 2;
188
+ }
189
+ message ChangePasswordResponse {}
190
+
191
+ service Lightning {
192
+ /** lncli: `walletbalance`
193
+ WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
194
+ confirmed unspent outputs and all unconfirmed unspent outputs under control
195
+ of the wallet.
196
+ */
197
+ rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) {
198
+ option (google.api.http) = {
199
+ get: "/v1/balance/blockchain"
200
+ };
201
+ }
202
+
203
+ /** lncli: `channelbalance`
204
+ ChannelBalance returns the total funds available across all open channels
205
+ in satoshis.
206
+ */
207
+ rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) {
208
+ option (google.api.http) = {
209
+ get: "/v1/balance/channels"
210
+ };
211
+ }
212
+
213
+ /** lncli: `listchaintxns`
214
+ GetTransactions returns a list describing all the known transactions
215
+ relevant to the wallet.
216
+ */
217
+ rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) {
218
+ option (google.api.http) = {
219
+ get: "/v1/transactions"
220
+ };
221
+ }
222
+
223
+ /** lncli: `sendcoins`
224
+ SendCoins executes a request to send coins to a particular address. Unlike
225
+ SendMany, this RPC call only allows creating a single output at a time. If
226
+ neither target_conf, or sat_per_byte are set, then the internal wallet will
227
+ consult its fee model to determine a fee for the default confirmation
228
+ target.
229
+ */
230
+ rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) {
231
+ option (google.api.http) = {
232
+ post: "/v1/transactions"
233
+ body: "*"
234
+ };
235
+ }
236
+
237
+ /** lncli: `listunspent`
238
+ ListUnspent returns a list of all utxos spendable by the wallet with a
239
+ number of confirmations between the specified minimum and maximum.
240
+ */
241
+ rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) {
242
+ option (google.api.http) = {
243
+ get: "/v1/utxos"
244
+ };
245
+ }
246
+
247
+ /**
248
+ SubscribeTransactions creates a uni-directional stream from the server to
249
+ the client in which any newly discovered transactions relevant to the
250
+ wallet are sent over.
251
+ */
252
+ rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction);
253
+
254
+ /** lncli: `sendmany`
255
+ SendMany handles a request for a transaction that creates multiple specified
256
+ outputs in parallel. If neither target_conf, or sat_per_byte are set, then
257
+ the internal wallet will consult its fee model to determine a fee for the
258
+ default confirmation target.
259
+ */
260
+ rpc SendMany (SendManyRequest) returns (SendManyResponse);
261
+
262
+ /** lncli: `newaddress`
263
+ NewAddress creates a new address under control of the local wallet.
264
+ */
265
+ rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) {
266
+ option (google.api.http) = {
267
+ get: "/v1/newaddress"
268
+ };
269
+ }
270
+
271
+ /** lncli: `signmessage`
272
+ SignMessage signs a message with this node's private key. The returned
273
+ signature string is `zbase32` encoded and pubkey recoverable, meaning that
274
+ only the message digest and signature are needed for verification.
275
+ */
276
+ rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) {
277
+ option (google.api.http) = {
278
+ post: "/v1/signmessage"
279
+ body: "*"
280
+ };
281
+ }
282
+
283
+ /** lncli: `verifymessage`
284
+ VerifyMessage verifies a signature over a msg. The signature must be
285
+ zbase32 encoded and signed by an active node in the resident node's
286
+ channel database. In addition to returning the validity of the signature,
287
+ VerifyMessage also returns the recovered pubkey from the signature.
288
+ */
289
+ rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) {
290
+ option (google.api.http) = {
291
+ post: "/v1/verifymessage"
292
+ body: "*"
293
+ };
294
+ }
295
+
296
+ /** lncli: `connect`
297
+ ConnectPeer attempts to establish a connection to a remote peer. This is at
298
+ the networking level, and is used for communication between nodes. This is
299
+ distinct from establishing a channel with a peer.
300
+ */
301
+ rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) {
302
+ option (google.api.http) = {
303
+ post: "/v1/peers"
304
+ body: "*"
305
+ };
306
+ }
307
+
308
+ /** lncli: `disconnect`
309
+ DisconnectPeer attempts to disconnect one peer from another identified by a
310
+ given pubKey. In the case that we currently have a pending or active channel
311
+ with the target peer, then this action will be not be allowed.
312
+ */
313
+ rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse) {
314
+ option (google.api.http) = {
315
+ delete: "/v1/peers/{pub_key}"
316
+ };
317
+ }
318
+
319
+ /** lncli: `listpeers`
320
+ ListPeers returns a verbose listing of all currently active peers.
321
+ */
322
+ rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) {
323
+ option (google.api.http) = {
324
+ get: "/v1/peers"
325
+ };
326
+ }
327
+
328
+ /** lncli: `getinfo`
329
+ GetInfo returns general information concerning the lightning node including
330
+ it's identity pubkey, alias, the chains it is connected to, and information
331
+ concerning the number of open+pending channels.
332
+ */
333
+ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {
334
+ option (google.api.http) = {
335
+ get: "/v1/getinfo"
336
+ };
337
+ }
338
+
339
+ // TODO(roasbeef): merge with below with bool?
340
+ /** lncli: `pendingchannels`
341
+ PendingChannels returns a list of all the channels that are currently
342
+ considered "pending". A channel is pending if it has finished the funding
343
+ workflow and is waiting for confirmations for the funding txn, or is in the
344
+ process of closure, either initiated cooperatively or non-cooperatively.
345
+ */
346
+ rpc PendingChannels (PendingChannelsRequest) returns (PendingChannelsResponse) {
347
+ option (google.api.http) = {
348
+ get: "/v1/channels/pending"
349
+ };
350
+ }
351
+
352
+ /** lncli: `listchannels`
353
+ ListChannels returns a description of all the open channels that this node
354
+ is a participant in.
355
+ */
356
+ rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) {
357
+ option (google.api.http) = {
358
+ get: "/v1/channels"
359
+ };
360
+ }
361
+
362
+ /** lncli: `closedchannels`
363
+ ClosedChannels returns a description of all the closed channels that
364
+ this node was a participant in.
365
+ */
366
+ rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse) {
367
+ option (google.api.http) = {
368
+ get: "/v1/channels/closed"
369
+ };
370
+ }
371
+
372
+
373
+ /**
374
+ OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
375
+ call is meant to be consumed by clients to the REST proxy. As with all
376
+ other sync calls, all byte slices are intended to be populated as hex
377
+ encoded strings.
378
+ */
379
+ rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) {
380
+ option (google.api.http) = {
381
+ post: "/v1/channels"
382
+ body: "*"
383
+ };
384
+ }
385
+
386
+ /** lncli: `openchannel`
387
+ OpenChannel attempts to open a singly funded channel specified in the
388
+ request to a remote peer. Users are able to specify a target number of
389
+ blocks that the funding transaction should be confirmed in, or a manual fee
390
+ rate to us for the funding transaction. If neither are specified, then a
391
+ lax block confirmation target is used.
392
+ */
393
+ rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
394
+
395
+ /** lncli: `closechannel`
396
+ CloseChannel attempts to close an active channel identified by its channel
397
+ outpoint (ChannelPoint). The actions of this method can additionally be
398
+ augmented to attempt a force close after a timeout period in the case of an
399
+ inactive peer. If a non-force close (cooperative closure) is requested,
400
+ then the user can specify either a target number of blocks until the
401
+ closure transaction is confirmed, or a manual fee rate. If neither are
402
+ specified, then a default lax, block confirmation target is used.
403
+ */
404
+ rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) {
405
+ option (google.api.http) = {
406
+ delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}"
407
+ };
408
+ }
409
+
410
+ /** lncli: `abandonchannel`
411
+ AbandonChannel removes all channel state from the database except for a
412
+ close summary. This method can be used to get rid of permanently unusable
413
+ channels due to bugs fixed in newer versions of lnd. Only available
414
+ when in debug builds of lnd.
415
+ */
416
+ rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse) {
417
+ option (google.api.http) = {
418
+ delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}"
419
+ };
420
+ }
421
+
422
+
423
+ /** lncli: `sendpayment`
424
+ SendPayment dispatches a bi-directional streaming RPC for sending payments
425
+ through the Lightning Network. A single RPC invocation creates a persistent
426
+ bi-directional stream allowing clients to rapidly send payments through the
427
+ Lightning Network with a single persistent connection.
428
+ */
429
+ rpc SendPayment (stream SendRequest) returns (stream SendResponse);
430
+
431
+ /**
432
+ SendPaymentSync is the synchronous non-streaming version of SendPayment.
433
+ This RPC is intended to be consumed by clients of the REST proxy.
434
+ Additionally, this RPC expects the destination's public key and the payment
435
+ hash (if any) to be encoded as hex strings.
436
+ */
437
+ rpc SendPaymentSync (SendRequest) returns (SendResponse) {
438
+ option (google.api.http) = {
439
+ post: "/v1/channels/transactions"
440
+ body: "*"
441
+ };
442
+ }
443
+
444
+ /** lncli: `sendtoroute`
445
+ SendToRoute is a bi-directional streaming RPC for sending payment through
446
+ the Lightning Network. This method differs from SendPayment in that it
447
+ allows users to specify a full route manually. This can be used for things
448
+ like rebalancing, and atomic swaps.
449
+ */
450
+ rpc SendToRoute(stream SendToRouteRequest) returns (stream SendResponse);
451
+
452
+ /**
453
+ SendToRouteSync is a synchronous version of SendToRoute. It Will block
454
+ until the payment either fails or succeeds.
455
+ */
456
+ rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) {
457
+ option (google.api.http) = {
458
+ post: "/v1/channels/transactions/route"
459
+ body: "*"
460
+ };
461
+ }
462
+
463
+ /** lncli: `addinvoice`
464
+ AddInvoice attempts to add a new invoice to the invoice database. Any
465
+ duplicated invoices are rejected, therefore all invoices *must* have a
466
+ unique payment preimage.
467
+ */
468
+ rpc AddInvoice (Invoice) returns (AddInvoiceResponse) {
469
+ option (google.api.http) = {
470
+ post: "/v1/invoices"
471
+ body: "*"
472
+ };
473
+ }
474
+
475
+ /** lncli: `listinvoices`
476
+ ListInvoices returns a list of all the invoices currently stored within the
477
+ database. Any active debug invoices are ignored. It has full support for
478
+ paginated responses, allowing users to query for specific invoices through
479
+ their add_index. This can be done by using either the first_index_offset or
480
+ last_index_offset fields included in the response as the index_offset of the
481
+ next request. The reversed flag is set by default in order to paginate
482
+ backwards. If you wish to paginate forwards, you must explicitly set the
483
+ flag to false. If none of the parameters are specified, then the last 100
484
+ invoices will be returned.
485
+ */
486
+ rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) {
487
+ option (google.api.http) = {
488
+ get: "/v1/invoices"
489
+ };
490
+ }
491
+
492
+ /** lncli: `lookupinvoice`
493
+ LookupInvoice attempts to look up an invoice according to its payment hash.
494
+ The passed payment hash *must* be exactly 32 bytes, if not, an error is
495
+ returned.
496
+ */
497
+ rpc LookupInvoice (PaymentHash) returns (Invoice) {
498
+ option (google.api.http) = {
499
+ get: "/v1/invoice/{r_hash_str}"
500
+ };
501
+ }
502
+
503
+ /**
504
+ SubscribeInvoices returns a uni-directional stream (server -> client) for
505
+ notifying the client of newly added/settled invoices. The caller can
506
+ optionally specify the add_index and/or the settle_index. If the add_index
507
+ is specified, then we'll first start by sending add invoice events for all
508
+ invoices with an add_index greater than the specified value. If the
509
+ settle_index is specified, the next, we'll send out all settle events for
510
+ invoices with a settle_index greater than the specified value. One or both
511
+ of these fields can be set. If no fields are set, then we'll only send out
512
+ the latest add/settle events.
513
+ */
514
+ rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) {
515
+ option (google.api.http) = {
516
+ get: "/v1/invoices/subscribe"
517
+ };
518
+ }
519
+
520
+ /** lncli: `decodepayreq`
521
+ DecodePayReq takes an encoded payment request string and attempts to decode
522
+ it, returning a full description of the conditions encoded within the
523
+ payment request.
524
+ */
525
+ rpc DecodePayReq (PayReqString) returns (PayReq) {
526
+ option (google.api.http) = {
527
+ get: "/v1/payreq/{pay_req}"
528
+ };
529
+ }
530
+
531
+ /** lncli: `listpayments`
532
+ ListPayments returns a list of all outgoing payments.
533
+ */
534
+ rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) {
535
+ option (google.api.http) = {
536
+ get: "/v1/payments"
537
+ };
538
+ };
539
+
540
+ /**
541
+ DeleteAllPayments deletes all outgoing payments from DB.
542
+ */
543
+ rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) {
544
+ option (google.api.http) = {
545
+ delete: "/v1/payments"
546
+ };
547
+ };
548
+
549
+ /** lncli: `describegraph`
550
+ DescribeGraph returns a description of the latest graph state from the
551
+ point of view of the node. The graph information is partitioned into two
552
+ components: all the nodes/vertexes, and all the edges that connect the
553
+ vertexes themselves. As this is a directed graph, the edges also contain
554
+ the node directional specific routing policy which includes: the time lock
555
+ delta, fee information, etc.
556
+ */
557
+ rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) {
558
+ option (google.api.http) = {
559
+ get: "/v1/graph"
560
+ };
561
+ }
562
+
563
+ /** lncli: `getchaninfo`
564
+ GetChanInfo returns the latest authenticated network announcement for the
565
+ given channel identified by its channel ID: an 8-byte integer which
566
+ uniquely identifies the location of transaction's funding output within the
567
+ blockchain.
568
+ */
569
+ rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) {
570
+ option (google.api.http) = {
571
+ get: "/v1/graph/edge/{chan_id}"
572
+ };
573
+ }
574
+
575
+ /** lncli: `getnodeinfo`
576
+ GetNodeInfo returns the latest advertised, aggregated, and authenticated
577
+ channel information for the specified node identified by its public key.
578
+ */
579
+ rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) {
580
+ option (google.api.http) = {
581
+ get: "/v1/graph/node/{pub_key}"
582
+ };
583
+ }
584
+
585
+ /** lncli: `queryroutes`
586
+ QueryRoutes attempts to query the daemon's Channel Router for a possible
587
+ route to a target destination capable of carrying a specific amount of
588
+ satoshis. The retuned route contains the full details required to craft and
589
+ send an HTLC, also including the necessary information that should be
590
+ present within the Sphinx packet encapsulated within the HTLC.
591
+ */
592
+ rpc QueryRoutes(QueryRoutesRequest) returns (QueryRoutesResponse) {
593
+ option (google.api.http) = {
594
+ get: "/v1/graph/routes/{pub_key}/{amt}"
595
+ };
596
+ }
597
+
598
+ /** lncli: `getnetworkinfo`
599
+ GetNetworkInfo returns some basic stats about the known channel graph from
600
+ the point of view of the node.
601
+ */
602
+ rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) {
603
+ option (google.api.http) = {
604
+ get: "/v1/graph/info"
605
+ };
606
+ }
607
+
608
+ /** lncli: `stop`
609
+ StopDaemon will send a shutdown request to the interrupt handler, triggering
610
+ a graceful shutdown of the daemon.
611
+ */
612
+ rpc StopDaemon(StopRequest) returns (StopResponse);
613
+
614
+ /**
615
+ SubscribeChannelGraph launches a streaming RPC that allows the caller to
616
+ receive notifications upon any changes to the channel graph topology from
617
+ the point of view of the responding node. Events notified include: new
618
+ nodes coming online, nodes updating their authenticated attributes, new
619
+ channels being advertised, updates in the routing policy for a directional
620
+ channel edge, and when channels are closed on-chain.
621
+ */
622
+ rpc SubscribeChannelGraph(GraphTopologySubscription) returns (stream GraphTopologyUpdate);
623
+
624
+ /** lncli: `debuglevel`
625
+ DebugLevel allows a caller to programmatically set the logging verbosity of
626
+ lnd. The logging can be targeted according to a coarse daemon-wide logging
627
+ level, or in a granular fashion to specify the logging for a target
628
+ sub-system.
629
+ */
630
+ rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
631
+
632
+ /** lncli: `feereport`
633
+ FeeReport allows the caller to obtain a report detailing the current fee
634
+ schedule enforced by the node globally for each channel.
635
+ */
636
+ rpc FeeReport(FeeReportRequest) returns (FeeReportResponse) {
637
+ option (google.api.http) = {
638
+ get: "/v1/fees"
639
+ };
640
+ }
641
+
642
+ /** lncli: `updatechanpolicy`
643
+ UpdateChannelPolicy allows the caller to update the fee schedule and
644
+ channel policies for all channels globally, or a particular channel.
645
+ */
646
+ rpc UpdateChannelPolicy(PolicyUpdateRequest) returns (PolicyUpdateResponse) {
647
+ option (google.api.http) = {
648
+ post: "/v1/chanpolicy"
649
+ body: "*"
650
+ };
651
+ }
652
+
653
+ /** lncli: `fwdinghistory`
654
+ ForwardingHistory allows the caller to query the htlcswitch for a record of
655
+ all HTLC's forwarded within the target time range, and integer offset
656
+ within that time range. If no time-range is specified, then the first chunk
657
+ of the past 24 hrs of forwarding history are returned.
658
+
659
+ A list of forwarding events are returned. The size of each forwarding event
660
+ is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
661
+ As a result each message can only contain 50k entries. Each response has
662
+ the index offset of the last entry. The index offset can be provided to the
663
+ request to allow the caller to skip a series of records.
664
+ */
665
+ rpc ForwardingHistory(ForwardingHistoryRequest) returns (ForwardingHistoryResponse) {
666
+ option (google.api.http) = {
667
+ post: "/v1/switch"
668
+ body: "*"
669
+ };
670
+ };
671
+ }
672
+
673
+ message Utxo {
674
+ /// The type of address
675
+ AddressType type = 1 [json_name = "address_type"];
676
+
677
+ /// The address
678
+ string address = 2 [json_name = "address"];
679
+
680
+ /// The value of the unspent coin in satoshis
681
+ int64 amount_sat = 3 [json_name = "amount_sat"];
682
+
683
+ /// The scriptpubkey in hex
684
+ string script_pubkey = 4 [json_name = "script_pubkey"];
685
+
686
+ /// The outpoint in format txid:n
687
+ /// Note that this reuses the `ChannelPoint` message but
688
+ /// is not actually a channel related outpoint, of course
689
+ ChannelPoint outpoint = 5 [json_name = "outpoint"];
690
+
691
+ /// The number of confirmations for the Utxo
692
+ int64 confirmations = 6 [json_name = "confirmations"];
693
+ }
694
+
695
+ message Transaction {
696
+ /// The transaction hash
697
+ string tx_hash = 1 [ json_name = "tx_hash" ];
698
+
699
+ /// The transaction amount, denominated in satoshis
700
+ int64 amount = 2 [ json_name = "amount" ];
701
+
702
+ /// The number of confirmations
703
+ int32 num_confirmations = 3 [ json_name = "num_confirmations" ];
704
+
705
+ /// The hash of the block this transaction was included in
706
+ string block_hash = 4 [ json_name = "block_hash" ];
707
+
708
+ /// The height of the block this transaction was included in
709
+ int32 block_height = 5 [ json_name = "block_height" ];
710
+
711
+ /// Timestamp of this transaction
712
+ int64 time_stamp = 6 [ json_name = "time_stamp" ];
713
+
714
+ /// Fees paid for this transaction
715
+ int64 total_fees = 7 [ json_name = "total_fees" ];
716
+
717
+ /// Addresses that received funds for this transaction
718
+ repeated string dest_addresses = 8 [ json_name = "dest_addresses" ];
719
+ }
720
+ message GetTransactionsRequest {
721
+ }
722
+ message TransactionDetails {
723
+ /// The list of transactions relevant to the wallet.
724
+ repeated Transaction transactions = 1 [json_name = "transactions"];
725
+ }
726
+
727
+ message FeeLimit {
728
+ oneof limit {
729
+ /// The fee limit expressed as a fixed amount of satoshis.
730
+ int64 fixed = 1;
731
+
732
+ /// The fee limit expressed as a percentage of the payment amount.
733
+ int64 percent = 2;
734
+ }
735
+ }
736
+
737
+ message SendRequest {
738
+ /// The identity pubkey of the payment recipient
739
+ bytes dest = 1;
740
+
741
+ /// The hex-encoded identity pubkey of the payment recipient
742
+ string dest_string = 2;
743
+
744
+ /// Number of satoshis to send.
745
+ int64 amt = 3;
746
+
747
+ /// The hash to use within the payment's HTLC
748
+ bytes payment_hash = 4;
749
+
750
+ /// The hex-encoded hash to use within the payment's HTLC
751
+ string payment_hash_string = 5;
752
+
753
+ /**
754
+ A bare-bones invoice for a payment within the Lightning Network. With the
755
+ details of the invoice, the sender has all the data necessary to send a
756
+ payment to the recipient.
757
+ */
758
+ string payment_request = 6;
759
+
760
+ /**
761
+ The CLTV delta from the current height that should be used to set the
762
+ timelock for the final hop.
763
+ */
764
+ int32 final_cltv_delta = 7;
765
+
766
+ /**
767
+ The maximum number of satoshis that will be paid as a fee of the payment.
768
+ This value can be represented either as a percentage of the amount being
769
+ sent, or as a fixed amount of the maximum fee the user is willing the pay to
770
+ send the payment.
771
+ */
772
+ FeeLimit fee_limit = 8;
773
+ }
774
+ message SendResponse {
775
+ string payment_error = 1 [json_name = "payment_error"];
776
+ bytes payment_preimage = 2 [json_name = "payment_preimage"];
777
+ Route payment_route = 3 [json_name = "payment_route"];
778
+ bytes payment_hash = 4 [json_name = "payment_hash"];
779
+ }
780
+
781
+ message SendToRouteRequest {
782
+ /// The payment hash to use for the HTLC.
783
+ bytes payment_hash = 1;
784
+
785
+ /// An optional hex-encoded payment hash to be used for the HTLC.
786
+ string payment_hash_string = 2;
787
+
788
+ /// The set of routes that should be used to attempt to complete the payment.
789
+ repeated Route routes = 3;
790
+ }
791
+
792
+ message ChannelPoint {
793
+ oneof funding_txid {
794
+ /// Txid of the funding transaction
795
+ bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
796
+
797
+ /// Hex-encoded string representing the funding transaction
798
+ string funding_txid_str = 2 [json_name = "funding_txid_str"];
799
+ }
800
+
801
+ /// The index of the output of the funding transaction
802
+ uint32 output_index = 3 [json_name = "output_index"];
803
+ }
804
+
805
+ message LightningAddress {
806
+ /// The identity pubkey of the Lightning node
807
+ string pubkey = 1 [json_name = "pubkey"];
808
+
809
+ /// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011`
810
+ string host = 2 [json_name = "host"];
811
+ }
812
+
813
+ message SendManyRequest {
814
+ /// The map from addresses to amounts
815
+ map<string, int64> AddrToAmount = 1;
816
+
817
+ /// The target number of blocks that this transaction should be confirmed by.
818
+ int32 target_conf = 3;
819
+
820
+ /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
821
+ int64 sat_per_byte = 5;
822
+ }
823
+ message SendManyResponse {
824
+ /// The id of the transaction
825
+ string txid = 1 [json_name = "txid"];
826
+ }
827
+
828
+ message SendCoinsRequest {
829
+ /// The address to send coins to
830
+ string addr = 1;
831
+
832
+ /// The amount in satoshis to send
833
+ int64 amount = 2;
834
+
835
+ /// The target number of blocks that this transaction should be confirmed by.
836
+ int32 target_conf = 3;
837
+
838
+ /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
839
+ int64 sat_per_byte = 5;
840
+ }
841
+ message SendCoinsResponse {
842
+ /// The transaction ID of the transaction
843
+ string txid = 1 [json_name = "txid"];
844
+ }
845
+
846
+ message ListUnspentRequest {
847
+ /// The minimum number of confirmations to be included.
848
+ int32 min_confs = 1;
849
+
850
+ /// The maximum number of confirmations to be included.
851
+ int32 max_confs = 2;
852
+ }
853
+ message ListUnspentResponse {
854
+ /// A list of utxos
855
+ repeated Utxo utxos = 1 [json_name = "utxos"];
856
+
857
+ }
858
+
859
+ /**
860
+ `AddressType` has to be one of:
861
+
862
+ - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0)
863
+ - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
864
+ */
865
+ enum AddressType {
866
+ WITNESS_PUBKEY_HASH = 0;
867
+ NESTED_PUBKEY_HASH = 1;
868
+ }
869
+
870
+ message NewAddressRequest {
871
+ /// The address type
872
+ AddressType type = 1;
873
+ }
874
+ message NewAddressResponse {
875
+ /// The newly generated wallet address
876
+ string address = 1 [json_name = "address"];
877
+ }
878
+
879
+ message SignMessageRequest {
880
+ /// The message to be signed
881
+ bytes msg = 1 [ json_name = "msg" ];
882
+ }
883
+ message SignMessageResponse {
884
+ /// The signature for the given message
885
+ string signature = 1 [ json_name = "signature" ];
886
+ }
887
+
888
+ message VerifyMessageRequest {
889
+ /// The message over which the signature is to be verified
890
+ bytes msg = 1 [ json_name = "msg" ];
891
+
892
+ /// The signature to be verified over the given message
893
+ string signature = 2 [ json_name = "signature" ];
894
+ }
895
+ message VerifyMessageResponse {
896
+ /// Whether the signature was valid over the given message
897
+ bool valid = 1 [ json_name = "valid" ];
898
+
899
+ /// The pubkey recovered from the signature
900
+ string pubkey = 2 [ json_name = "pubkey" ];
901
+ }
902
+
903
+ message ConnectPeerRequest {
904
+ /// Lightning address of the peer, in the format `<pubkey>@host`
905
+ LightningAddress addr = 1;
906
+
907
+ /** If set, the daemon will attempt to persistently connect to the target
908
+ * peer. Otherwise, the call will be synchronous. */
909
+ bool perm = 2;
910
+ }
911
+ message ConnectPeerResponse {
912
+ }
913
+
914
+ message DisconnectPeerRequest {
915
+ /// The pubkey of the node to disconnect from
916
+ string pub_key = 1 [json_name = "pub_key"];
917
+ }
918
+ message DisconnectPeerResponse {
919
+ }
920
+
921
+ message HTLC {
922
+ bool incoming = 1 [json_name = "incoming"];
923
+ int64 amount = 2 [json_name = "amount"];
924
+ bytes hash_lock = 3 [json_name = "hash_lock"];
925
+ uint32 expiration_height = 4 [json_name = "expiration_height"];
926
+ }
927
+
928
+ message Channel {
929
+ /// Whether this channel is active or not
930
+ bool active = 1 [json_name = "active"];
931
+
932
+ /// The identity pubkey of the remote node
933
+ string remote_pubkey = 2 [json_name = "remote_pubkey"];
934
+
935
+ /**
936
+ The outpoint (txid:index) of the funding transaction. With this value, Bob
937
+ will be able to generate a signature for Alice's version of the commitment
938
+ transaction.
939
+ */
940
+ string channel_point = 3 [json_name = "channel_point"];
941
+
942
+ /**
943
+ The unique channel ID for the channel. The first 3 bytes are the block
944
+ height, the next 3 the index within the block, and the last 2 bytes are the
945
+ output index for the channel.
946
+ */
947
+ uint64 chan_id = 4 [json_name = "chan_id"];
948
+
949
+ /// The total amount of funds held in this channel
950
+ int64 capacity = 5 [json_name = "capacity"];
951
+
952
+ /// This node's current balance in this channel
953
+ int64 local_balance = 6 [json_name = "local_balance"];
954
+
955
+ /// The counterparty's current balance in this channel
956
+ int64 remote_balance = 7 [json_name = "remote_balance"];
957
+
958
+ /**
959
+ The amount calculated to be paid in fees for the current set of commitment
960
+ transactions. The fee amount is persisted with the channel in order to
961
+ allow the fee amount to be removed and recalculated with each channel state
962
+ update, including updates that happen after a system restart.
963
+ */
964
+ int64 commit_fee = 8 [json_name = "commit_fee"];
965
+
966
+ /// The weight of the commitment transaction
967
+ int64 commit_weight = 9 [json_name = "commit_weight"];
968
+
969
+ /**
970
+ The required number of satoshis per kilo-weight that the requester will pay
971
+ at all times, for both the funding transaction and commitment transaction.
972
+ This value can later be updated once the channel is open.
973
+ */
974
+ int64 fee_per_kw = 10 [json_name = "fee_per_kw"];
975
+
976
+ /// The unsettled balance in this channel
977
+ int64 unsettled_balance = 11 [json_name = "unsettled_balance"];
978
+
979
+ /**
980
+ The total number of satoshis we've sent within this channel.
981
+ */
982
+ int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"];
983
+
984
+ /**
985
+ The total number of satoshis we've received within this channel.
986
+ */
987
+ int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"];
988
+
989
+ /**
990
+ The total number of updates conducted within this channel.
991
+ */
992
+ uint64 num_updates = 14 [json_name = "num_updates"];
993
+
994
+ /**
995
+ The list of active, uncleared HTLCs currently pending within the channel.
996
+ */
997
+ repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"];
998
+
999
+ /**
1000
+ The CSV delay expressed in relative blocks. If the channel is force
1001
+ closed, we'll need to wait for this many blocks before we can regain our
1002
+ funds.
1003
+ */
1004
+ uint32 csv_delay = 16 [json_name = "csv_delay"];
1005
+
1006
+ /// Whether this channel is advertised to the network or not
1007
+ bool private = 17 [json_name = "private"];
1008
+ }
1009
+
1010
+
1011
+ message ListChannelsRequest {
1012
+ bool active_only = 1;
1013
+ bool inactive_only = 2;
1014
+ bool public_only = 3;
1015
+ bool private_only = 4;
1016
+ }
1017
+ message ListChannelsResponse {
1018
+ /// The list of active channels
1019
+ repeated Channel channels = 11 [json_name = "channels"];
1020
+ }
1021
+
1022
+ message ChannelCloseSummary {
1023
+ /// The outpoint (txid:index) of the funding transaction.
1024
+ string channel_point = 1 [json_name = "channel_point"];
1025
+
1026
+ /// The unique channel ID for the channel.
1027
+ uint64 chan_id = 2 [json_name = "chan_id"];
1028
+
1029
+ /// The hash of the genesis block that this channel resides within.
1030
+ string chain_hash = 3 [json_name = "chain_hash"];
1031
+
1032
+ /// The txid of the transaction which ultimately closed this channel.
1033
+ string closing_tx_hash = 4 [json_name = "closing_tx_hash"];
1034
+
1035
+ /// Public key of the remote peer that we formerly had a channel with.
1036
+ string remote_pubkey = 5 [json_name = "remote_pubkey"];
1037
+
1038
+ /// Total capacity of the channel.
1039
+ int64 capacity = 6 [json_name = "capacity"];
1040
+
1041
+ /// Height at which the funding transaction was spent.
1042
+ uint32 close_height = 7 [json_name = "close_height"];
1043
+
1044
+ /// Settled balance at the time of channel closure
1045
+ int64 settled_balance = 8 [json_name = "settled_balance"];
1046
+
1047
+ /// The sum of all the time-locked outputs at the time of channel closure
1048
+ int64 time_locked_balance = 9 [json_name = "time_locked_balance"];
1049
+
1050
+ enum ClosureType {
1051
+ COOPERATIVE_CLOSE = 0;
1052
+ LOCAL_FORCE_CLOSE = 1;
1053
+ REMOTE_FORCE_CLOSE = 2;
1054
+ BREACH_CLOSE = 3;
1055
+ FUNDING_CANCELED = 4;
1056
+ ABANDONED = 5;
1057
+ }
1058
+
1059
+ /// Details on how the channel was closed.
1060
+ ClosureType close_type = 10 [json_name = "close_type"];
1061
+ }
1062
+
1063
+ message ClosedChannelsRequest {
1064
+ bool cooperative = 1;
1065
+ bool local_force = 2;
1066
+ bool remote_force = 3;
1067
+ bool breach = 4;
1068
+ bool funding_canceled = 5;
1069
+ bool abandoned = 6;
1070
+ }
1071
+
1072
+ message ClosedChannelsResponse {
1073
+ repeated ChannelCloseSummary channels = 1 [json_name = "channels"];
1074
+ }
1075
+
1076
+ message Peer {
1077
+ /// The identity pubkey of the peer
1078
+ string pub_key = 1 [json_name = "pub_key"];
1079
+
1080
+ /// Network address of the peer; eg `127.0.0.1:10011`
1081
+ string address = 3 [json_name = "address"];
1082
+
1083
+ /// Bytes of data transmitted to this peer
1084
+ uint64 bytes_sent = 4 [json_name = "bytes_sent"];
1085
+
1086
+ /// Bytes of data transmitted from this peer
1087
+ uint64 bytes_recv = 5 [json_name = "bytes_recv"];
1088
+
1089
+ /// Satoshis sent to this peer
1090
+ int64 sat_sent = 6 [json_name = "sat_sent"];
1091
+
1092
+ /// Satoshis received from this peer
1093
+ int64 sat_recv = 7 [json_name = "sat_recv"];
1094
+
1095
+ /// A channel is inbound if the counterparty initiated the channel
1096
+ bool inbound = 8 [json_name = "inbound"];
1097
+
1098
+ /// Ping time to this peer
1099
+ int64 ping_time = 9 [json_name = "ping_time"];
1100
+ }
1101
+
1102
+ message ListPeersRequest {
1103
+ }
1104
+ message ListPeersResponse {
1105
+ /// The list of currently connected peers
1106
+ repeated Peer peers = 1 [json_name = "peers"];
1107
+ }
1108
+
1109
+ message GetInfoRequest {
1110
+ }
1111
+ message GetInfoResponse {
1112
+
1113
+ /// The identity pubkey of the current node.
1114
+ string identity_pubkey = 1 [json_name = "identity_pubkey"];
1115
+
1116
+ /// If applicable, the alias of the current node, e.g. "bob"
1117
+ string alias = 2 [json_name = "alias"];
1118
+
1119
+ /// Number of pending channels
1120
+ uint32 num_pending_channels = 3 [json_name = "num_pending_channels"];
1121
+
1122
+ /// Number of active channels
1123
+ uint32 num_active_channels = 4 [json_name = "num_active_channels"];
1124
+
1125
+ /// Number of peers
1126
+ uint32 num_peers = 5 [json_name = "num_peers"];
1127
+
1128
+ /// The node's current view of the height of the best block
1129
+ uint32 block_height = 6 [json_name = "block_height"];
1130
+
1131
+ /// The node's current view of the hash of the best block
1132
+ string block_hash = 8 [json_name = "block_hash"];
1133
+
1134
+ /// Whether the wallet's view is synced to the main chain
1135
+ bool synced_to_chain = 9 [json_name = "synced_to_chain"];
1136
+
1137
+ /**
1138
+ Whether the current node is connected to testnet. This field is
1139
+ deprecated and the network field should be used instead
1140
+ **/
1141
+ bool testnet = 10 [json_name = "testnet", deprecated = true];
1142
+
1143
+ reserved 11;
1144
+
1145
+ /// The URIs of the current node.
1146
+ repeated string uris = 12 [json_name = "uris"];
1147
+
1148
+ /// Timestamp of the block best known to the wallet
1149
+ int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
1150
+
1151
+ /// The version of the LND software that the node is running.
1152
+ string version = 14 [ json_name = "version" ];
1153
+
1154
+ /// Number of inactive channels
1155
+ uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
1156
+
1157
+ /// A list of active chains the node is connected to
1158
+ repeated Chain chains = 16 [json_name = "chains"];
1159
+ }
1160
+
1161
+ message Chain {
1162
+ /// The blockchain the node is on (eg bitcoin, litecoin)
1163
+ string chain = 1 [json_name = "chain"];
1164
+
1165
+ /// The network the node is on (eg regtest, testnet, mainnet)
1166
+ string network = 2 [json_name = "network"];
1167
+ }
1168
+
1169
+ message ConfirmationUpdate {
1170
+ bytes block_sha = 1;
1171
+ int32 block_height = 2;
1172
+
1173
+ uint32 num_confs_left = 3;
1174
+ }
1175
+
1176
+ message ChannelOpenUpdate {
1177
+ ChannelPoint channel_point = 1 [json_name = "channel_point"];
1178
+ }
1179
+
1180
+ message ChannelCloseUpdate {
1181
+ bytes closing_txid = 1 [json_name = "closing_txid"];
1182
+
1183
+ bool success = 2 [json_name = "success"];
1184
+ }
1185
+
1186
+ message CloseChannelRequest {
1187
+ /**
1188
+ The outpoint (txid:index) of the funding transaction. With this value, Bob
1189
+ will be able to generate a signature for Alice's version of the commitment
1190
+ transaction.
1191
+ */
1192
+ ChannelPoint channel_point = 1;
1193
+
1194
+ /// If true, then the channel will be closed forcibly. This means the current commitment transaction will be signed and broadcast.
1195
+ bool force = 2;
1196
+
1197
+ /// The target number of blocks that the closure transaction should be confirmed by.
1198
+ int32 target_conf = 3;
1199
+
1200
+ /// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
1201
+ int64 sat_per_byte = 4;
1202
+ }
1203
+
1204
+ message CloseStatusUpdate {
1205
+ oneof update {
1206
+ PendingUpdate close_pending = 1 [json_name = "close_pending"];
1207
+ ChannelCloseUpdate chan_close = 3 [json_name = "chan_close"];
1208
+ }
1209
+ }
1210
+
1211
+ message PendingUpdate {
1212
+ bytes txid = 1 [json_name = "txid"];
1213
+ uint32 output_index = 2 [json_name = "output_index"];
1214
+ }
1215
+
1216
+ message OpenChannelRequest {
1217
+ /// The pubkey of the node to open a channel with
1218
+ bytes node_pubkey = 2 [json_name = "node_pubkey"];
1219
+
1220
+ /// The hex encoded pubkey of the node to open a channel with
1221
+ string node_pubkey_string = 3 [json_name = "node_pubkey_string"];
1222
+
1223
+ /// The number of satoshis the wallet should commit to the channel
1224
+ int64 local_funding_amount = 4 [json_name = "local_funding_amount"];
1225
+
1226
+ /// The number of satoshis to push to the remote side as part of the initial commitment state
1227
+ int64 push_sat = 5 [json_name = "push_sat"];
1228
+
1229
+ /// The target number of blocks that the funding transaction should be confirmed by.
1230
+ int32 target_conf = 6;
1231
+
1232
+ /// A manual fee rate set in sat/byte that should be used when crafting the funding transaction.
1233
+ int64 sat_per_byte = 7;
1234
+
1235
+ /// Whether this channel should be private, not announced to the greater network.
1236
+ bool private = 8 [json_name = "private"];
1237
+
1238
+ /// The minimum value in millisatoshi we will require for incoming HTLCs on the channel.
1239
+ int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"];
1240
+
1241
+ /// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size.
1242
+ uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"];
1243
+
1244
+ /// The minimum number of confirmations each one of your outputs used for the funding transaction must satisfy.
1245
+ int32 min_confs = 11 [json_name = "min_confs"];
1246
+
1247
+ /// Whether unconfirmed outputs should be used as inputs for the funding transaction.
1248
+ bool spend_unconfirmed = 12 [json_name = "spend_unconfirmed"];
1249
+ }
1250
+ message OpenStatusUpdate {
1251
+ oneof update {
1252
+ PendingUpdate chan_pending = 1 [json_name = "chan_pending"];
1253
+ ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"];
1254
+ }
1255
+ }
1256
+
1257
+ message PendingHTLC {
1258
+
1259
+ /// The direction within the channel that the htlc was sent
1260
+ bool incoming = 1 [ json_name = "incoming" ];
1261
+
1262
+ /// The total value of the htlc
1263
+ int64 amount = 2 [ json_name = "amount" ];
1264
+
1265
+ /// The final output to be swept back to the user's wallet
1266
+ string outpoint = 3 [ json_name = "outpoint" ];
1267
+
1268
+ /// The next block height at which we can spend the current stage
1269
+ uint32 maturity_height = 4 [ json_name = "maturity_height" ];
1270
+
1271
+ /**
1272
+ The number of blocks remaining until the current stage can be swept.
1273
+ Negative values indicate how many blocks have passed since becoming
1274
+ mature.
1275
+ */
1276
+ int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
1277
+
1278
+ /// Indicates whether the htlc is in its first or second stage of recovery
1279
+ uint32 stage = 6 [ json_name = "stage" ];
1280
+ }
1281
+
1282
+ message PendingChannelsRequest {}
1283
+ message PendingChannelsResponse {
1284
+ message PendingChannel {
1285
+ string remote_node_pub = 1 [ json_name = "remote_node_pub" ];
1286
+ string channel_point = 2 [ json_name = "channel_point" ];
1287
+
1288
+ int64 capacity = 3 [ json_name = "capacity" ];
1289
+
1290
+ int64 local_balance = 4 [ json_name = "local_balance" ];
1291
+ int64 remote_balance = 5 [ json_name = "remote_balance" ];
1292
+ }
1293
+
1294
+ message PendingOpenChannel {
1295
+ /// The pending channel
1296
+ PendingChannel channel = 1 [ json_name = "channel" ];
1297
+
1298
+ /// The height at which this channel will be confirmed
1299
+ uint32 confirmation_height = 2 [ json_name = "confirmation_height" ];
1300
+
1301
+ /**
1302
+ The amount calculated to be paid in fees for the current set of
1303
+ commitment transactions. The fee amount is persisted with the channel
1304
+ in order to allow the fee amount to be removed and recalculated with
1305
+ each channel state update, including updates that happen after a system
1306
+ restart.
1307
+ */
1308
+ int64 commit_fee = 4 [json_name = "commit_fee" ];
1309
+
1310
+ /// The weight of the commitment transaction
1311
+ int64 commit_weight = 5 [ json_name = "commit_weight" ];
1312
+
1313
+ /**
1314
+ The required number of satoshis per kilo-weight that the requester will
1315
+ pay at all times, for both the funding transaction and commitment
1316
+ transaction. This value can later be updated once the channel is open.
1317
+ */
1318
+ int64 fee_per_kw = 6 [ json_name = "fee_per_kw" ];
1319
+ }
1320
+
1321
+ message WaitingCloseChannel {
1322
+ /// The pending channel waiting for closing tx to confirm
1323
+ PendingChannel channel = 1;
1324
+
1325
+ /// The balance in satoshis encumbered in this channel
1326
+ int64 limbo_balance = 2 [ json_name = "limbo_balance" ];
1327
+ }
1328
+
1329
+ message ClosedChannel {
1330
+ /// The pending channel to be closed
1331
+ PendingChannel channel = 1;
1332
+
1333
+ /// The transaction id of the closing transaction
1334
+ string closing_txid = 2 [ json_name = "closing_txid" ];
1335
+ }
1336
+
1337
+ message ForceClosedChannel {
1338
+ /// The pending channel to be force closed
1339
+ PendingChannel channel = 1 [ json_name = "channel" ];
1340
+
1341
+ /// The transaction id of the closing transaction
1342
+ string closing_txid = 2 [ json_name = "closing_txid" ];
1343
+
1344
+ /// The balance in satoshis encumbered in this pending channel
1345
+ int64 limbo_balance = 3 [ json_name = "limbo_balance" ];
1346
+
1347
+ /// The height at which funds can be sweeped into the wallet
1348
+ uint32 maturity_height = 4 [ json_name = "maturity_height" ];
1349
+
1350
+ /*
1351
+ Remaining # of blocks until the commitment output can be swept.
1352
+ Negative values indicate how many blocks have passed since becoming
1353
+ mature.
1354
+ */
1355
+ int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
1356
+
1357
+ /// The total value of funds successfully recovered from this channel
1358
+ int64 recovered_balance = 6 [ json_name = "recovered_balance" ];
1359
+
1360
+ repeated PendingHTLC pending_htlcs = 8 [ json_name = "pending_htlcs" ];
1361
+ }
1362
+
1363
+ /// The balance in satoshis encumbered in pending channels
1364
+ int64 total_limbo_balance = 1 [ json_name = "total_limbo_balance" ];
1365
+
1366
+ /// Channels pending opening
1367
+ repeated PendingOpenChannel pending_open_channels = 2 [ json_name = "pending_open_channels" ];
1368
+
1369
+ /// Channels pending closing
1370
+ repeated ClosedChannel pending_closing_channels = 3 [ json_name = "pending_closing_channels" ];
1371
+
1372
+ /// Channels pending force closing
1373
+ repeated ForceClosedChannel pending_force_closing_channels = 4 [ json_name = "pending_force_closing_channels" ];
1374
+
1375
+ /// Channels waiting for closing tx to confirm
1376
+ repeated WaitingCloseChannel waiting_close_channels = 5 [ json_name = "waiting_close_channels" ];
1377
+ }
1378
+
1379
+ message WalletBalanceRequest {
1380
+ }
1381
+ message WalletBalanceResponse {
1382
+ /// The balance of the wallet
1383
+ int64 total_balance = 1 [json_name = "total_balance"];
1384
+
1385
+ /// The confirmed balance of a wallet(with >= 1 confirmations)
1386
+ int64 confirmed_balance = 2 [json_name = "confirmed_balance"];
1387
+
1388
+ /// The unconfirmed balance of a wallet(with 0 confirmations)
1389
+ int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"];
1390
+ }
1391
+
1392
+ message ChannelBalanceRequest {
1393
+ }
1394
+ message ChannelBalanceResponse {
1395
+ /// Sum of channels balances denominated in satoshis
1396
+ int64 balance = 1 [json_name = "balance"];
1397
+
1398
+ /// Sum of channels pending balances denominated in satoshis
1399
+ int64 pending_open_balance = 2 [json_name = "pending_open_balance"];
1400
+ }
1401
+
1402
+ message QueryRoutesRequest {
1403
+ /// The 33-byte hex-encoded public key for the payment destination
1404
+ string pub_key = 1;
1405
+
1406
+ /// The amount to send expressed in satoshis
1407
+ int64 amt = 2;
1408
+
1409
+ /// The max number of routes to return.
1410
+ int32 num_routes = 3;
1411
+
1412
+ /// An optional CLTV delta from the current height that should be used for the timelock of the final hop
1413
+ int32 final_cltv_delta = 4;
1414
+
1415
+ /**
1416
+ The maximum number of satoshis that will be paid as a fee of the payment.
1417
+ This value can be represented either as a percentage of the amount being
1418
+ sent, or as a fixed amount of the maximum fee the user is willing the pay to
1419
+ send the payment.
1420
+ */
1421
+ FeeLimit fee_limit = 5;
1422
+ }
1423
+ message QueryRoutesResponse {
1424
+ repeated Route routes = 1 [json_name = "routes"];
1425
+ }
1426
+
1427
+ message Hop {
1428
+ /**
1429
+ The unique channel ID for the channel. The first 3 bytes are the block
1430
+ height, the next 3 the index within the block, and the last 2 bytes are the
1431
+ output index for the channel.
1432
+ */
1433
+ uint64 chan_id = 1 [json_name = "chan_id"];
1434
+ int64 chan_capacity = 2 [json_name = "chan_capacity"];
1435
+ int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true];
1436
+ int64 fee = 4 [json_name = "fee", deprecated = true];
1437
+ uint32 expiry = 5 [json_name = "expiry"];
1438
+ int64 amt_to_forward_msat = 6 [json_name = "amt_to_forward_msat"];
1439
+ int64 fee_msat = 7 [json_name = "fee_msat"];
1440
+
1441
+ /**
1442
+ An optional public key of the hop. If the public key is given, the payment
1443
+ can be executed without relying on a copy of the channel graph.
1444
+ */
1445
+ string pub_key = 8 [json_name = "pub_key"];
1446
+ }
1447
+
1448
+ /**
1449
+ A path through the channel graph which runs over one or more channels in
1450
+ succession. This struct carries all the information required to craft the
1451
+ Sphinx onion packet, and send the payment along the first hop in the path. A
1452
+ route is only selected as valid if all the channels have sufficient capacity to
1453
+ carry the initial payment amount after fees are accounted for.
1454
+ */
1455
+ message Route {
1456
+
1457
+ /**
1458
+ The cumulative (final) time lock across the entire route. This is the CLTV
1459
+ value that should be extended to the first hop in the route. All other hops
1460
+ will decrement the time-lock as advertised, leaving enough time for all
1461
+ hops to wait for or present the payment preimage to complete the payment.
1462
+ */
1463
+ uint32 total_time_lock = 1 [json_name = "total_time_lock"];
1464
+
1465
+ /**
1466
+ The sum of the fees paid at each hop within the final route. In the case
1467
+ of a one-hop payment, this value will be zero as we don't need to pay a fee
1468
+ it ourself.
1469
+ */
1470
+ int64 total_fees = 2 [json_name = "total_fees", deprecated = true];
1471
+
1472
+ /**
1473
+ The total amount of funds required to complete a payment over this route.
1474
+ This value includes the cumulative fees at each hop. As a result, the HTLC
1475
+ extended to the first-hop in the route will need to have at least this many
1476
+ satoshis, otherwise the route will fail at an intermediate node due to an
1477
+ insufficient amount of fees.
1478
+ */
1479
+ int64 total_amt = 3 [json_name = "total_amt", deprecated = true];
1480
+
1481
+ /**
1482
+ Contains details concerning the specific forwarding details at each hop.
1483
+ */
1484
+ repeated Hop hops = 4 [json_name = "hops"];
1485
+
1486
+ /**
1487
+ The total fees in millisatoshis.
1488
+ */
1489
+ int64 total_fees_msat = 5 [json_name = "total_fees_msat"];
1490
+
1491
+ /**
1492
+ The total amount in millisatoshis.
1493
+ */
1494
+ int64 total_amt_msat = 6 [json_name = "total_amt_msat"];
1495
+ }
1496
+
1497
+ message NodeInfoRequest {
1498
+ /// The 33-byte hex-encoded compressed public of the target node
1499
+ string pub_key = 1;
1500
+ }
1501
+
1502
+ message NodeInfo {
1503
+
1504
+ /**
1505
+ An individual vertex/node within the channel graph. A node is
1506
+ connected to other nodes by one or more channel edges emanating from it. As
1507
+ the graph is directed, a node will also have an incoming edge attached to
1508
+ it for each outgoing edge.
1509
+ */
1510
+ LightningNode node = 1 [json_name = "node"];
1511
+
1512
+ uint32 num_channels = 2 [json_name = "num_channels"];
1513
+ int64 total_capacity = 3 [json_name = "total_capacity"];
1514
+ }
1515
+
1516
+ /**
1517
+ An individual vertex/node within the channel graph. A node is
1518
+ connected to other nodes by one or more channel edges emanating from it. As the
1519
+ graph is directed, a node will also have an incoming edge attached to it for
1520
+ each outgoing edge.
1521
+ */
1522
+ message LightningNode {
1523
+ uint32 last_update = 1 [ json_name = "last_update" ];
1524
+ string pub_key = 2 [ json_name = "pub_key" ];
1525
+ string alias = 3 [ json_name = "alias" ];
1526
+ repeated NodeAddress addresses = 4 [ json_name = "addresses" ];
1527
+ string color = 5 [ json_name = "color" ];
1528
+ }
1529
+
1530
+ message NodeAddress {
1531
+ string network = 1 [ json_name = "network" ];
1532
+ string addr = 2 [ json_name = "addr" ];
1533
+ }
1534
+
1535
+ message RoutingPolicy {
1536
+ uint32 time_lock_delta = 1 [json_name = "time_lock_delta"];
1537
+ int64 min_htlc = 2 [json_name = "min_htlc"];
1538
+ int64 fee_base_msat = 3 [json_name = "fee_base_msat"];
1539
+ int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat"];
1540
+ bool disabled = 5 [json_name = "disabled"];
1541
+ }
1542
+
1543
+ /**
1544
+ A fully authenticated channel along with all its unique attributes.
1545
+ Once an authenticated channel announcement has been processed on the network,
1546
+ then an instance of ChannelEdgeInfo encapsulating the channels attributes is
1547
+ stored. The other portions relevant to routing policy of a channel are stored
1548
+ within a ChannelEdgePolicy for each direction of the channel.
1549
+ */
1550
+ message ChannelEdge {
1551
+
1552
+ /**
1553
+ The unique channel ID for the channel. The first 3 bytes are the block
1554
+ height, the next 3 the index within the block, and the last 2 bytes are the
1555
+ output index for the channel.
1556
+ */
1557
+ uint64 channel_id = 1 [json_name = "channel_id"];
1558
+ string chan_point = 2 [json_name = "chan_point"];
1559
+
1560
+ uint32 last_update = 3 [json_name = "last_update"];
1561
+
1562
+ string node1_pub = 4 [json_name = "node1_pub"];
1563
+ string node2_pub = 5 [json_name = "node2_pub"];
1564
+
1565
+ int64 capacity = 6 [json_name = "capacity"];
1566
+
1567
+ RoutingPolicy node1_policy = 7 [json_name = "node1_policy"];
1568
+ RoutingPolicy node2_policy = 8 [json_name = "node2_policy"];
1569
+ }
1570
+
1571
+ message ChannelGraphRequest {
1572
+ /**
1573
+ Whether unannounced channels are included in the response or not. If set,
1574
+ unannounced channels are included. Unannounced channels are both private
1575
+ channels, and public channels that are not yet announced to the network.
1576
+ */
1577
+ bool include_unannounced = 1 [json_name = "include_unannounced"];
1578
+ }
1579
+
1580
+ /// Returns a new instance of the directed channel graph.
1581
+ message ChannelGraph {
1582
+ /// The list of `LightningNode`s in this channel graph
1583
+ repeated LightningNode nodes = 1 [json_name = "nodes"];
1584
+
1585
+ /// The list of `ChannelEdge`s in this channel graph
1586
+ repeated ChannelEdge edges = 2 [json_name = "edges"];
1587
+ }
1588
+
1589
+ message ChanInfoRequest {
1590
+ /**
1591
+ The unique channel ID for the channel. The first 3 bytes are the block
1592
+ height, the next 3 the index within the block, and the last 2 bytes are the
1593
+ output index for the channel.
1594
+ */
1595
+ uint64 chan_id = 1;
1596
+ }
1597
+
1598
+ message NetworkInfoRequest {
1599
+ }
1600
+ message NetworkInfo {
1601
+ uint32 graph_diameter = 1 [json_name = "graph_diameter"];
1602
+ double avg_out_degree = 2 [json_name = "avg_out_degree"];
1603
+ uint32 max_out_degree = 3 [json_name = "max_out_degree"];
1604
+
1605
+ uint32 num_nodes = 4 [json_name = "num_nodes"];
1606
+ uint32 num_channels = 5 [json_name = "num_channels"];
1607
+
1608
+ int64 total_network_capacity = 6 [json_name = "total_network_capacity"];
1609
+
1610
+ double avg_channel_size = 7 [json_name = "avg_channel_size"];
1611
+ int64 min_channel_size = 8 [json_name = "min_channel_size"];
1612
+ int64 max_channel_size = 9 [json_name = "max_channel_size"];
1613
+
1614
+ // TODO(roasbeef): fee rate info, expiry
1615
+ // * also additional RPC for tracking fee info once in
1616
+ }
1617
+
1618
+ message StopRequest{}
1619
+ message StopResponse{}
1620
+
1621
+ message GraphTopologySubscription {}
1622
+ message GraphTopologyUpdate {
1623
+ repeated NodeUpdate node_updates = 1;
1624
+ repeated ChannelEdgeUpdate channel_updates = 2;
1625
+ repeated ClosedChannelUpdate closed_chans = 3;
1626
+ }
1627
+ message NodeUpdate {
1628
+ repeated string addresses = 1;
1629
+ string identity_key = 2;
1630
+ bytes global_features = 3;
1631
+ string alias = 4;
1632
+ }
1633
+ message ChannelEdgeUpdate {
1634
+ /**
1635
+ The unique channel ID for the channel. The first 3 bytes are the block
1636
+ height, the next 3 the index within the block, and the last 2 bytes are the
1637
+ output index for the channel.
1638
+ */
1639
+ uint64 chan_id = 1;
1640
+
1641
+ ChannelPoint chan_point = 2;
1642
+
1643
+ int64 capacity = 3;
1644
+
1645
+ RoutingPolicy routing_policy = 4;
1646
+
1647
+ string advertising_node = 5;
1648
+ string connecting_node = 6;
1649
+ }
1650
+ message ClosedChannelUpdate {
1651
+ /**
1652
+ The unique channel ID for the channel. The first 3 bytes are the block
1653
+ height, the next 3 the index within the block, and the last 2 bytes are the
1654
+ output index for the channel.
1655
+ */
1656
+ uint64 chan_id = 1;
1657
+ int64 capacity = 2;
1658
+ uint32 closed_height = 3;
1659
+ ChannelPoint chan_point = 4;
1660
+ }
1661
+
1662
+ message HopHint {
1663
+ /// The public key of the node at the start of the channel.
1664
+ string node_id = 1 [json_name = "node_id"];
1665
+
1666
+ /// The unique identifier of the channel.
1667
+ uint64 chan_id = 2 [json_name = "chan_id"];
1668
+
1669
+ /// The base fee of the channel denominated in millisatoshis.
1670
+ uint32 fee_base_msat = 3 [json_name = "fee_base_msat"];
1671
+
1672
+ /**
1673
+ The fee rate of the channel for sending one satoshi across it denominated in
1674
+ millionths of a satoshi.
1675
+ */
1676
+ uint32 fee_proportional_millionths = 4 [json_name = "fee_proportional_millionths"];
1677
+
1678
+ /// The time-lock delta of the channel.
1679
+ uint32 cltv_expiry_delta = 5 [json_name = "cltv_expiry_delta"];
1680
+ }
1681
+
1682
+ message RouteHint {
1683
+ /**
1684
+ A list of hop hints that when chained together can assist in reaching a
1685
+ specific destination.
1686
+ */
1687
+ repeated HopHint hop_hints = 1 [json_name = "hop_hints"];
1688
+ }
1689
+
1690
+ message Invoice {
1691
+ /**
1692
+ An optional memo to attach along with the invoice. Used for record keeping
1693
+ purposes for the invoice's creator, and will also be set in the description
1694
+ field of the encoded payment request if the description_hash field is not
1695
+ being used.
1696
+ */
1697
+ string memo = 1 [json_name = "memo"];
1698
+
1699
+ /** Deprecated. An optional cryptographic receipt of payment which is not
1700
+ implemented.
1701
+ */
1702
+ bytes receipt = 2 [json_name = "receipt", deprecated = true];
1703
+
1704
+ /**
1705
+ The hex-encoded preimage (32 byte) which will allow settling an incoming
1706
+ HTLC payable to this preimage
1707
+ */
1708
+ bytes r_preimage = 3 [json_name = "r_preimage"];
1709
+
1710
+ /// The hash of the preimage
1711
+ bytes r_hash = 4 [json_name = "r_hash"];
1712
+
1713
+ /// The value of this invoice in satoshis
1714
+ int64 value = 5 [json_name = "value"];
1715
+
1716
+ /// Whether this invoice has been fulfilled
1717
+ bool settled = 6 [json_name = "settled", deprecated = true];
1718
+
1719
+ /// When this invoice was created
1720
+ int64 creation_date = 7 [json_name = "creation_date"];
1721
+
1722
+ /// When this invoice was settled
1723
+ int64 settle_date = 8 [json_name = "settle_date"];
1724
+
1725
+ /**
1726
+ A bare-bones invoice for a payment within the Lightning Network. With the
1727
+ details of the invoice, the sender has all the data necessary to send a
1728
+ payment to the recipient.
1729
+ */
1730
+ string payment_request = 9 [json_name = "payment_request"];
1731
+
1732
+ /**
1733
+ Hash (SHA-256) of a description of the payment. Used if the description of
1734
+ payment (memo) is too long to naturally fit within the description field
1735
+ of an encoded payment request.
1736
+ */
1737
+ bytes description_hash = 10 [json_name = "description_hash"];
1738
+
1739
+ /// Payment request expiry time in seconds. Default is 3600 (1 hour).
1740
+ int64 expiry = 11 [json_name = "expiry"];
1741
+
1742
+ /// Fallback on-chain address.
1743
+ string fallback_addr = 12 [json_name = "fallback_addr"];
1744
+
1745
+ /// Delta to use for the time-lock of the CLTV extended to the final hop.
1746
+ uint64 cltv_expiry = 13 [json_name = "cltv_expiry"];
1747
+
1748
+ /**
1749
+ Route hints that can each be individually used to assist in reaching the
1750
+ invoice's destination.
1751
+ */
1752
+ repeated RouteHint route_hints = 14 [json_name = "route_hints"];
1753
+
1754
+ /// Whether this invoice should include routing hints for private channels.
1755
+ bool private = 15 [json_name = "private"];
1756
+
1757
+ /**
1758
+ The "add" index of this invoice. Each newly created invoice will increment
1759
+ this index making it monotonically increasing. Callers to the
1760
+ SubscribeInvoices call can use this to instantly get notified of all added
1761
+ invoices with an add_index greater than this one.
1762
+ */
1763
+ uint64 add_index = 16 [json_name = "add_index"];
1764
+
1765
+ /**
1766
+ The "settle" index of this invoice. Each newly settled invoice will
1767
+ increment this index making it monotonically increasing. Callers to the
1768
+ SubscribeInvoices call can use this to instantly get notified of all
1769
+ settled invoices with an settle_index greater than this one.
1770
+ */
1771
+ uint64 settle_index = 17 [json_name = "settle_index"];
1772
+
1773
+ /// Deprecated, use amt_paid_sat or amt_paid_msat.
1774
+ int64 amt_paid = 18 [json_name = "amt_paid", deprecated = true];
1775
+
1776
+ /**
1777
+ The amount that was accepted for this invoice, in satoshis. This will ONLY
1778
+ be set if this invoice has been settled. We provide this field as if the
1779
+ invoice was created with a zero value, then we need to record what amount
1780
+ was ultimately accepted. Additionally, it's possible that the sender paid
1781
+ MORE that was specified in the original invoice. So we'll record that here
1782
+ as well.
1783
+ */
1784
+ int64 amt_paid_sat = 19 [json_name = "amt_paid_sat"];
1785
+
1786
+ /**
1787
+ The amount that was accepted for this invoice, in millisatoshis. This will
1788
+ ONLY be set if this invoice has been settled. We provide this field as if
1789
+ the invoice was created with a zero value, then we need to record what
1790
+ amount was ultimately accepted. Additionally, it's possible that the sender
1791
+ paid MORE that was specified in the original invoice. So we'll record that
1792
+ here as well.
1793
+ */
1794
+ int64 amt_paid_msat = 20 [json_name = "amt_paid_msat"];
1795
+
1796
+ enum InvoiceState {
1797
+ OPEN = 0;
1798
+ SETTLED = 1;
1799
+ }
1800
+
1801
+ /**
1802
+ The state the invoice is in.
1803
+ */
1804
+ InvoiceState state = 21 [json_name = "state"];
1805
+ }
1806
+
1807
+ message AddInvoiceResponse {
1808
+ bytes r_hash = 1 [json_name = "r_hash"];
1809
+
1810
+ /**
1811
+ A bare-bones invoice for a payment within the Lightning Network. With the
1812
+ details of the invoice, the sender has all the data necessary to send a
1813
+ payment to the recipient.
1814
+ */
1815
+ string payment_request = 2 [json_name = "payment_request"];
1816
+
1817
+ /**
1818
+ The "add" index of this invoice. Each newly created invoice will increment
1819
+ this index making it monotonically increasing. Callers to the
1820
+ SubscribeInvoices call can use this to instantly get notified of all added
1821
+ invoices with an add_index greater than this one.
1822
+ */
1823
+ uint64 add_index = 16 [json_name = "add_index"];
1824
+ }
1825
+ message PaymentHash {
1826
+ /**
1827
+ The hex-encoded payment hash of the invoice to be looked up. The passed
1828
+ payment hash must be exactly 32 bytes, otherwise an error is returned.
1829
+ */
1830
+ string r_hash_str = 1 [json_name = "r_hash_str"];
1831
+
1832
+ /// The payment hash of the invoice to be looked up.
1833
+ bytes r_hash = 2 [json_name = "r_hash"];
1834
+ }
1835
+
1836
+ message ListInvoiceRequest {
1837
+ /// If set, only unsettled invoices will be returned in the response.
1838
+ bool pending_only = 1 [json_name = "pending_only"];
1839
+
1840
+ /**
1841
+ The index of an invoice that will be used as either the start or end of a
1842
+ query to determine which invoices should be returned in the response.
1843
+ */
1844
+ uint64 index_offset = 4 [json_name = "index_offset"];
1845
+
1846
+ /// The max number of invoices to return in the response to this query.
1847
+ uint64 num_max_invoices = 5 [json_name = "num_max_invoices"];
1848
+
1849
+ /**
1850
+ If set, the invoices returned will result from seeking backwards from the
1851
+ specified index offset. This can be used to paginate backwards.
1852
+ */
1853
+ bool reversed = 6 [json_name = "reversed"];
1854
+ }
1855
+ message ListInvoiceResponse {
1856
+ /**
1857
+ A list of invoices from the time slice of the time series specified in the
1858
+ request.
1859
+ */
1860
+ repeated Invoice invoices = 1 [json_name = "invoices"];
1861
+
1862
+ /**
1863
+ The index of the last item in the set of returned invoices. This can be used
1864
+ to seek further, pagination style.
1865
+ */
1866
+ uint64 last_index_offset = 2 [json_name = "last_index_offset"];
1867
+
1868
+ /**
1869
+ The index of the last item in the set of returned invoices. This can be used
1870
+ to seek backwards, pagination style.
1871
+ */
1872
+ uint64 first_index_offset = 3 [json_name = "first_index_offset"];
1873
+ }
1874
+
1875
+ message InvoiceSubscription {
1876
+ /**
1877
+ If specified (non-zero), then we'll first start by sending out
1878
+ notifications for all added indexes with an add_index greater than this
1879
+ value. This allows callers to catch up on any events they missed while they
1880
+ weren't connected to the streaming RPC.
1881
+ */
1882
+ uint64 add_index = 1 [json_name = "add_index"];
1883
+
1884
+ /**
1885
+ If specified (non-zero), then we'll first start by sending out
1886
+ notifications for all settled indexes with an settle_index greater than
1887
+ this value. This allows callers to catch up on any events they missed while
1888
+ they weren't connected to the streaming RPC.
1889
+ */
1890
+ uint64 settle_index = 2 [json_name = "settle_index"];
1891
+ }
1892
+
1893
+
1894
+ message Payment {
1895
+ /// The payment hash
1896
+ string payment_hash = 1 [json_name = "payment_hash"];
1897
+
1898
+ /// Deprecated, use value_sat or value_msat.
1899
+ int64 value = 2 [json_name = "value", deprecated = true];
1900
+
1901
+ /// The date of this payment
1902
+ int64 creation_date = 3 [json_name = "creation_date"];
1903
+
1904
+ /// The path this payment took
1905
+ repeated string path = 4 [ json_name = "path" ];
1906
+
1907
+ /// The fee paid for this payment in satoshis
1908
+ int64 fee = 5 [json_name = "fee"];
1909
+
1910
+ /// The payment preimage
1911
+ string payment_preimage = 6 [json_name = "payment_preimage"];
1912
+
1913
+ /// The value of the payment in satoshis
1914
+ int64 value_sat = 7 [json_name = "value_sat"];
1915
+
1916
+ /// The value of the payment in milli-satoshis
1917
+ int64 value_msat = 8 [json_name = "value_msat"];
1918
+ }
1919
+
1920
+ message ListPaymentsRequest {
1921
+ }
1922
+
1923
+ message ListPaymentsResponse {
1924
+ /// The list of payments
1925
+ repeated Payment payments = 1 [json_name = "payments"];
1926
+ }
1927
+
1928
+ message DeleteAllPaymentsRequest {
1929
+ }
1930
+
1931
+ message DeleteAllPaymentsResponse {
1932
+ }
1933
+
1934
+ message AbandonChannelRequest {
1935
+ ChannelPoint channel_point = 1;
1936
+ }
1937
+
1938
+ message AbandonChannelResponse {
1939
+ }
1940
+
1941
+
1942
+ message DebugLevelRequest {
1943
+ bool show = 1;
1944
+ string level_spec = 2;
1945
+ }
1946
+ message DebugLevelResponse {
1947
+ string sub_systems = 1 [json_name = "sub_systems"];
1948
+ }
1949
+
1950
+ message PayReqString {
1951
+ /// The payment request string to be decoded
1952
+ string pay_req = 1;
1953
+ }
1954
+ message PayReq {
1955
+ string destination = 1 [json_name = "destination"];
1956
+ string payment_hash = 2 [json_name = "payment_hash"];
1957
+ int64 num_satoshis = 3 [json_name = "num_satoshis"];
1958
+ int64 timestamp = 4 [json_name = "timestamp"];
1959
+ int64 expiry = 5 [json_name = "expiry"];
1960
+ string description = 6 [json_name = "description"];
1961
+ string description_hash = 7 [json_name = "description_hash"];
1962
+ string fallback_addr = 8 [json_name = "fallback_addr"];
1963
+ int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
1964
+ repeated RouteHint route_hints = 10 [json_name = "route_hints"];
1965
+ }
1966
+
1967
+ message FeeReportRequest {}
1968
+ message ChannelFeeReport {
1969
+ /// The channel that this fee report belongs to.
1970
+ string chan_point = 1 [json_name = "channel_point"];
1971
+
1972
+ /// The base fee charged regardless of the number of milli-satoshis sent.
1973
+ int64 base_fee_msat = 2 [json_name = "base_fee_msat"];
1974
+
1975
+ /// The amount charged per milli-satoshis transferred expressed in millionths of a satoshi.
1976
+ int64 fee_per_mil = 3 [json_name = "fee_per_mil"];
1977
+
1978
+ /// The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million.
1979
+ double fee_rate = 4 [json_name = "fee_rate"];
1980
+ }
1981
+ message FeeReportResponse {
1982
+ /// An array of channel fee reports which describes the current fee schedule for each channel.
1983
+ repeated ChannelFeeReport channel_fees = 1 [json_name = "channel_fees"];
1984
+
1985
+ /// The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs.
1986
+ uint64 day_fee_sum = 2 [json_name = "day_fee_sum"];
1987
+
1988
+ /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week.
1989
+ uint64 week_fee_sum = 3 [json_name = "week_fee_sum"];
1990
+
1991
+ /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month.
1992
+ uint64 month_fee_sum = 4 [json_name = "month_fee_sum"];
1993
+ }
1994
+
1995
+ message PolicyUpdateRequest {
1996
+ oneof scope {
1997
+ /// If set, then this update applies to all currently active channels.
1998
+ bool global = 1 [json_name = "global"] ;
1999
+
2000
+ /// If set, this update will target a specific channel.
2001
+ ChannelPoint chan_point = 2 [json_name = "chan_point"];
2002
+ }
2003
+
2004
+ /// The base fee charged regardless of the number of milli-satoshis sent.
2005
+ int64 base_fee_msat = 3 [json_name = "base_fee_msat"];
2006
+
2007
+ /// The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6.
2008
+ double fee_rate = 4 [json_name = "fee_rate"];
2009
+
2010
+ /// The required timelock delta for HTLCs forwarded over the channel.
2011
+ uint32 time_lock_delta = 5 [json_name = "time_lock_delta"];
2012
+ }
2013
+ message PolicyUpdateResponse {
2014
+ }
2015
+
2016
+ message ForwardingHistoryRequest {
2017
+ /// Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset.
2018
+ uint64 start_time = 1 [json_name = "start_time"];
2019
+
2020
+ /// End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination.
2021
+ uint64 end_time = 2 [json_name = "end_time"];
2022
+
2023
+ /// Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series.
2024
+ uint32 index_offset = 3 [json_name = "index_offset"];
2025
+
2026
+ /// The max number of events to return in the response to this query.
2027
+ uint32 num_max_events = 4 [json_name = "num_max_events"];
2028
+ }
2029
+ message ForwardingEvent {
2030
+ /// Timestamp is the time (unix epoch offset) that this circuit was completed.
2031
+ uint64 timestamp = 1 [json_name = "timestamp"];
2032
+
2033
+ /// The incoming channel ID that carried the HTLC that created the circuit.
2034
+ uint64 chan_id_in = 2 [json_name = "chan_id_in"];
2035
+
2036
+ /// The outgoing channel ID that carried the preimage that completed the circuit.
2037
+ uint64 chan_id_out = 4 [json_name = "chan_id_out"];
2038
+
2039
+ /// The total amount (in satoshis) of the incoming HTLC that created half the circuit.
2040
+ uint64 amt_in = 5 [json_name = "amt_in"];
2041
+
2042
+ /// The total amount (in satoshis) of the outgoing HTLC that created the second half of the circuit.
2043
+ uint64 amt_out = 6 [json_name = "amt_out"];
2044
+
2045
+ /// The total fee (in satoshis) that this payment circuit carried.
2046
+ uint64 fee = 7 [json_name = "fee"];
2047
+
2048
+ /// The total fee (in milli-satoshis) that this payment circuit carried.
2049
+ uint64 fee_msat = 8 [json_name = "fee_msat"];
2050
+
2051
+ // TODO(roasbeef): add settlement latency?
2052
+ // * use FPE on the chan id?
2053
+ // * also list failures?
2054
+ }
2055
+ message ForwardingHistoryResponse {
2056
+ /// A list of forwarding events from the time slice of the time series specified in the request.
2057
+ repeated ForwardingEvent forwarding_events = 1 [json_name = "forwarding_events"];
2058
+
2059
+ /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
2060
+ uint32 last_offset_index = 2 [json_name = "last_offset_index"];
2061
+ }