lnlink-server 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +461 -0
  2. package/dist/app.js +11165 -0
  3. package/dist/binaries.json +20 -0
  4. package/dist/build-info.json +41 -0
  5. package/dist/config.default.js +19 -0
  6. package/dist/index.js +19002 -0
  7. package/dist/index.js.map +7 -0
  8. package/dist/package.json +61 -0
  9. package/dist/prisma/migrations/20250918020814_/migration.sql +188 -0
  10. package/dist/prisma/migrations/20251114105314_auto_update/migration.sql +2 -0
  11. package/dist/prisma/migrations/migration_lock.toml +3 -0
  12. package/dist/prisma/schema.prisma +181 -0
  13. package/dist/proto/chainkit.proto +74 -0
  14. package/dist/proto/lightning.proto +5411 -0
  15. package/dist/proto/lit-status.proto +36 -0
  16. package/dist/proto/looprpc/client.proto +1435 -0
  17. package/dist/proto/price_oracle.proto +243 -0
  18. package/dist/proto/rfqrpc/rfq.proto +436 -0
  19. package/dist/proto/routerrpc/router.proto +1136 -0
  20. package/dist/proto/signrpc/signer.proto +709 -0
  21. package/dist/proto/stateservice.proto +73 -0
  22. package/dist/proto/swapserverrpc/common.proto +37 -0
  23. package/dist/proto/tapchannel.proto +306 -0
  24. package/dist/proto/tapcommon.proto +36 -0
  25. package/dist/proto/taprootassets.proto +1959 -0
  26. package/dist/proto/universe.proto +1063 -0
  27. package/dist/proto/walletkit.proto +1594 -0
  28. package/dist/proto/walletunlocker.proto +338 -0
  29. package/dist/public/css/initOwner.css +553 -0
  30. package/dist/public/favicon.ico +0 -0
  31. package/dist/public/init.html +70 -0
  32. package/dist/public/js/init.js +454 -0
  33. package/dist/setting.mainnet.json +22 -0
  34. package/dist/setting.regtest.json +22 -0
  35. package/dist/setting.testnet.json +22 -0
  36. package/package.json +91 -0
