lightning_network 0.0.2

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