forked from lightningdevkit/ldk-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.proto
More file actions
825 lines (653 loc) · 33.8 KB
/
api.proto
File metadata and controls
825 lines (653 loc) · 33.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
syntax = "proto3";
package api;
import 'types.proto';
// Retrieve the latest node info like `node_id`, `current_best_block` etc.
// See more:
// - https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.node_id
// - https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.status
message GetNodeInfoRequest {
}
// The response `content` for the `GetNodeInfo` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GetNodeInfoResponse {
// The hex-encoded `node-id` or public key for our own lightning node.
string node_id = 1;
// The best block to which our Lightning wallet is currently synced.
//
// Should be always set, will never be `None`.
types.BestBlock current_best_block = 3;
// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our Lightning wallet to
// the chain tip.
//
// Will be `None` if the wallet hasn't been synced yet.
optional uint64 latest_lightning_wallet_sync_timestamp = 4;
// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our on-chain
// wallet to the chain tip.
//
// Will be `None` if the wallet hasn’t been synced since the node was initialized.
optional uint64 latest_onchain_wallet_sync_timestamp = 5;
// The timestamp, in seconds since start of the UNIX epoch, when we last successfully update our fee rate cache.
//
// Will be `None` if the cache hasn’t been updated since the node was initialized.
optional uint64 latest_fee_rate_cache_update_timestamp = 6;
// The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync (RGS) snapshot we
// successfully applied was generated.
//
// Will be `None` if RGS isn’t configured or the snapshot hasn’t been updated since the node was initialized.
optional uint64 latest_rgs_snapshot_timestamp = 7;
// The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node announcement.
//
// Will be `None` if we have no public channels or we haven’t broadcasted since the node was initialized.
optional uint64 latest_node_announcement_broadcast_timestamp = 8;
// The addresses the node is currently listening on for incoming connections.
//
// Will be empty if the node is not listening on any addresses.
repeated string listening_addresses = 9;
// The addresses the node announces to the network.
//
// Will be empty if no announcement addresses are configured.
repeated string announcement_addresses = 10;
// The node alias, if configured.
//
// Will be `None` if no alias is configured.
optional string node_alias = 11;
// The node URIs that can be used to connect to this node, in the format `node_id@address`.
//
// These are constructed from the announcement addresses and the node's public key.
// Will be empty if no announcement addresses are configured.
repeated string node_uris = 12;
}
// Retrieve a new on-chain funding address.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.new_address
message OnchainReceiveRequest {
}
// The response `content` for the `OnchainReceive` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`..
message OnchainReceiveResponse {
// A Bitcoin on-chain address.
string address = 1;
}
// Send an on-chain payment to the given address.
message OnchainSendRequest {
// The address to send coins to.
string address = 1;
// The amount in satoshis to send.
// While sending the specified amount, we will respect any on-chain reserve we need to keep,
// i.e., won't allow to cut into `total_anchor_channels_reserve_sats`.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.send_to_address
optional uint64 amount_sats = 2;
// If set, the amount_sats field should be unset.
// It indicates that node will send full balance to the specified address.
//
// Please note that when send_all is used this operation will **not** retain any on-chain reserves,
// which might be potentially dangerous if you have open Anchor channels for which you can't trust
// the counterparty to spend the Anchor output after channel closure.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.send_all_to_address
optional bool send_all = 3;
// If `fee_rate_sat_per_vb` is set it will be used on the resulting transaction. Otherwise we'll retrieve
// a reasonable estimate from BitcoinD.
optional uint64 fee_rate_sat_per_vb = 4;
}
// The response `content` for the `OnchainSend` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message OnchainSendResponse {
// The transaction ID of the broadcasted transaction.
string txid = 1;
}
// Return a BOLT11 payable invoice that can be used to request and receive a payment
// for the given amount, if specified.
// The inbound payment will be automatically claimed upon arrival.
// See more:
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount
message Bolt11ReceiveRequest {
// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount invoice is returned.
optional uint64 amount_msat = 1;
// An optional description to attach along with the invoice.
// Will be set in the description field of the encoded payment request.
types.Bolt11InvoiceDescription description = 2;
// Invoice expiry time in seconds.
uint32 expiry_secs = 3;
}
// The response `content` for the `Bolt11Receive` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11ReceiveResponse {
// An invoice for a payment within the Lightning Network.
// With the details of the invoice, the sender has all the data necessary to send a payment
// to the recipient.
string invoice = 1;
// The hex-encoded 32-byte payment hash.
string payment_hash = 2;
// The hex-encoded 32-byte payment secret.
string payment_secret = 3;
}
// Return a BOLT11 payable invoice for a given payment hash.
// The inbound payment will NOT be automatically claimed upon arrival.
// Instead, the payment will need to be manually claimed by calling `Bolt11ClaimForHash`
// or manually failed by calling `Bolt11FailForHash`.
// See more:
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_for_hash
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount_for_hash
message Bolt11ReceiveForHashRequest {
// The amount in millisatoshi to receive. If unset, a "zero-amount" or variable-amount invoice is returned.
optional uint64 amount_msat = 1;
// An optional description to attach along with the invoice.
// Will be set in the description field of the encoded payment request.
types.Bolt11InvoiceDescription description = 2;
// Invoice expiry time in seconds.
uint32 expiry_secs = 3;
// The hex-encoded 32-byte payment hash to use for the invoice.
string payment_hash = 4;
}
// The response `content` for the `Bolt11ReceiveForHash` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11ReceiveForHashResponse {
// An invoice for a payment within the Lightning Network.
// With the details of the invoice, the sender has all the data necessary to send a payment
// to the recipient.
string invoice = 1;
}
// Manually claim a payment for a given payment hash with the corresponding preimage.
// This should be used to claim payments created via `Bolt11ReceiveForHash`.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.claim_for_hash
message Bolt11ClaimForHashRequest {
// The hex-encoded 32-byte payment hash.
// If provided, it will be used to verify that the preimage matches.
optional string payment_hash = 1;
// The amount in millisatoshi that is claimable.
// If not provided, skips amount verification.
optional uint64 claimable_amount_msat = 2;
// The hex-encoded 32-byte payment preimage.
string preimage = 3;
}
// The response `content` for the `Bolt11ClaimForHash` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11ClaimForHashResponse {}
// Manually fail a payment for a given payment hash.
// This should be used to reject payments created via `Bolt11ReceiveForHash`.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.fail_for_hash
message Bolt11FailForHashRequest {
// The hex-encoded 32-byte payment hash.
string payment_hash = 1;
}
// The response `content` for the `Bolt11FailForHash` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11FailForHashResponse {}
// Return a BOLT11 payable invoice that can be used to request and receive a payment via an
// LSPS2 just-in-time channel.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_via_jit_channel
message Bolt11ReceiveViaJitChannelRequest {
// The amount in millisatoshi to request.
uint64 amount_msat = 1;
// An optional description to attach along with the invoice.
// Will be set in the description field of the encoded payment request.
types.Bolt11InvoiceDescription description = 2;
// Invoice expiry time in seconds.
uint32 expiry_secs = 3;
// Optional upper bound for the total fee an LSP may deduct when opening the JIT channel.
optional uint64 max_total_lsp_fee_limit_msat = 4;
}
// The response `content` for the `Bolt11ReceiveViaJitChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11ReceiveViaJitChannelResponse {
// An invoice for a payment within the Lightning Network.
string invoice = 1;
}
// Return a variable-amount BOLT11 invoice that can be used to receive a payment via an LSPS2
// just-in-time channel.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.receive_variable_amount_via_jit_channel
message Bolt11ReceiveVariableAmountViaJitChannelRequest {
// An optional description to attach along with the invoice.
// Will be set in the description field of the encoded payment request.
types.Bolt11InvoiceDescription description = 1;
// Invoice expiry time in seconds.
uint32 expiry_secs = 2;
// Optional upper bound for the proportional fee, in parts-per-million millisatoshis, that an
// LSP may deduct when opening the JIT channel.
optional uint64 max_proportional_lsp_fee_limit_ppm_msat = 3;
}
// The response `content` for the `Bolt11ReceiveVariableAmountViaJitChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11ReceiveVariableAmountViaJitChannelResponse {
// An invoice for a payment within the Lightning Network.
string invoice = 1;
}
// Send a payment for a BOLT11 invoice.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.send
message Bolt11SendRequest {
// An invoice for a payment within the Lightning Network.
string invoice = 1;
// Set this field when paying a so-called "zero-amount" invoice, i.e., an invoice that leaves the
// amount paid to be determined by the user.
// This operation will fail if the amount specified is less than the value required by the given invoice.
optional uint64 amount_msat = 2;
// Configuration options for payment routing and pathfinding.
optional types.RouteParametersConfig route_parameters = 3;
}
// The response `content` for the `Bolt11Send` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt11SendResponse {
// An identifier used to uniquely identify a payment in hex-encoded form.
string payment_id = 1;
}
// Returns a BOLT12 offer for the given amount, if specified.
//
// See more:
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.receive
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.receive_variable_amount
message Bolt12ReceiveRequest {
// An optional description to attach along with the offer.
// Will be set in the description field of the encoded offer.
string description = 1;
// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount offer is returned.
optional uint64 amount_msat = 2;
// Offer expiry time in seconds.
optional uint32 expiry_secs = 3;
// If set, it represents the number of items requested, can only be set for fixed-amount offers.
optional uint64 quantity = 4;
}
// The response `content` for the `Bolt12Receive` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt12ReceiveResponse {
// An offer for a payment within the Lightning Network.
// With the details of the offer, the sender has all the data necessary to send a payment
// to the recipient.
string offer = 1;
// The hex-encoded offer id.
string offer_id = 2;
}
// Send a payment for a BOLT12 offer.
// See more:
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.send
// - https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.send_using_amount
message Bolt12SendRequest {
// An offer for a payment within the Lightning Network.
string offer = 1;
// Set this field when paying a so-called "zero-amount" offer, i.e., an offer that leaves the
// amount paid to be determined by the user.
// This operation will fail if the amount specified is less than the value required by the given offer.
optional uint64 amount_msat = 2;
// If set, it represents the number of items requested.
optional uint64 quantity = 3;
// If set, it will be seen by the recipient and reflected back in the invoice.
optional string payer_note = 4;
// Configuration options for payment routing and pathfinding.
optional types.RouteParametersConfig route_parameters = 5;
}
// The response `content` for the `Bolt12Send` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message Bolt12SendResponse {
// An identifier used to uniquely identify a payment in hex-encoded form.
string payment_id = 1;
}
// Send a spontaneous payment, also known as "keysend", to a node.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.SpontaneousPayment.html#method.send
message SpontaneousSendRequest {
// The amount in millisatoshis to send.
uint64 amount_msat = 1;
// The hex-encoded public key of the node to send the payment to.
string node_id = 2;
// Configuration options for payment routing and pathfinding.
optional types.RouteParametersConfig route_parameters = 3;
}
// The response `content` for the `SpontaneousSend` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message SpontaneousSendResponse {
// An identifier used to uniquely identify a payment in hex-encoded form.
string payment_id = 1;
}
// Creates a new outbound channel to the given remote node.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.connect_open_channel
message OpenChannelRequest {
// The hex-encoded public key of the node to open a channel with.
string node_pubkey = 1;
// An address which can be used to connect to a remote peer.
// It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port.
// Optional if already connected to the peer.
optional string address = 2;
// The amount of satoshis the caller is willing to commit to the channel.
uint64 channel_amount_sats = 3;
// The amount of satoshis to push to the remote side as part of the initial commitment state.
optional uint64 push_to_counterparty_msat = 4;
// The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used.
optional types.ChannelConfig channel_config = 5;
// Whether the channel should be public.
bool announce_channel = 6;
}
// The response `content` for the `OpenChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message OpenChannelResponse {
// The local channel id of the created channel that user can use to refer to channel.
string user_channel_id = 1;
}
// Increases the channel balance by the given amount.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.splice_in
message SpliceInRequest {
// The local `user_channel_id` of the channel.
string user_channel_id = 1;
// The hex-encoded public key of the channel's counterparty node.
string counterparty_node_id = 2;
// The amount of sats to splice into the channel.
uint64 splice_amount_sats = 3;
}
// The response `content` for the `SpliceIn` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message SpliceInResponse {}
// Decreases the channel balance by the given amount.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.splice_out
message SpliceOutRequest {
// The local `user_channel_id` of this channel.
string user_channel_id = 1;
// The hex-encoded public key of the channel's counterparty node.
string counterparty_node_id = 2;
// A Bitcoin on-chain address to send the spliced-out funds.
//
// If not set, an address from the node's on-chain wallet will be used.
optional string address = 3;
// The amount of sats to splice out of the channel.
uint64 splice_amount_sats = 4;
}
// The response `content` for the `SpliceOut` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message SpliceOutResponse {
// The Bitcoin on-chain address where the funds will be sent.
string address = 1;
}
// Update the config for a previously opened channel.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.update_channel_config
message UpdateChannelConfigRequest {
// The local `user_channel_id` of this channel.
string user_channel_id = 1;
// The hex-encoded public key of the counterparty node to update channel config with.
string counterparty_node_id = 2;
// The updated channel configuration settings for a channel.
types.ChannelConfig channel_config = 3;
}
// The response `content` for the `UpdateChannelConfig` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message UpdateChannelConfigResponse {
}
// Closes the channel specified by given request.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.close_channel
message CloseChannelRequest {
// The local `user_channel_id` of this channel.
string user_channel_id = 1;
// The hex-encoded public key of the node to close a channel with.
string counterparty_node_id = 2;
}
// The response `content` for the `CloseChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message CloseChannelResponse {}
// Force closes the channel specified by given request.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.force_close_channel
message ForceCloseChannelRequest {
// The local `user_channel_id` of this channel.
string user_channel_id = 1;
// The hex-encoded public key of the node to close a channel with.
string counterparty_node_id = 2;
// The reason for force-closing.
optional string force_close_reason = 3;
}
// The response `content` for the `ForceCloseChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ForceCloseChannelResponse {}
// Returns a list of known channels.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_channels
message ListChannelsRequest {}
// The response `content` for the `ListChannels` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ListChannelsResponse {
// List of channels.
repeated types.Channel channels = 1;
}
// Returns payment details for a given payment_id.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.payment
message GetPaymentDetailsRequest {
// An identifier used to uniquely identify a payment in hex-encoded form.
string payment_id = 1;
}
// The response `content` for the `GetPaymentDetails` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GetPaymentDetailsResponse {
// Represents a payment.
// Will be `None` if payment doesn't exist.
types.Payment payment = 1;
}
// Retrieves list of all payments.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_payments
message ListPaymentsRequest {
// `page_token` is a pagination token.
//
// To query for the first page, `page_token` must not be specified.
//
// For subsequent pages, use the value that was returned as `next_page_token` in the previous
// page's response.
optional types.PageToken page_token = 1;
}
// The response `content` for the `ListPayments` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ListPaymentsResponse {
// List of payments.
repeated types.Payment payments = 1;
// `next_page_token` is a pagination token, used to retrieve the next page of results.
// Use this value to query for next-page of paginated operation, by specifying
// this value as the `page_token` in the next request.
//
// If `next_page_token` is `None`, then the "last page" of results has been processed and
// there is no more data to be retrieved.
//
// If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the
// result set. The only way to know when you have reached the end of the result set is when
// `next_page_token` is `None`.
//
// **Caution**: Clients must not assume a specific number of records to be present in a page for
// paginated response.
optional types.PageToken next_page_token = 2;
}
// Retrieves list of all forwarded payments.
// See more: https://docs.rs/ldk-node/latest/ldk_node/enum.Event.html#variant.PaymentForwarded
message ListForwardedPaymentsRequest {
// `page_token` is a pagination token.
//
// To query for the first page, `page_token` must not be specified.
//
// For subsequent pages, use the value that was returned as `next_page_token` in the previous
// page's response.
optional types.PageToken page_token = 1;
}
// The response `content` for the `ListForwardedPayments` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ListForwardedPaymentsResponse {
// List of forwarded payments.
repeated types.ForwardedPayment forwarded_payments = 1;
// `next_page_token` is a pagination token, used to retrieve the next page of results.
// Use this value to query for next-page of paginated operation, by specifying
// this value as the `page_token` in the next request.
//
// If `next_page_token` is `None`, then the "last page" of results has been processed and
// there is no more data to be retrieved.
//
// If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the
// result set. The only way to know when you have reached the end of the result set is when
// `next_page_token` is `None`.
//
// **Caution**: Clients must not assume a specific number of records to be present in a page for
// paginated response.
optional types.PageToken next_page_token = 2;
}
// Sign a message with the node's secret key.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.sign_message
message SignMessageRequest {
// The message to sign, as raw bytes.
bytes message = 1;
}
// The response `content` for the `SignMessage` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message SignMessageResponse {
// The signature of the message, as a zbase32-encoded string.
string signature = 1;
}
// Verify a signature against a message and public key.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.verify_signature
message VerifySignatureRequest {
// The message that was signed, as raw bytes.
bytes message = 1;
// The signature to verify, as a zbase32-encoded string.
string signature = 2;
// The hex-encoded public key of the signer.
string public_key = 3;
}
// The response `content` for the `VerifySignature` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message VerifySignatureResponse {
// Whether the signature is valid.
bool valid = 1;
}
// Export the pathfinding scores used by the router.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.export_pathfinding_scores
message ExportPathfindingScoresRequest {}
// The response `content` for the `ExportPathfindingScores` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ExportPathfindingScoresResponse {
// The serialized pathfinding scores data.
bytes scores = 1;
}
// Retrieves an overview of all known balances.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_balances
message GetBalancesRequest {}
// The response `content` for the `GetBalances` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GetBalancesResponse {
// The total balance of our on-chain wallet.
uint64 total_onchain_balance_sats = 1;
// The currently spendable balance of our on-chain wallet.
//
// This includes any sufficiently confirmed funds, minus `total_anchor_channels_reserve_sats`.
uint64 spendable_onchain_balance_sats = 2;
// The share of our total balance that we retain as an emergency reserve to (hopefully) be
// able to spend the Anchor outputs when one of our channels is closed.
uint64 total_anchor_channels_reserve_sats = 3;
// The total balance that we would be able to claim across all our Lightning channels.
//
// Note this excludes balances that we are unsure if we are able to claim (e.g., as we are
// waiting for a preimage or for a timeout to expire). These balances will however be included
// as `MaybePreimageClaimableHTLC` and `MaybeTimeoutClaimableHTLC` in `lightning_balances`.
uint64 total_lightning_balance_sats = 4;
// A detailed list of all known Lightning balances that would be claimable on channel closure.
//
// Note that less than the listed amounts are spendable over lightning as further reserve
// restrictions apply. Please refer to `Channel::outbound_capacity_msat` and
// Channel::next_outbound_htlc_limit_msat as returned by `ListChannels`
// for a better approximation of the spendable amounts.
repeated types.LightningBalance lightning_balances = 5;
// A detailed list of balances currently being swept from the Lightning to the on-chain
// wallet.
//
// These are balances resulting from channel closures that may have been encumbered by a
// delay, but are now being claimed and useable once sufficiently confirmed on-chain.
//
// Note that, depending on the sync status of the wallets, swept balances listed here might or
// might not already be accounted for in `total_onchain_balance_sats`.
repeated types.PendingSweepBalance pending_balances_from_channel_closures = 6;
}
// Connect to a peer on the Lightning Network.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.connect
message ConnectPeerRequest {
// The hex-encoded public key of the node to connect to.
string node_pubkey = 1;
// An address which can be used to connect to a remote peer.
// It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port
string address = 2;
// Whether to persist the peer connection, i.e., whether the peer will be re-connected on
// restart.
bool persist = 3;
}
// The response `content` for the `ConnectPeer` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ConnectPeerResponse {}
// Disconnect from a peer and remove it from the peer store.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.disconnect
message DisconnectPeerRequest {
// The hex-encoded public key of the node to disconnect from.
string node_pubkey = 1;
}
// The response `content` for the `DisconnectPeer` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message DisconnectPeerResponse {}
// Returns a list of peers.
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_peers
message ListPeersRequest {}
// The response `content` for the `ListPeers` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message ListPeersResponse {
// List of peers.
repeated types.Peer peers = 1;
}
// Returns a list of all known short channel IDs in the network graph.
// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.list_channels
message GraphListChannelsRequest {}
// The response `content` for the `GraphListChannels` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GraphListChannelsResponse {
// List of short channel IDs known to the network graph.
repeated uint64 short_channel_ids = 1;
}
// Returns information on a channel with the given short channel ID from the network graph.
// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.channel
message GraphGetChannelRequest {
// The short channel ID to look up.
uint64 short_channel_id = 1;
}
// The response `content` for the `GraphGetChannel` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GraphGetChannelResponse {
// The channel information.
types.GraphChannel channel = 1;
}
// Returns a list of all known node IDs in the network graph.
// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.list_nodes
message GraphListNodesRequest {}
// The response `content` for the `GraphListNodes` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GraphListNodesResponse {
// List of hex-encoded node IDs known to the network graph.
repeated string node_ids = 1;
}
// Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name.
//
// This method parses the provided URI string and attempts to send the payment. If the URI
// has an offer and/or invoice, it will try to pay the offer first followed by the invoice.
// If they both fail, the on-chain payment will be paid.
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.UnifiedPayment.html#method.send
message UnifiedSendRequest {
// A BIP 21 URI or BIP 353 Human-Readable Name to pay.
string uri = 1;
// The amount in millisatoshis to send. Required for "zero-amount" or variable-amount URIs.
optional uint64 amount_msat = 2;
// Configuration options for payment routing and pathfinding.
optional types.RouteParametersConfig route_parameters = 3;
}
// The response `content` for the `UnifiedSend` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message UnifiedSendResponse {
oneof payment_result {
// An on-chain payment was made. Contains the transaction ID.
string txid = 1;
// A BOLT11 payment was made. Contains the payment ID in hex-encoded form.
string bolt11_payment_id = 2;
// A BOLT12 payment was made. Contains the payment ID in hex-encoded form.
string bolt12_payment_id = 3;
}
}
// Returns information on a node with the given ID from the network graph.
// See more: https://docs.rs/ldk-node/latest/ldk_node/graph/struct.NetworkGraph.html#method.node
message GraphGetNodeRequest {
// The hex-encoded node ID to look up.
string node_id = 1;
}
// The response `content` for the `GraphGetNode` API, when HttpStatusCode is OK (200).
// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.
message GraphGetNodeResponse {
// The node information.
types.GraphNode node = 1;
}