@@ -0,0 +1,1435 @@
1
+ syntax = "proto3";
2
+
3
+ import "../swapserverrpc/common.proto";
4
+
5
+ package looprpc;
6
+
7
+ option go_package = "github.com/lightninglabs/loop/looprpc";
8
+
9
+ /*
10
+ SwapClient is a service that handles the client side process of onchain/offchain
11
+ swaps. The service is designed for a single client.
12
+ */
13
+ service SwapClient {
14
+ /* loop: `out`
15
+ LoopOut initiates an loop out swap with the given parameters. The call
16
+ returns after the swap has been set up with the swap server. From that
17
+ point onwards, progress can be tracked via the SwapStatus stream that is
18
+ returned from Monitor().
19
+ */
20
+ rpc LoopOut (LoopOutRequest) returns (SwapResponse);
21
+
22
+ /* loop: `in`
23
+ LoopIn initiates a loop in swap with the given parameters. The call
24
+ returns after the swap has been set up with the swap server. From that
25
+ point onwards, progress can be tracked via the SwapStatus stream
26
+ that is returned from Monitor().
27
+ */
28
+ rpc LoopIn (LoopInRequest) returns (SwapResponse);
29
+
30
+ /* loop: `monitor`
31
+ Monitor will return a stream of swap updates for currently active swaps.
32
+ */
33
+ rpc Monitor (MonitorRequest) returns (stream SwapStatus);
34
+
35
+ /* loop: `listswaps`
36
+ ListSwaps returns a list of all currently known swaps and their current
37
+ status.
38
+ */
39
+ rpc ListSwaps (ListSwapsRequest) returns (ListSwapsResponse);
40
+
41
+ /* loop: `swapinfo`
42
+ SwapInfo returns all known details about a single swap.
43
+ */
44
+ rpc SwapInfo (SwapInfoRequest) returns (SwapStatus);
45
+
46
+ /* loop: `abandonswap`
47
+ AbandonSwap allows the client to abandon a swap.
48
+ */
49
+ rpc AbandonSwap (AbandonSwapRequest) returns (AbandonSwapResponse);
50
+
51
+ /* loop: `terms`
52
+ LoopOutTerms returns the terms that the server enforces for a loop out swap.
53
+ */
54
+ rpc LoopOutTerms (TermsRequest) returns (OutTermsResponse);
55
+
56
+ /* loop: `quote`
57
+ LoopOutQuote returns a quote for a loop out swap with the provided
58
+ parameters.
59
+ */
60
+ rpc LoopOutQuote (QuoteRequest) returns (OutQuoteResponse);
61
+
62
+ /* loop: `terms`
63
+ GetTerms returns the terms that the server enforces for swaps.
64
+ */
65
+ rpc GetLoopInTerms (TermsRequest) returns (InTermsResponse);
66
+
67
+ /* loop: `quote`
68
+ GetQuote returns a quote for a swap with the provided parameters.
69
+ */
70
+ rpc GetLoopInQuote (QuoteRequest) returns (InQuoteResponse);
71
+
72
+ /*
73
+ Probe asks he sever to probe the route to us to have a better upfront
74
+ estimate about routing fees when loopin-in.
75
+ */
76
+ rpc Probe (ProbeRequest) returns (ProbeResponse);
77
+
78
+ /* loop: `listauth`
79
+ GetL402Tokens returns all L402 tokens the daemon ever paid for.
80
+ */
81
+ rpc GetL402Tokens (TokensRequest) returns (TokensResponse);
82
+
83
+ /*
84
+ Deprecated: use GetL402Tokens.
85
+ This API is provided to maintain backward compatibility with gRPC clients
86
+ (e.g. `loop listauth`, Terminal Web, RTL).
87
+ Type LsatToken used by GetLsatTokens in the past was renamed to L402Token,
88
+ but this does not affect binary encoding, so we can use type L402Token here.
89
+ */
90
+ rpc GetLsatTokens (TokensRequest) returns (TokensResponse);
91
+
92
+ /* loop: `getinfo`
93
+ GetInfo gets basic information about the loop daemon.
94
+ */
95
+ rpc GetInfo (GetInfoRequest) returns (GetInfoResponse);
96
+
97
+ /* loop: `getparams`
98
+ GetLiquidityParams gets the parameters that the daemon's liquidity manager
99
+ is currently configured with. This may be nil if nothing is configured.
100
+ [EXPERIMENTAL]: endpoint is subject to change.
101
+ */
102
+ rpc GetLiquidityParams (GetLiquidityParamsRequest)
103
+ returns (LiquidityParameters);
104
+
105
+ /* loop: `setparams`
106
+ SetLiquidityParams sets a new set of parameters for the daemon's liquidity
107
+ manager. Note that the full set of parameters must be provided, because
108
+ this call fully overwrites our existing parameters.
109
+ [EXPERIMENTAL]: endpoint is subject to change.
110
+ */
111
+ rpc SetLiquidityParams (SetLiquidityParamsRequest)
112
+ returns (SetLiquidityParamsResponse);
113
+
114
+ /* loop: `suggestswaps`
115
+ SuggestSwaps returns a list of recommended swaps based on the current
116
+ state of your node's channels and it's liquidity manager parameters.
117
+ Note that only loop out suggestions are currently supported.
118
+ [EXPERIMENTAL]: endpoint is subject to change.
119
+ */
120
+ rpc SuggestSwaps (SuggestSwapsRequest) returns (SuggestSwapsResponse);
121
+
122
+ /* loop: `listreservations`
123
+ ListReservations returns a list of all reservations the server opened to us.
124
+ */
125
+ rpc ListReservations (ListReservationsRequest)
126
+ returns (ListReservationsResponse);
127
+
128
+ /* loop: `instantout`
129
+ InstantOut initiates an instant out swap with the given parameters.
130
+ */
131
+ rpc InstantOut (InstantOutRequest) returns (InstantOutResponse);
132
+
133
+ /* loop: `instantoutquote`
134
+ InstantOutQuote returns a quote for an instant out swap with the provided
135
+ parameters.
136
+ */
137
+ rpc InstantOutQuote (InstantOutQuoteRequest)
138
+ returns (InstantOutQuoteResponse);
139
+
140
+ /* loop: `listinstantouts`
141
+ ListInstantOuts returns a list of all currently known instant out swaps and
142
+ their current status.
143
+ */
144
+ rpc ListInstantOuts (ListInstantOutsRequest)
145
+ returns (ListInstantOutsResponse);
146
+ }
147
+
148
+ message LoopOutRequest {
149
+ /*
150
+ Requested swap amount in sat. This does not include the swap and miner fee.
151
+ */
152
+ int64 amt = 1;
153
+
154
+ /*
155
+ Base58 encoded destination address for the swap.
156
+ */
157
+ string dest = 2;
158
+
159
+ /*
160
+ Maximum off-chain fee in sat that may be paid for swap payment to the
161
+ server. This limit is applied during path finding. Typically this value is
162
+ taken from the response of the GetQuote call.
163
+ */
164
+ int64 max_swap_routing_fee = 3;
165
+
166
+ /*
167
+ Maximum off-chain fee in sat that may be paid for the prepay to the server.
168
+ This limit is applied during path finding. Typically this value is taken
169
+ from the response of the GetQuote call.
170
+ */
171
+ int64 max_prepay_routing_fee = 4;
172
+
173
+ /*
174
+ Maximum we are willing to pay the server for the swap. This value is not
175
+ disclosed in the swap initiation call, but if the server asks for a
176
+ higher fee, we abort the swap. Typically this value is taken from the
177
+ response of the GetQuote call. It includes the prepay amount.
178
+ */
179
+ int64 max_swap_fee = 5;
180
+
181
+ /*
182
+ Maximum amount of the swap fee that may be charged as a prepayment.
183
+ */
184
+ int64 max_prepay_amt = 6;
185
+
186
+ /*
187
+ Maximum in on-chain fees that we are willing to spend. If we want to
188
+ sweep the on-chain htlc and the fee estimate turns out higher than this
189
+ value, we cancel the swap. If the fee estimate is lower, we publish the
190
+ sweep tx.
191
+
192
+ If the sweep tx is not confirmed, we are forced to ratchet up fees until it
193
+ is swept. Possibly even exceeding max_miner_fee if we get close to the htlc
194
+ timeout. Because the initial publication revealed the preimage, we have no
195
+ other choice. The server may already have pulled the off-chain htlc. Only
196
+ when the fee becomes higher than the swap amount, we can only wait for fees
197
+ to come down and hope - if we are past the timeout - that the server is not
198
+ publishing the revocation.
199
+
200
+ max_miner_fee is typically taken from the response of the GetQuote call.
201
+ */
202
+ int64 max_miner_fee = 7;
203
+
204
+ /*
205
+ Deprecated, use outgoing_chan_set. The channel to loop out, the channel
206
+ to loop out is selected based on the lowest routing fee for the swap
207
+ payment to the server.
208
+ */
209
+ uint64 loop_out_channel = 8 [deprecated = true];
210
+
211
+ /*
212
+ A restriction on the channel set that may be used to loop out. The actual
213
+ channel(s) that will be used are selected based on the lowest routing fee
214
+ for the swap payment to the server.
215
+ */
216
+ repeated uint64 outgoing_chan_set = 11;
217
+
218
+ /*
219
+ The number of blocks from the on-chain HTLC's confirmation height that it
220
+ should be swept within.
221
+ */
222
+ int32 sweep_conf_target = 9;
223
+
224
+ /*
225
+ The number of confirmations that we require for the on chain htlc that will
226
+ be published by the server before we reveal the preimage.
227
+ */
228
+ int32 htlc_confirmations = 13;
229
+
230
+ /*
231
+ The latest time (in unix seconds) we allow the server to wait before
232
+ publishing the HTLC on chain. Setting this to a larger value will give the
233
+ server the opportunity to batch multiple swaps together, and wait for
234
+ low-fee periods before publishing the HTLC, potentially resulting in a
235
+ lower total swap fee.
236
+ */
237
+ uint64 swap_publication_deadline = 10;
238
+
239
+ /*
240
+ An optional label for this swap. This field is limited to 500 characters
241
+ and may not start with the prefix [reserved], which is used to tag labels
242
+ produced by the daemon.
243
+ */
244
+ string label = 12;
245
+
246
+ /*
247
+ An optional identification string that will be appended to the user agent
248
+ string sent to the server to give information about the usage of loop. This
249
+ initiator part is meant for user interfaces to add their name to give the
250
+ full picture of the binary used (loopd, LiT) and the method used for
251
+ triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
252
+ */
253
+ string initiator = 14;
254
+
255
+ /*
256
+ An alternative destination address source for the swap. This field
257
+ represents the name of the account in the backing lnd instance.
258
+ Refer to lnd's wallet import functions for reference.
259
+ */
260
+ string account = 15;
261
+
262
+ /*
263
+ The address type of the account specified in the account field.
264
+ */
265
+ AddressType account_addr_type = 16;
266
+
267
+ /*
268
+ A flag indicating whether the defined destination address does not belong to
269
+ the wallet. This is used to flag whether this loop out swap could have its
270
+ associated sweep batched.
271
+ */
272
+ bool is_external_addr = 17;
273
+
274
+ /*
275
+ The reservations to use for the swap. If this field is set, loop will try
276
+ to use the instant out flow using the given reservations. If the
277
+ reservations are not sufficient, the swap will fail. The swap amount must
278
+ be equal to the sum of the amounts of the reservations.
279
+ */
280
+ repeated bytes reservation_ids = 18;
281
+ }
282
+
283
+ /*
284
+ `AddressType` has to be one of:
285
+
286
+ - `unknown`: Unknown address type
287
+ - `p2tr`: Pay to taproot pubkey (`TAPROOT_PUBKEY` = 1)
288
+ */
289
+ enum AddressType {
290
+ ADDRESS_TYPE_UNKNOWN = 0;
291
+ TAPROOT_PUBKEY = 1;
292
+ }
293
+
294
+ message LoopInRequest {
295
+ /*
296
+ Requested swap amount in sat. This does not include the swap and miner
297
+ fee.
298
+ */
299
+ int64 amt = 1;
300
+
301
+ /*
302
+ Maximum we are willing to pay the server for the swap. This value is not
303
+ disclosed in the swap initiation call, but if the server asks for a
304
+ higher fee, we abort the swap. Typically this value is taken from the
305
+ response of the GetQuote call.
306
+ */
307
+ int64 max_swap_fee = 2;
308
+
309
+ /*
310
+ Maximum in on-chain fees that we are willing to spend. If we want to
311
+ publish the on-chain htlc and the fee estimate turns out higher than this
312
+ value, we cancel the swap.
313
+
314
+ max_miner_fee is typically taken from the response of the GetQuote call.
315
+ */
316
+ int64 max_miner_fee = 3;
317
+
318
+ /*
319
+ The last hop to use for the loop in swap. If empty, the last hop is selected
320
+ based on the lowest routing fee for the swap payment from the server.
321
+ */
322
+ bytes last_hop = 4;
323
+
324
+ /*
325
+ If external_htlc is true, we expect the htlc to be published by an external
326
+ actor.
327
+ */
328
+ bool external_htlc = 5;
329
+
330
+ /*
331
+ The number of blocks that the on chain htlc should confirm within.
332
+ */
333
+ int32 htlc_conf_target = 6;
334
+
335
+ /*
336
+ An optional label for this swap. This field is limited to 500 characters
337
+ and may not be one of the reserved values in loop/labels Reserved list.
338
+ */
339
+ string label = 7;
340
+
341
+ /*
342
+ An optional identification string that will be appended to the user agent
343
+ string sent to the server to give information about the usage of loop. This
344
+ initiator part is meant for user interfaces to add their name to give the
345
+ full picture of the binary used (loopd, LiT) and the method used for
346
+ triggering the swap (loop CLI, autolooper, LiT UI, other 3rd party UI).
347
+ */
348
+ string initiator = 8;
349
+
350
+ /*
351
+ Optional route hints to reach the destination through private channels.
352
+ */
353
+ repeated looprpc.RouteHint route_hints = 9;
354
+
355
+ /*
356
+ Private indicates whether the destination node should be considered
357
+ private. In which case, loop will generate hophints to assist with
358
+ probing and payment.
359
+ */
360
+ bool private = 10;
361
+ }
362
+
363
+ message SwapResponse {
364
+ /*
365
+ Swap identifier to track status in the update stream that is returned from
366
+ the Start() call. Currently this is the hash that locks the htlcs.
367
+ DEPRECATED: To make the API more consistent, this field is deprecated in
368
+ favor of id_bytes and will be removed in a future release.
369
+ */
370
+ string id = 1 [deprecated = true];
371
+
372
+ /*
373
+ Swap identifier to track status in the update stream that is returned from
374
+ the Start() call. Currently this is the hash that locks the htlcs.
375
+ */
376
+ bytes id_bytes = 3;
377
+
378
+ /*
379
+ DEPRECATED. This field stores the address of the onchain htlc, but
380
+ depending on the request, the semantics are different.
381
+ - For internal loop-in htlc_address contains the address of the
382
+ native segwit (P2WSH) htlc.
383
+ / - For loop-out htlc_address always contains the native segwit (P2WSH)
384
+ htlc address.
385
+ */
386
+ string htlc_address = 2 [deprecated = true];
387
+
388
+ reserved 4;
389
+
390
+ /*
391
+ The native segwit address of the on-chain htlc.
392
+ Used for both loop-in and loop-out.
393
+ */
394
+ string htlc_address_p2wsh = 5;
395
+
396
+ // The address of the v3 (taproot) htlc. Used for both loop-in and loop-out.
397
+ string htlc_address_p2tr = 7;
398
+
399
+ // A human-readable message received from the loop server.
400
+ string server_message = 6;
401
+ }
402
+
403
+ message MonitorRequest {
404
+ }
405
+
406
+ message SwapStatus {
407
+ /*
408
+ Requested swap amount in sat. This does not include the swap and miner
409
+ fee.
410
+ */
411
+ int64 amt = 1;
412
+
413
+ /*
414
+ Swap identifier to track status in the update stream that is returned from
415
+ the Start() call. Currently this is the hash that locks the htlcs.
416
+ DEPRECATED: To make the API more consistent, this field is deprecated in
417
+ favor of id_bytes and will be removed in a future release.
418
+ */
419
+ string id = 2 [deprecated = true];
420
+
421
+ /*
422
+ Swap identifier to track status in the update stream that is returned from
423
+ the Start() call. Currently this is the hash that locks the htlcs.
424
+ */
425
+ bytes id_bytes = 11;
426
+
427
+ /*
428
+ The type of the swap.
429
+ */
430
+ SwapType type = 3;
431
+
432
+ /*
433
+ State the swap is currently in, see State enum.
434
+ */
435
+ SwapState state = 4;
436
+
437
+ /*
438
+ A failure reason for the swap, only set if the swap has failed.
439
+ */
440
+ FailureReason failure_reason = 14;
441
+
442
+ /*
443
+ Initiation time of the swap.
444
+ */
445
+ int64 initiation_time = 5;
446
+
447
+ /*
448
+ Initiation time of the swap.
449
+ */
450
+ int64 last_update_time = 6;
451
+
452
+ /*
453
+ DEPRECATED: This field stores the address of the onchain htlc.
454
+ - For internal loop-in htlc_address contains the address of the
455
+ native segwit (P2WSH) htlc.
456
+ - For loop-out htlc_address always contains the native segwit (P2WSH)
457
+ htlc address.
458
+ */
459
+ string htlc_address = 7 [deprecated = true];
460
+
461
+ // HTLC address (native segwit), used in loop-in and loop-out swaps.
462
+ string htlc_address_p2wsh = 12;
463
+
464
+ // The address of the v3 (taproot) htlc. Used for both loop-in and loop-out.
465
+ string htlc_address_p2tr = 18;
466
+
467
+ // Swap server cost
468
+ int64 cost_server = 8;
469
+
470
+ // On-chain transaction cost
471
+ int64 cost_onchain = 9;
472
+
473
+ // Off-chain routing fees
474
+ int64 cost_offchain = 10;
475
+
476
+ // Optional last hop if provided in the loop in request.
477
+ bytes last_hop = 16;
478
+
479
+ // Optional outgoing channel set if provided in the loop out request.
480
+ repeated uint64 outgoing_chan_set = 17;
481
+
482
+ // An optional label given to the swap on creation.
483
+ string label = 15;
484
+ }
485
+
486
+ enum SwapType {
487
+ // LOOP_OUT indicates an loop out swap (off-chain to on-chain)
488
+ LOOP_OUT = 0;
489
+
490
+ // LOOP_IN indicates a loop in swap (on-chain to off-chain)
491
+ LOOP_IN = 1;
492
+ }
493
+
494
+ enum SwapState {
495
+ /*
496
+ INITIATED is the initial state of a swap. At that point, the initiation
497
+ call to the server has been made and the payment process has been started
498
+ for the swap and prepayment invoices.
499
+ */
500
+ INITIATED = 0;
501
+
502
+ /*
503
+ PREIMAGE_REVEALED is reached when the sweep tx publication is first
504
+ attempted. From that point on, we should consider the preimage to no
505
+ longer be secret and we need to do all we can to get the sweep confirmed.
506
+ This state will mostly coalesce with StateHtlcConfirmed, except in the
507
+ case where we wait for fees to come down before we sweep.
508
+ */
509
+ PREIMAGE_REVEALED = 1;
510
+
511
+ /*
512
+ HTLC_PUBLISHED is reached when the htlc tx has been published in a loop in
513
+ swap.
514
+ */
515
+ HTLC_PUBLISHED = 2;
516
+
517
+ /*
518
+ SUCCESS is the final swap state that is reached when the sweep tx has
519
+ the required confirmation depth.
520
+ */
521
+ SUCCESS = 3;
522
+
523
+ /*
524
+ FAILED is the final swap state for a failed swap with or without loss of
525
+ the swap amount.
526
+ */
527
+ FAILED = 4;
528
+
529
+ /*
530
+ INVOICE_SETTLED is reached when the swap invoice in a loop in swap has been
531
+ paid, but we are still waiting for the htlc spend to confirm.
532
+ */
533
+ INVOICE_SETTLED = 5;
534
+ }
535
+
536
+ enum FailureReason {
537
+ /*
538
+ FAILURE_REASON_NONE is set when the swap did not fail, it is either in
539
+ progress or succeeded.
540
+ */
541
+ FAILURE_REASON_NONE = 0;
542
+
543
+ /*
544
+ FAILURE_REASON_OFFCHAIN indicates that a loop out failed because it wasn't
545
+ possible to find a route for one or both off chain payments that met the fee
546
+ and timelock limits required.
547
+ */
548
+ FAILURE_REASON_OFFCHAIN = 1;
549
+
550
+ /*
551
+ FAILURE_REASON_TIMEOUT indicates that the swap failed because on chain htlc
552
+ did not confirm before its expiry, or it confirmed too late for us to reveal
553
+ our preimage and claim.
554
+ */
555
+ FAILURE_REASON_TIMEOUT = 2;
556
+
557
+ /*
558
+ FAILURE_REASON_SWEEP_TIMEOUT indicates that a loop out permanently failed
559
+ because the on chain htlc wasn't swept before the server revoked the
560
+ htlc.
561
+ */
562
+ FAILURE_REASON_SWEEP_TIMEOUT = 3;
563
+
564
+ /*
565
+ FAILURE_REASON_INSUFFICIENT_VALUE indicates that a loop out has failed
566
+ because the on chain htlc had a lower value than requested.
567
+ */
568
+ FAILURE_REASON_INSUFFICIENT_VALUE = 4;
569
+
570
+ /*
571
+ FAILURE_REASON_TEMPORARY indicates that a swap cannot continue due to an
572
+ internal error. Manual intervention such as a restart is required.
573
+ */
574
+ FAILURE_REASON_TEMPORARY = 5;
575
+
576
+ /*
577
+ FAILURE_REASON_INCORRECT_AMOUNT indicates that a loop in permanently failed
578
+ because the amount extended by an external loop in htlc is insufficient.
579
+ */
580
+ FAILURE_REASON_INCORRECT_AMOUNT = 6;
581
+
582
+ /*
583
+ FAILURE_REASON_ABANDONED indicates that a swap permanently failed because
584
+ the client manually abandoned the swap.
585
+ */
586
+ FAILURE_REASON_ABANDONED = 7;
587
+
588
+ /*
589
+ FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE indicates that a swap
590
+ wasn't published due to insufficient confirmed balance.
591
+ */
592
+ FAILURE_REASON_INSUFFICIENT_CONFIRMED_BALANCE = 8;
593
+
594
+ /*
595
+ FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT indicates that a swap
596
+ wasn't published due to insufficient confirmed balance.
597
+ */
598
+ FAILURE_REASON_INCORRECT_HTLC_AMT_SWEPT = 9;
599
+ }
600
+
601
+ message ListSwapsRequest {
602
+ // Optional filter to only return swaps that match the filter.
603
+ ListSwapsFilter list_swap_filter = 1;
604
+ }
605
+
606
+ message ListSwapsFilter {
607
+ enum SwapTypeFilter {
608
+ // ANY indicates that no filter is applied.
609
+ ANY = 0;
610
+ // LOOP_OUT indicates an loop out swap (off-chain to on-chain).
611
+ LOOP_OUT = 1;
612
+
613
+ // LOOP_IN indicates a loop in swap (on-chain to off-chain).
614
+ LOOP_IN = 2;
615
+ }
616
+ // The type of the swap.
617
+ SwapTypeFilter swap_type = 1;
618
+
619
+ // If set, only pending swaps are returned.
620
+ bool pending_only = 2;
621
+
622
+ // If specified on creation, the outgoing channel set of the swap.
623
+ repeated uint64 outgoing_chan_set = 3;
624
+
625
+ // Label of swap to filter for.
626
+ string label = 4;
627
+
628
+ // If specified on creation, the last hop of the swap.
629
+ bytes loop_in_last_hop = 5;
630
+ }
631
+
632
+ message ListSwapsResponse {
633
+ /*
634
+ The list of all currently known swaps and their status.
635
+ */
636
+ repeated SwapStatus swaps = 1;
637
+ }
638
+
639
+ message SwapInfoRequest {
640
+ /*
641
+ The swap identifier which currently is the hash that locks the HTLCs. When
642
+ using REST, this field must be encoded as URL safe base64.
643
+ */
644
+ bytes id = 1;
645
+ }
646
+
647
+ message TermsRequest {
648
+ }
649
+
650
+ message InTermsResponse {
651
+ reserved 1, 2, 3, 4, 7;
652
+
653
+ /*
654
+ Minimum swap amount (sat)
655
+ */
656
+ int64 min_swap_amount = 5;
657
+
658
+ /*
659
+ Maximum swap amount (sat)
660
+ */
661
+ int64 max_swap_amount = 6;
662
+ }
663
+
664
+ message OutTermsResponse {
665
+ reserved 1, 2, 3, 4, 7;
666
+
667
+ /*
668
+ Minimum swap amount (sat)
669
+ */
670
+ int64 min_swap_amount = 5;
671
+
672
+ /*
673
+ Maximum swap amount (sat)
674
+ */
675
+ int64 max_swap_amount = 6;
676
+
677
+ // The minimally accepted cltv delta of the on-chain htlc.
678
+ int32 min_cltv_delta = 8;
679
+
680
+ // The maximally accepted cltv delta of the on-chain htlc.
681
+ int32 max_cltv_delta = 9;
682
+ }
683
+
684
+ message QuoteRequest {
685
+ /*
686
+ The amount to swap in satoshis.
687
+ */
688
+ int64 amt = 1;
689
+
690
+ /*
691
+ The confirmation target that should be used either for the sweep of the
692
+ on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for
693
+ the confirmation of the on-chain HTLC broadcast by the swap client in the
694
+ case of a Loop In.
695
+ */
696
+ int32 conf_target = 2;
697
+
698
+ /*
699
+ If external_htlc is true, we expect the htlc to be published by an external
700
+ actor.
701
+ */
702
+ bool external_htlc = 3;
703
+
704
+ /*
705
+ The latest time (in unix seconds) we allow the server to wait before
706
+ publishing the HTLC on chain. Setting this to a larger value will give the
707
+ server the opportunity to batch multiple swaps together, and wait for
708
+ low-fee periods before publishing the HTLC, potentially resulting in a
709
+ lower total swap fee. This only has an effect on loop out quotes.
710
+ */
711
+ uint64 swap_publication_deadline = 4;
712
+
713
+ /*
714
+ Optionally the client can specify the last hop pubkey when requesting a
715
+ loop-in quote. This is useful to get better off-chain routing fee from the
716
+ server.
717
+ */
718
+ bytes loop_in_last_hop = 5;
719
+
720
+ /*
721
+ Optional route hints to reach the destination through private channels.
722
+ */
723
+ repeated looprpc.RouteHint loop_in_route_hints = 6;
724
+
725
+ /*
726
+ Private indicates whether the destination node should be considered
727
+ private. In which case, loop will generate hophints to assist with
728
+ probing and payment.
729
+ */
730
+ bool private = 7;
731
+ }
732
+
733
+ message InQuoteResponse {
734
+ reserved 2, 4;
735
+
736
+ /*
737
+ The fee that the swap server is charging for the swap.
738
+ */
739
+ int64 swap_fee_sat = 1;
740
+
741
+ /*
742
+ An estimate of the on-chain fee that needs to be paid to publish the HTLC
743
+ If a miner fee of 0 is returned, it means the external_htlc flag was set for
744
+ a loop in and the fee estimation was skipped. If a miner fee of -1 is
745
+ returned, it means lnd's wallet tried to estimate the fee but was unable to
746
+ create a sample estimation transaction because not enough funds are
747
+ available. An information message should be shown to the user in this case.
748
+ */
749
+ int64 htlc_publish_fee_sat = 3;
750
+
751
+ /*
752
+ On-chain cltv expiry delta
753
+ */
754
+ int32 cltv_delta = 5;
755
+
756
+ /*
757
+ The confirmation target to be used to publish the on-chain HTLC.
758
+ */
759
+ int32 conf_target = 6;
760
+ }
761
+
762
+ message OutQuoteResponse {
763
+ /*
764
+ The fee that the swap server is charging for the swap.
765
+ */
766
+ int64 swap_fee_sat = 1;
767
+
768
+ /*
769
+ The part of the swap fee that is requested as a prepayment.
770
+ */
771
+ int64 prepay_amt_sat = 2;
772
+
773
+ /*
774
+ An estimate of the on-chain fee that needs to be paid to sweep the HTLC for
775
+ a loop out.
776
+ */
777
+ int64 htlc_sweep_fee_sat = 3;
778
+
779
+ /*
780
+ The node pubkey where the swap payment needs to be paid
781
+ to. This can be used to test connectivity before initiating the swap.
782
+ */
783
+ bytes swap_payment_dest = 4;
784
+
785
+ /*
786
+ On-chain cltv expiry delta
787
+ */
788
+ int32 cltv_delta = 5;
789
+
790
+ /*
791
+ The confirmation target to be used for the sweep of the on-chain HTLC.
792
+ */
793
+ int32 conf_target = 6;
794
+ }
795
+
796
+ message ProbeRequest {
797
+ /*
798
+ The amount to probe.
799
+ */
800
+ int64 amt = 1;
801
+
802
+ /*
803
+ Optional last hop of the route to probe.
804
+ */
805
+ bytes last_hop = 2;
806
+
807
+ /*
808
+ Optional route hints to reach the destination through private channels.
809
+ */
810
+ repeated looprpc.RouteHint route_hints = 3;
811
+ }
812
+
813
+ message ProbeResponse {
814
+ }
815
+
816
+ message TokensRequest {
817
+ }
818
+
819
+ message TokensResponse {
820
+ /*
821
+ List of all tokens the daemon knows of, including old/expired tokens.
822
+ */
823
+ repeated L402Token tokens = 1;
824
+ }
825
+
826
+ message L402Token {
827
+ /*
828
+ The base macaroon that was baked by the auth server.
829
+ */
830
+ bytes base_macaroon = 1;
831
+
832
+ /*
833
+ The payment hash of the payment that was paid to obtain the token.
834
+ */
835
+ bytes payment_hash = 2;
836
+
837
+ /*
838
+ The preimage of the payment hash, knowledge of this is proof that the
839
+ payment has been paid. If the preimage is set to all zeros, this means the
840
+ payment is still pending and the token is not yet fully valid.
841
+ */
842
+ bytes payment_preimage = 3;
843
+
844
+ /*
845
+ The amount of millisatoshis that was paid to get the token.
846
+ */
847
+ int64 amount_paid_msat = 4;
848
+
849
+ /*
850
+ The amount of millisatoshis paid in routing fee to pay for the token.
851
+ */
852
+ int64 routing_fee_paid_msat = 5;
853
+
854
+ /*
855
+ The creation time of the token as UNIX timestamp in seconds.
856
+ */
857
+ int64 time_created = 6;
858
+
859
+ /*
860
+ Indicates whether the token is expired or still valid.
861
+ */
862
+ bool expired = 7;
863
+
864
+ /*
865
+ Identifying attribute of this token in the store. Currently represents the
866
+ file name of the token where it's stored on the file system.
867
+ */
868
+ string storage_name = 8;
869
+
870
+ /*
871
+ The l402 ID of the token.
872
+ */
873
+ string id = 9;
874
+ }
875
+
876
+ message LoopStats {
877
+ /*
878
+ Number of currently pending swaps.
879
+ */
880
+ uint64 pending_count = 1;
881
+
882
+ /*
883
+ Number of succeeded swaps.
884
+ */
885
+ uint64 success_count = 2;
886
+
887
+ /*
888
+ Number failed swaps.
889
+ */
890
+ uint64 fail_count = 3;
891
+
892
+ /*
893
+ The sum of all pending swap amounts.
894
+ */
895
+ int64 sum_pending_amt = 4;
896
+
897
+ /*
898
+ The sum of all succeeded swap amounts.
899
+ */
900
+ int64 sum_succeeded_amt = 5;
901
+ }
902
+
903
+ message GetInfoRequest {
904
+ }
905
+
906
+ message GetInfoResponse {
907
+ /*
908
+ The current daemon version.
909
+ */
910
+ string version = 1;
911
+
912
+ /*
913
+ The network the daemon is running on.
914
+ */
915
+ string network = 2;
916
+
917
+ /*
918
+ Host and port of the loopd grpc server.
919
+ */
920
+ string rpc_listen = 3;
921
+
922
+ /*
923
+ Host and port of the loopd rest server.
924
+ */
925
+ string rest_listen = 4;
926
+
927
+ /*
928
+ Loop's macaroon path that clients use to talk to the daemon.
929
+ */
930
+ string macaroon_path = 5;
931
+
932
+ /*
933
+ Loop's tls cert path
934
+ */
935
+ string tls_cert_path = 6;
936
+
937
+ /*
938
+ Statistics about loop outs.
939
+ */
940
+ LoopStats loop_out_stats = 7;
941
+
942
+ /*
943
+ Statistics about loop ins.
944
+ */
945
+ LoopStats loop_in_stats = 8;
946
+ }
947
+
948
+ message GetLiquidityParamsRequest {
949
+ }
950
+
951
+ message LiquidityParameters {
952
+ /*
953
+ A set of liquidity rules that describe the desired liquidity balance.
954
+ */
955
+ repeated LiquidityRule rules = 1;
956
+
957
+ /*
958
+ The parts per million of swap amount that is allowed to be allocated to swap
959
+ fees. This value is applied across swap categories and may not be set in
960
+ conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay
961
+ routing, max prepay and max miner fee.
962
+ */
963
+ uint64 fee_ppm = 16;
964
+
965
+ /*
966
+ The limit we place on our estimated sweep cost for a swap in sat/vByte. If
967
+ the estimated fee for our sweep transaction within the specified
968
+ confirmation target is above this value, we will not suggest any swaps.
969
+ */
970
+ uint64 sweep_fee_rate_sat_per_vbyte = 2;
971
+
972
+ /*
973
+ The maximum fee paid to the server for facilitating the swap, expressed
974
+ as parts per million of the swap volume.
975
+ */
976
+ uint64 max_swap_fee_ppm = 3;
977
+
978
+ /*
979
+ The maximum fee paid to route the swap invoice off chain, expressed as
980
+ parts per million of the volume being routed.
981
+ */
982
+ uint64 max_routing_fee_ppm = 4;
983
+
984
+ /*
985
+ The maximum fee paid to route the prepay invoice off chain, expressed as
986
+ parts per million of the volume being routed.
987
+ */
988
+ uint64 max_prepay_routing_fee_ppm = 5;
989
+
990
+ /*
991
+ The maximum no-show penalty in satoshis paid for a swap.
992
+ */
993
+ uint64 max_prepay_sat = 6;
994
+
995
+ /*
996
+ The maximum miner fee we will pay to sweep the swap on chain. Note that we
997
+ will not suggest a swap if the estimate is above the sweep limit set by
998
+ these parameters, and we use the current fee estimate to sweep on chain so
999
+ this value is only a cap placed on the amount we spend on fees in the case
1000
+ where the swap needs to be claimed on chain, but fees have suddenly spiked.
1001
+ */
1002
+ uint64 max_miner_fee_sat = 7;
1003
+
1004
+ /*
1005
+ The number of blocks from the on-chain HTLC's confirmation height that it
1006
+ should be swept within.
1007
+ */
1008
+ int32 sweep_conf_target = 8;
1009
+
1010
+ /*
1011
+ The amount of time we require pass since a channel was part of a failed
1012
+ swap due to off chain payment failure until it will be considered for swap
1013
+ suggestions again, expressed in seconds.
1014
+ */
1015
+ uint64 failure_backoff_sec = 9;
1016
+
1017
+ /*
1018
+ Set to true to enable automatic dispatch of swaps. All swaps will be limited
1019
+ to the fee categories set by these parameters, and total expenditure will
1020
+ be limited to the autoloop budget.
1021
+ */
1022
+ bool autoloop = 10;
1023
+
1024
+ /*
1025
+ The total budget for automatically dispatched swaps since the budget start
1026
+ time, expressed in satoshis.
1027
+ */
1028
+ uint64 autoloop_budget_sat = 11;
1029
+
1030
+ /*
1031
+ Deprecated, use autoloop_budget_refresh_period_sec. The start time for
1032
+ autoloop budget, expressed as a unix timestamp in seconds. If this value is
1033
+ 0, the budget will be applied for all automatically dispatched swaps. Swaps
1034
+ that were completed before this date will not be included in budget
1035
+ calculations.
1036
+ */
1037
+ uint64 autoloop_budget_start_sec = 12 [deprecated = true];
1038
+
1039
+ /*
1040
+ The maximum number of automatically dispatched swaps that we allow to be in
1041
+ flight at any point in time.
1042
+ */
1043
+ uint64 auto_max_in_flight = 13;
1044
+
1045
+ /*
1046
+ The minimum amount, expressed in satoshis, that the autoloop client will
1047
+ dispatch a swap for. This value is subject to the server-side limits
1048
+ specified by the LoopOutTerms endpoint.
1049
+ */
1050
+ uint64 min_swap_amount = 14;
1051
+
1052
+ /*
1053
+ The maximum amount, expressed in satoshis, that the autoloop client will
1054
+ dispatch a swap for. This value is subject to the server-side limits
1055
+ specified by the LoopOutTerms endpoint.
1056
+ */
1057
+ uint64 max_swap_amount = 15;
1058
+
1059
+ /*
1060
+ The confirmation target for loop in on-chain htlcs.
1061
+ */
1062
+ int32 htlc_conf_target = 17;
1063
+
1064
+ /*
1065
+ The destination address to use for autoloop loop outs. Set to "default" in
1066
+ order to revert to default behavior.
1067
+ */
1068
+ string autoloop_dest_address = 18;
1069
+
1070
+ /*
1071
+ The period over which the autoloop budget is refreshed, expressed in
1072
+ seconds.
1073
+ */
1074
+ uint64 autoloop_budget_refresh_period_sec = 19;
1075
+
1076
+ /*
1077
+ The time at which the autoloop budget was last refreshed, expressed as a
1078
+ UNIX timestamp in seconds.
1079
+ */
1080
+ uint64 autoloop_budget_last_refresh = 20;
1081
+
1082
+ /*
1083
+ Set to true to enable easy autoloop. If set, all channel/peer rules will be
1084
+ overridden and the client will automatically dispatch swaps in order to meet
1085
+ the configured local balance target size. Currently only loop out is
1086
+ supported, meaning that easy autoloop can only reduce the funds that are
1087
+ held as balance in channels.
1088
+ */
1089
+ bool easy_autoloop = 21;
1090
+
1091
+ /*
1092
+ The local balance target size, expressed in satoshis. This is used by easy
1093
+ autoloop to determine how much liquidity should be maintained in channels.
1094
+ */
1095
+ uint64 easy_autoloop_local_target_sat = 22;
1096
+
1097
+ /*
1098
+ An alternative destination address source for the swap. This field
1099
+ represents the name of the account in the backing lnd instance.
1100
+ Refer to lnd's wallet import functions for reference.
1101
+ */
1102
+ string account = 23;
1103
+
1104
+ /*
1105
+ The address type of the account specified in the account field.
1106
+ */
1107
+ AddressType account_addr_type = 24;
1108
+ }
1109
+
1110
+ enum LiquidityRuleType {
1111
+ UNKNOWN = 0;
1112
+ THRESHOLD = 1;
1113
+ }
1114
+
1115
+ message LiquidityRule {
1116
+ /*
1117
+ The short channel ID of the channel that this rule should be applied to.
1118
+ This field may not be set when the pubkey field is set.
1119
+ */
1120
+ uint64 channel_id = 1;
1121
+
1122
+ // The type of swap that will be dispatched for this rule.
1123
+ SwapType swap_type = 6;
1124
+
1125
+ /*
1126
+ The public key of the peer that this rule should be applied to. This field
1127
+ may not be set when the channel id field is set.
1128
+ */
1129
+ bytes pubkey = 5;
1130
+
1131
+ /*
1132
+ Type indicates the type of rule that this message rule represents. Setting
1133
+ this value will determine which fields are used in the message. The comments
1134
+ on each field in this message will be prefixed with the LiquidityRuleType
1135
+ they belong to.
1136
+ */
1137
+ LiquidityRuleType type = 2;
1138
+
1139
+ /*
1140
+ THRESHOLD: The percentage of total capacity that incoming capacity should
1141
+ not drop beneath.
1142
+ */
1143
+ uint32 incoming_threshold = 3;
1144
+
1145
+ /*
1146
+ THRESHOLD: The percentage of total capacity that outgoing capacity should
1147
+ not drop beneath.
1148
+ */
1149
+ uint32 outgoing_threshold = 4;
1150
+ }
1151
+
1152
+ message SetLiquidityParamsRequest {
1153
+ /*
1154
+ Parameters is the desired new set of parameters for the liquidity management
1155
+ subsystem. Note that the current set of parameters will be completely
1156
+ overwritten by the parameters provided (if they are valid), so the full set
1157
+ of parameters should be provided for each call.
1158
+ */
1159
+ LiquidityParameters parameters = 1;
1160
+ }
1161
+
1162
+ message SetLiquidityParamsResponse {
1163
+ }
1164
+
1165
+ message SuggestSwapsRequest {
1166
+ }
1167
+
1168
+ enum AutoReason {
1169
+ AUTO_REASON_UNKNOWN = 0;
1170
+
1171
+ /*
1172
+ Budget not started indicates that we do not recommend any swaps because
1173
+ the start time for our budget has not arrived yet.
1174
+ */
1175
+ AUTO_REASON_BUDGET_NOT_STARTED = 1;
1176
+
1177
+ /*
1178
+ Sweep fees indicates that the estimated fees to sweep swaps are too high
1179
+ right now.
1180
+ */
1181
+ AUTO_REASON_SWEEP_FEES = 2;
1182
+
1183
+ /*
1184
+ Budget elapsed indicates that the autoloop budget for the period has been
1185
+ elapsed.
1186
+ */
1187
+ AUTO_REASON_BUDGET_ELAPSED = 3;
1188
+
1189
+ /*
1190
+ In flight indicates that the limit on in-flight automatically dispatched
1191
+ swaps has already been reached.
1192
+ */
1193
+ AUTO_REASON_IN_FLIGHT = 4;
1194
+
1195
+ /*
1196
+ Swap fee indicates that the server fee for a specific swap is too high.
1197
+ */
1198
+ AUTO_REASON_SWAP_FEE = 5;
1199
+
1200
+ /*
1201
+ Miner fee indicates that the miner fee for a specific swap is to high.
1202
+ */
1203
+ AUTO_REASON_MINER_FEE = 6;
1204
+
1205
+ /*
1206
+ Prepay indicates that the prepay fee for a specific swap is too high.
1207
+ */
1208
+ AUTO_REASON_PREPAY = 7;
1209
+
1210
+ /*
1211
+ Failure backoff indicates that a swap has recently failed for this target,
1212
+ and the backoff period has not yet passed.
1213
+ */
1214
+ AUTO_REASON_FAILURE_BACKOFF = 8;
1215
+
1216
+ /*
1217
+ Loop out indicates that a loop out swap is currently utilizing the channel,
1218
+ so it is not eligible.
1219
+ */
1220
+ AUTO_REASON_LOOP_OUT = 9;
1221
+
1222
+ /*
1223
+ Loop In indicates that a loop in swap is currently in flight for the peer,
1224
+ so it is not eligible.
1225
+ */
1226
+ AUTO_REASON_LOOP_IN = 10;
1227
+
1228
+ /*
1229
+ Liquidity ok indicates that a target meets the liquidity balance expressed
1230
+ in its rule, so no swap is needed.
1231
+ */
1232
+ AUTO_REASON_LIQUIDITY_OK = 11;
1233
+
1234
+ /*
1235
+ Budget insufficient indicates that we cannot perform a swap because we do
1236
+ not have enough pending budget available. This differs from budget elapsed,
1237
+ because we still have some budget available, but we have allocated it to
1238
+ other swaps.
1239
+ */
1240
+ AUTO_REASON_BUDGET_INSUFFICIENT = 12;
1241
+
1242
+ /*
1243
+ Fee insufficient indicates that the fee estimate for a swap is higher than
1244
+ the portion of total swap amount that we allow fees to consume.
1245
+ */
1246
+ AUTO_REASON_FEE_INSUFFICIENT = 13;
1247
+ }
1248
+
1249
+ message Disqualified {
1250
+ /*
1251
+ The short channel ID of the channel that was excluded from our suggestions.
1252
+ */
1253
+ uint64 channel_id = 1;
1254
+
1255
+ /*
1256
+ The public key of the peer that was excluded from our suggestions.
1257
+ */
1258
+ bytes pubkey = 3;
1259
+
1260
+ /*
1261
+ The reason that we excluded the channel from the our suggestions.
1262
+ */
1263
+ AutoReason reason = 2;
1264
+ }
1265
+
1266
+ message SuggestSwapsResponse {
1267
+ /*
1268
+ The set of recommended loop outs.
1269
+ */
1270
+ repeated LoopOutRequest loop_out = 1;
1271
+
1272
+ /*
1273
+ The set of recommended loop in swaps
1274
+ */
1275
+ repeated LoopInRequest loop_in = 3;
1276
+
1277
+ /*
1278
+ Disqualified contains the set of channels that swaps are not recommended
1279
+ for.
1280
+ */
1281
+ repeated Disqualified disqualified = 2;
1282
+ }
1283
+
1284
+ message AbandonSwapRequest {
1285
+ /*
1286
+ The swap identifier which currently is the hash that locks the HTLCs. When
1287
+ using REST, this field must be encoded as URL safe base64.
1288
+ */
1289
+ bytes id = 1;
1290
+
1291
+ /*
1292
+ A flag that tries to ensure that the client understands that they are
1293
+ risking loss of funds by abandoning a swap. This could happen if an
1294
+ abandoned swap would wait on a timeout sweep by the client.
1295
+ */
1296
+ bool i_know_what_i_am_doing = 2;
1297
+ }
1298
+
1299
+ message AbandonSwapResponse {
1300
+ }
1301
+
1302
+ message ListReservationsRequest {
1303
+ }
1304
+
1305
+ message ListReservationsResponse {
1306
+ /*
1307
+ The list of all currently known reservations and their status.
1308
+ */
1309
+ repeated ClientReservation reservations = 1;
1310
+ }
1311
+
1312
+ message ClientReservation {
1313
+ /*
1314
+ The reservation id that identifies this reservation.
1315
+ */
1316
+ bytes reservation_id = 1;
1317
+
1318
+ /*
1319
+ The state the reservation is in.
1320
+ */
1321
+ string state = 2;
1322
+ /*
1323
+ The amount that the reservation is for.
1324
+ */
1325
+ uint64 amount = 3;
1326
+ /*
1327
+ The transaction id of the reservation.
1328
+ */
1329
+ string tx_id = 4;
1330
+ /*
1331
+ The vout of the reservation.
1332
+ */
1333
+ uint32 vout = 5;
1334
+ /*
1335
+ The expiry of the reservation.
1336
+ */
1337
+ uint32 expiry = 6;
1338
+ }
1339
+
1340
+ message InstantOutRequest {
1341
+ /*
1342
+ The reservations to use for the swap.
1343
+ */
1344
+ repeated bytes reservation_ids = 1;
1345
+
1346
+ /*
1347
+ A restriction on the channel set that may be used to loop out. The actual
1348
+ channel(s) that will be used are selected based on the lowest routing fee
1349
+ for the swap payment to the server.
1350
+ */
1351
+ repeated uint64 outgoing_chan_set = 2;
1352
+
1353
+ /*
1354
+ An optional address to sweep the onchain funds to. If not set, the funds
1355
+ will be swept to the wallet's internal address.
1356
+ */
1357
+ string dest_addr = 3;
1358
+ }
1359
+
1360
+ message InstantOutResponse {
1361
+ /*
1362
+ The hash of the swap preimage.
1363
+ */
1364
+ bytes instant_out_hash = 1;
1365
+ /*
1366
+ The transaction id of the sweep transaction.
1367
+ */
1368
+ string sweep_tx_id = 2;
1369
+ /*
1370
+ The state of the swap.
1371
+ */
1372
+ string state = 3;
1373
+ }
1374
+
1375
+ message InstantOutQuoteRequest {
1376
+ /*
1377
+ The amount to swap in satoshis.
1378
+ */
1379
+ uint64 amt = 1;
1380
+
1381
+ /*
1382
+ The amount of reservations to use for the swap.
1383
+ */
1384
+ int32 num_reservations = 2;
1385
+ }
1386
+
1387
+ message InstantOutQuoteResponse {
1388
+ /*
1389
+ The fee that the swap service is charging for the swap.
1390
+ */
1391
+ int64 service_fee_sat = 1;
1392
+
1393
+ /*
1394
+ The estimated on-chain fee that needs to be paid to publish the Sweepless
1395
+ Sweep.
1396
+ */
1397
+ int64 sweep_fee_sat = 2;
1398
+ }
1399
+
1400
+ message ListInstantOutsRequest {
1401
+ }
1402
+
1403
+ message ListInstantOutsResponse {
1404
+ /*
1405
+ The list of all currently known instant out swaps and their status.
1406
+ */
1407
+ repeated InstantOut swaps = 1;
1408
+ }
1409
+
1410
+ message InstantOut {
1411
+ /*
1412
+ The swap hash that identifies this swap.
1413
+ */
1414
+ bytes swap_hash = 1;
1415
+
1416
+ /*
1417
+ The state the swap is in.
1418
+ */
1419
+ string state = 2;
1420
+
1421
+ /*
1422
+ The amount of the swap.
1423
+ */
1424
+ uint64 amount = 3;
1425
+
1426
+ /*
1427
+ The used reservations for the swap.
1428
+ */
1429
+ repeated bytes reservation_ids = 4;
1430
+
1431
+ /*
1432
+ The sweep transaction id of the swap.
1433
+ */
1434
+ string sweep_tx_id = 5;
1435
+ }