forked from lightningdevkit/ldk-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.rs
More file actions
1070 lines (1069 loc) · 57.4 KB
/
api.rs
File metadata and controls
1070 lines (1069 loc) · 57.4 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
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file is Copyright its original authors, visible in version control
// history.
//
// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// You may not use this file except in accordance with one or both of these
// licenses.
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNodeInfoResponse {
/// The hex-encoded `node-id` or public key for our own lightning node.
#[prost(string, tag = "1")]
pub node_id: ::prost::alloc::string::String,
/// The best block to which our Lightning wallet is currently synced.
///
/// Should be always set, will never be `None`.
#[prost(message, optional, tag = "3")]
pub current_best_block: ::core::option::Option<super::types::BestBlock>,
/// 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.
#[prost(uint64, optional, tag = "4")]
pub latest_lightning_wallet_sync_timestamp: ::core::option::Option<u64>,
/// 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.
#[prost(uint64, optional, tag = "5")]
pub latest_onchain_wallet_sync_timestamp: ::core::option::Option<u64>,
/// 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.
#[prost(uint64, optional, tag = "6")]
pub latest_fee_rate_cache_update_timestamp: ::core::option::Option<u64>,
/// 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.
#[prost(uint64, optional, tag = "7")]
pub latest_rgs_snapshot_timestamp: ::core::option::Option<u64>,
/// 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.
#[prost(uint64, optional, tag = "8")]
pub latest_node_announcement_broadcast_timestamp: ::core::option::Option<u64>,
/// The addresses the node is currently listening on for incoming connections.
///
/// Will be empty if the node is not listening on any addresses.
#[prost(string, repeated, tag = "9")]
pub listening_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The addresses the node announces to the network.
///
/// Will be empty if no announcement addresses are configured.
#[prost(string, repeated, tag = "10")]
pub announcement_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// The node alias, if configured.
///
/// Will be `None` if no alias is configured.
#[prost(string, optional, tag = "11")]
pub node_alias: ::core::option::Option<::prost::alloc::string::String>,
/// 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.
#[prost(string, repeated, tag = "12")]
pub node_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Retrieve a new on-chain funding address.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/payment/struct.OnchainPayment.html#method.new_address>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`..
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnchainReceiveResponse {
/// A Bitcoin on-chain address.
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
/// Send an on-chain payment to the given address.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnchainSendRequest {
/// The address to send coins to.
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
/// 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>
#[prost(uint64, optional, tag = "2")]
pub amount_sats: ::core::option::Option<u64>,
/// 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>
#[prost(bool, optional, tag = "3")]
pub send_all: ::core::option::Option<bool>,
/// 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.
#[prost(uint64, optional, tag = "4")]
pub fee_rate_sat_per_vb: ::core::option::Option<u64>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OnchainSendResponse {
/// The transaction ID of the broadcasted transaction.
#[prost(string, tag = "1")]
pub txid: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveRequest {
/// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount invoice is returned.
#[prost(uint64, optional, tag = "1")]
pub amount_msat: ::core::option::Option<u64>,
/// An optional description to attach along with the invoice.
/// Will be set in the description field of the encoded payment request.
#[prost(message, optional, tag = "2")]
pub description: ::core::option::Option<super::types::Bolt11InvoiceDescription>,
/// Invoice expiry time in seconds.
#[prost(uint32, tag = "3")]
pub expiry_secs: u32,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(string, tag = "1")]
pub invoice: ::prost::alloc::string::String,
/// The hex-encoded 32-byte payment hash.
#[prost(string, tag = "2")]
pub payment_hash: ::prost::alloc::string::String,
/// The hex-encoded 32-byte payment secret.
#[prost(string, tag = "3")]
pub payment_secret: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveForHashRequest {
/// The amount in millisatoshi to receive. If unset, a "zero-amount" or variable-amount invoice is returned.
#[prost(uint64, optional, tag = "1")]
pub amount_msat: ::core::option::Option<u64>,
/// An optional description to attach along with the invoice.
/// Will be set in the description field of the encoded payment request.
#[prost(message, optional, tag = "2")]
pub description: ::core::option::Option<super::types::Bolt11InvoiceDescription>,
/// Invoice expiry time in seconds.
#[prost(uint32, tag = "3")]
pub expiry_secs: u32,
/// The hex-encoded 32-byte payment hash to use for the invoice.
#[prost(string, tag = "4")]
pub payment_hash: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(string, tag = "1")]
pub invoice: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ClaimForHashRequest {
/// The hex-encoded 32-byte payment hash.
/// If provided, it will be used to verify that the preimage matches.
#[prost(string, optional, tag = "1")]
pub payment_hash: ::core::option::Option<::prost::alloc::string::String>,
/// The amount in millisatoshi that is claimable.
/// If not provided, skips amount verification.
#[prost(uint64, optional, tag = "2")]
pub claimable_amount_msat: ::core::option::Option<u64>,
/// The hex-encoded 32-byte payment preimage.
#[prost(string, tag = "3")]
pub preimage: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11FailForHashRequest {
/// The hex-encoded 32-byte payment hash.
#[prost(string, tag = "1")]
pub payment_hash: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveViaJitChannelRequest {
/// The amount in millisatoshi to request.
#[prost(uint64, tag = "1")]
pub amount_msat: u64,
/// An optional description to attach along with the invoice.
/// Will be set in the description field of the encoded payment request.
#[prost(message, optional, tag = "2")]
pub description: ::core::option::Option<super::types::Bolt11InvoiceDescription>,
/// Invoice expiry time in seconds.
#[prost(uint32, tag = "3")]
pub expiry_secs: u32,
/// Optional upper bound for the total fee an LSP may deduct when opening the JIT channel.
#[prost(uint64, optional, tag = "4")]
pub max_total_lsp_fee_limit_msat: ::core::option::Option<u64>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveViaJitChannelResponse {
/// An invoice for a payment within the Lightning Network.
#[prost(string, tag = "1")]
pub invoice: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveVariableAmountViaJitChannelRequest {
/// An optional description to attach along with the invoice.
/// Will be set in the description field of the encoded payment request.
#[prost(message, optional, tag = "1")]
pub description: ::core::option::Option<super::types::Bolt11InvoiceDescription>,
/// Invoice expiry time in seconds.
#[prost(uint32, tag = "2")]
pub expiry_secs: u32,
/// Optional upper bound for the proportional fee, in parts-per-million millisatoshis, that an
/// LSP may deduct when opening the JIT channel.
#[prost(uint64, optional, tag = "3")]
pub max_proportional_lsp_fee_limit_ppm_msat: ::core::option::Option<u64>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11ReceiveVariableAmountViaJitChannelResponse {
/// An invoice for a payment within the Lightning Network.
#[prost(string, tag = "1")]
pub invoice: ::prost::alloc::string::String,
}
/// Send a payment for a BOLT11 invoice.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt11Payment.html#method.send>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11SendRequest {
/// An invoice for a payment within the Lightning Network.
#[prost(string, tag = "1")]
pub invoice: ::prost::alloc::string::String,
/// 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.
#[prost(uint64, optional, tag = "2")]
pub amount_msat: ::core::option::Option<u64>,
/// Configuration options for payment routing and pathfinding.
#[prost(message, optional, tag = "3")]
pub route_parameters: ::core::option::Option<super::types::RouteParametersConfig>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt11SendResponse {
/// An identifier used to uniquely identify a payment in hex-encoded form.
#[prost(string, tag = "1")]
pub payment_id: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt12ReceiveRequest {
/// An optional description to attach along with the offer.
/// Will be set in the description field of the encoded offer.
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
/// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount offer is returned.
#[prost(uint64, optional, tag = "2")]
pub amount_msat: ::core::option::Option<u64>,
/// Offer expiry time in seconds.
#[prost(uint32, optional, tag = "3")]
pub expiry_secs: ::core::option::Option<u32>,
/// If set, it represents the number of items requested, can only be set for fixed-amount offers.
#[prost(uint64, optional, tag = "4")]
pub quantity: ::core::option::Option<u64>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(string, tag = "1")]
pub offer: ::prost::alloc::string::String,
/// The hex-encoded offer id.
#[prost(string, tag = "2")]
pub offer_id: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt12SendRequest {
/// An offer for a payment within the Lightning Network.
#[prost(string, tag = "1")]
pub offer: ::prost::alloc::string::String,
/// 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.
#[prost(uint64, optional, tag = "2")]
pub amount_msat: ::core::option::Option<u64>,
/// If set, it represents the number of items requested.
#[prost(uint64, optional, tag = "3")]
pub quantity: ::core::option::Option<u64>,
/// If set, it will be seen by the recipient and reflected back in the invoice.
#[prost(string, optional, tag = "4")]
pub payer_note: ::core::option::Option<::prost::alloc::string::String>,
/// Configuration options for payment routing and pathfinding.
#[prost(message, optional, tag = "5")]
pub route_parameters: ::core::option::Option<super::types::RouteParametersConfig>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bolt12SendResponse {
/// An identifier used to uniquely identify a payment in hex-encoded form.
#[prost(string, tag = "1")]
pub payment_id: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpontaneousSendRequest {
/// The amount in millisatoshis to send.
#[prost(uint64, tag = "1")]
pub amount_msat: u64,
/// The hex-encoded public key of the node to send the payment to.
#[prost(string, tag = "2")]
pub node_id: ::prost::alloc::string::String,
/// Configuration options for payment routing and pathfinding.
#[prost(message, optional, tag = "3")]
pub route_parameters: ::core::option::Option<super::types::RouteParametersConfig>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpontaneousSendResponse {
/// An identifier used to uniquely identify a payment in hex-encoded form.
#[prost(string, tag = "1")]
pub payment_id: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenChannelRequest {
/// The hex-encoded public key of the node to open a channel with.
#[prost(string, tag = "1")]
pub node_pubkey: ::prost::alloc::string::String,
/// 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.
#[prost(string, optional, tag = "2")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
/// The amount of satoshis the caller is willing to commit to the channel.
#[prost(uint64, tag = "3")]
pub channel_amount_sats: u64,
/// The amount of satoshis to push to the remote side as part of the initial commitment state.
#[prost(uint64, optional, tag = "4")]
pub push_to_counterparty_msat: ::core::option::Option<u64>,
/// The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used.
#[prost(message, optional, tag = "5")]
pub channel_config: ::core::option::Option<super::types::ChannelConfig>,
/// Whether the channel should be public.
#[prost(bool, tag = "6")]
pub announce_channel: bool,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenChannelResponse {
/// The local channel id of the created channel that user can use to refer to channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
}
/// Increases the channel balance by the given amount.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.splice_in>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpliceInRequest {
/// The local `user_channel_id` of the channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
/// The hex-encoded public key of the channel's counterparty node.
#[prost(string, tag = "2")]
pub counterparty_node_id: ::prost::alloc::string::String,
/// The amount of sats to splice into the channel.
#[prost(uint64, tag = "3")]
pub splice_amount_sats: u64,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpliceOutRequest {
/// The local `user_channel_id` of this channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
/// The hex-encoded public key of the channel's counterparty node.
#[prost(string, tag = "2")]
pub counterparty_node_id: ::prost::alloc::string::String,
/// 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.
#[prost(string, optional, tag = "3")]
pub address: ::core::option::Option<::prost::alloc::string::String>,
/// The amount of sats to splice out of the channel.
#[prost(uint64, tag = "4")]
pub splice_amount_sats: u64,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpliceOutResponse {
/// The Bitcoin on-chain address where the funds will be sent.
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateChannelConfigRequest {
/// The local `user_channel_id` of this channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
/// The hex-encoded public key of the counterparty node to update channel config with.
#[prost(string, tag = "2")]
pub counterparty_node_id: ::prost::alloc::string::String,
/// The updated channel configuration settings for a channel.
#[prost(message, optional, tag = "3")]
pub channel_config: ::core::option::Option<super::types::ChannelConfig>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateChannelConfigResponse {}
/// Closes the channel specified by given request.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.close_channel>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseChannelRequest {
/// The local `user_channel_id` of this channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
/// The hex-encoded public key of the node to close a channel with.
#[prost(string, tag = "2")]
pub counterparty_node_id: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForceCloseChannelRequest {
/// The local `user_channel_id` of this channel.
#[prost(string, tag = "1")]
pub user_channel_id: ::prost::alloc::string::String,
/// The hex-encoded public key of the node to close a channel with.
#[prost(string, tag = "2")]
pub counterparty_node_id: ::prost::alloc::string::String,
/// The reason for force-closing.
#[prost(string, optional, tag = "3")]
pub force_close_reason: ::core::option::Option<::prost::alloc::string::String>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForceCloseChannelResponse {}
/// Returns a list of known channels.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_channels>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelsResponse {
/// List of channels.
#[prost(message, repeated, tag = "1")]
pub channels: ::prost::alloc::vec::Vec<super::types::Channel>,
}
/// Returns payment details for a given payment_id.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.payment>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPaymentDetailsRequest {
/// An identifier used to uniquely identify a payment in hex-encoded form.
#[prost(string, tag = "1")]
pub payment_id: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPaymentDetailsResponse {
/// Represents a payment.
/// Will be `None` if payment doesn't exist.
#[prost(message, optional, tag = "1")]
pub payment: ::core::option::Option<super::types::Payment>,
}
/// Retrieves list of all payments.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_payments>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(message, optional, tag = "1")]
pub page_token: ::core::option::Option<super::types::PageToken>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPaymentsResponse {
/// List of payments.
#[prost(message, repeated, tag = "1")]
pub payments: ::prost::alloc::vec::Vec<super::types::Payment>,
/// `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.
#[prost(message, optional, tag = "2")]
pub next_page_token: ::core::option::Option<super::types::PageToken>,
}
/// Retrieves list of all forwarded payments.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/enum.Event.html#variant.PaymentForwarded>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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.
#[prost(message, optional, tag = "1")]
pub page_token: ::core::option::Option<super::types::PageToken>,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListForwardedPaymentsResponse {
/// List of forwarded payments.
#[prost(message, repeated, tag = "1")]
pub forwarded_payments: ::prost::alloc::vec::Vec<super::types::ForwardedPayment>,
/// `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.
#[prost(message, optional, tag = "2")]
pub next_page_token: ::core::option::Option<super::types::PageToken>,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignMessageRequest {
/// The message to sign, as raw bytes.
#[prost(bytes = "bytes", tag = "1")]
pub message: ::prost::bytes::Bytes,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignMessageResponse {
/// The signature of the message, as a zbase32-encoded string.
#[prost(string, tag = "1")]
pub signature: ::prost::alloc::string::String,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifySignatureRequest {
/// The message that was signed, as raw bytes.
#[prost(bytes = "bytes", tag = "1")]
pub message: ::prost::bytes::Bytes,
/// The signature to verify, as a zbase32-encoded string.
#[prost(string, tag = "2")]
pub signature: ::prost::alloc::string::String,
/// The hex-encoded public key of the signer.
#[prost(string, tag = "3")]
pub public_key: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifySignatureResponse {
/// Whether the signature is valid.
#[prost(bool, tag = "1")]
pub valid: bool,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportPathfindingScoresResponse {
/// The serialized pathfinding scores data.
#[prost(bytes = "bytes", tag = "1")]
pub scores: ::prost::bytes::Bytes,
}
/// Retrieves an overview of all known balances.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_balances>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBalancesResponse {
/// The total balance of our on-chain wallet.
#[prost(uint64, tag = "1")]
pub total_onchain_balance_sats: u64,
/// The currently spendable balance of our on-chain wallet.
///
/// This includes any sufficiently confirmed funds, minus `total_anchor_channels_reserve_sats`.
#[prost(uint64, tag = "2")]
pub spendable_onchain_balance_sats: u64,
/// 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.
#[prost(uint64, tag = "3")]
pub total_anchor_channels_reserve_sats: u64,
/// 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`.
#[prost(uint64, tag = "4")]
pub total_lightning_balance_sats: u64,
/// 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.
#[prost(message, repeated, tag = "5")]
pub lightning_balances: ::prost::alloc::vec::Vec<super::types::LightningBalance>,
/// 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`.
#[prost(message, repeated, tag = "6")]
pub pending_balances_from_channel_closures:
::prost::alloc::vec::Vec<super::types::PendingSweepBalance>,
}
/// Connect to a peer on the Lightning Network.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.connect>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConnectPeerRequest {
/// The hex-encoded public key of the node to connect to.
#[prost(string, tag = "1")]
pub node_pubkey: ::prost::alloc::string::String,
/// 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
#[prost(string, tag = "2")]
pub address: ::prost::alloc::string::String,
/// Whether to persist the peer connection, i.e., whether the peer will be re-connected on
/// restart.
#[prost(bool, tag = "3")]
pub persist: bool,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisconnectPeerRequest {
/// The hex-encoded public key of the node to disconnect from.
#[prost(string, tag = "1")]
pub node_pubkey: ::prost::alloc::string::String,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisconnectPeerResponse {}
/// Returns a list of peers.
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_peers>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPeersResponse {
/// List of peers.
#[prost(message, repeated, tag = "1")]
pub peers: ::prost::alloc::vec::Vec<super::types::Peer>,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphListChannelsResponse {
/// List of short channel IDs known to the network graph.
#[prost(uint64, repeated, tag = "1")]
pub short_channel_ids: ::prost::alloc::vec::Vec<u64>,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphGetChannelRequest {
/// The short channel ID to look up.
#[prost(uint64, tag = "1")]
pub short_channel_id: u64,
}
/// 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphGetChannelResponse {
/// The channel information.
#[prost(message, optional, tag = "1")]
pub channel: ::core::option::Option<super::types::GraphChannel>,
}
/// 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>
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct 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`.
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphListNodesResponse {
/// List of hex-encoded node IDs known to the network graph.
#[prost(string, repeated, tag = "1")]
pub node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Send a payment given a BIP 21 URI or BIP 353 Human-Readable Name.
///