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,1594 @@
1
+ syntax = "proto3";
2
+
3
+ package walletrpc;
4
+
5
+ import "lightning.proto";
6
+ import "signrpc/signer.proto";
7
+
8
+ option go_package = "github.com/lightningnetwork/lnd/lnrpc/walletrpc";
9
+
10
+ /*
11
+ * Comments in this file will be directly parsed into the API
12
+ * Documentation as descriptions of the associated method, message, or field.
13
+ * These descriptions should go right above the definition of the object, and
14
+ * can be in either block or // comment format.
15
+ *
16
+ * An RPC method can be matched to an lncli command by placing a line in the
17
+ * beginning of the description in exactly the following format:
18
+ * lncli: `methodname`
19
+ *
20
+ * Failure to specify the exact name of the command will cause documentation
21
+ * generation to fail.
22
+ *
23
+ * More information on how exactly the gRPC documentation is generated from
24
+ * this proto file can be found here:
25
+ * https://github.com/lightninglabs/lightning-api
26
+ */
27
+
28
+ // WalletKit is a service that gives access to the core functionalities of the
29
+ // daemon's wallet.
30
+ service WalletKit {
31
+ /*
32
+ ListUnspent returns a list of all utxos spendable by the wallet with a
33
+ number of confirmations between the specified minimum and maximum. By
34
+ default, all utxos are listed. To list only the unconfirmed utxos, set
35
+ the unconfirmed_only to true.
36
+ */
37
+ rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse);
38
+
39
+ /* lncli: `wallet leaseoutput`
40
+ LeaseOutput locks an output to the given ID, preventing it from being
41
+ available for any future coin selection attempts. The absolute time of the
42
+ lock's expiration is returned. The expiration of the lock can be extended by
43
+ successive invocations of this RPC. Outputs can be unlocked before their
44
+ expiration through `ReleaseOutput`.
45
+ */
46
+ rpc LeaseOutput (LeaseOutputRequest) returns (LeaseOutputResponse);
47
+
48
+ /* lncli: `wallet releaseoutput`
49
+ ReleaseOutput unlocks an output, allowing it to be available for coin
50
+ selection if it remains unspent. The ID should match the one used to
51
+ originally lock the output.
52
+ */
53
+ rpc ReleaseOutput (ReleaseOutputRequest) returns (ReleaseOutputResponse);
54
+
55
+ /* lncli: `wallet listleases`
56
+ ListLeases lists all currently locked utxos.
57
+ */
58
+ rpc ListLeases (ListLeasesRequest) returns (ListLeasesResponse);
59
+
60
+ /*
61
+ DeriveNextKey attempts to derive the *next* key within the key family
62
+ (account in BIP43) specified. This method should return the next external
63
+ child within this branch.
64
+ */
65
+ rpc DeriveNextKey (KeyReq) returns (signrpc.KeyDescriptor);
66
+
67
+ /*
68
+ DeriveKey attempts to derive an arbitrary key specified by the passed
69
+ KeyLocator.
70
+ */
71
+ rpc DeriveKey (signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
72
+
73
+ /*
74
+ NextAddr returns the next unused address within the wallet.
75
+ */
76
+ rpc NextAddr (AddrRequest) returns (AddrResponse);
77
+
78
+ /* lncli: `wallet gettx`
79
+ GetTransaction returns details for a transaction found in the wallet.
80
+ */
81
+ rpc GetTransaction (GetTransactionRequest) returns (lnrpc.Transaction);
82
+
83
+ /* lncli: `wallet accounts list`
84
+ ListAccounts retrieves all accounts belonging to the wallet by default. A
85
+ name and key scope filter can be provided to filter through all of the
86
+ wallet accounts and return only those matching.
87
+ */
88
+ rpc ListAccounts (ListAccountsRequest) returns (ListAccountsResponse);
89
+
90
+ /* lncli: `wallet requiredreserve`
91
+ RequiredReserve returns the minimum amount of satoshis that should be kept
92
+ in the wallet in order to fee bump anchor channels if necessary. The value
93
+ scales with the number of public anchor channels but is capped at a maximum.
94
+ */
95
+ rpc RequiredReserve (RequiredReserveRequest)
96
+ returns (RequiredReserveResponse);
97
+
98
+ /* lncli: `wallet addresses list`
99
+ ListAddresses retrieves all the addresses along with their balance. An
100
+ account name filter can be provided to filter through all of the
101
+ wallet accounts and return the addresses of only those matching.
102
+ */
103
+ rpc ListAddresses (ListAddressesRequest) returns (ListAddressesResponse);
104
+
105
+ /* lncli: `wallet addresses signmessage`
106
+ SignMessageWithAddr returns the compact signature (base64 encoded) created
107
+ with the private key of the provided address. This requires the address
108
+ to be solely based on a public key lock (no scripts). Obviously the internal
109
+ lnd wallet has to possess the private key of the address otherwise
110
+ an error is returned.
111
+
112
+ This method aims to provide full compatibility with the bitcoin-core and
113
+ btcd implementation. Bitcoin-core's algorithm is not specified in a
114
+ BIP and only applicable for legacy addresses. This method enhances the
115
+ signing for additional address types: P2WKH, NP2WKH, P2TR.
116
+ For P2TR addresses this represents a special case. ECDSA is used to create
117
+ a compact signature which makes the public key of the signature recoverable.
118
+ */
119
+ rpc SignMessageWithAddr (SignMessageWithAddrRequest)
120
+ returns (SignMessageWithAddrResponse);
121
+
122
+ /* lncli: `wallet addresses verifymessage`
123
+ VerifyMessageWithAddr returns the validity and the recovered public key of
124
+ the provided compact signature (base64 encoded). The verification is
125
+ twofold. First the validity of the signature itself is checked and then
126
+ it is verified that the recovered public key of the signature equals
127
+ the public key of the provided address. There is no dependence on the
128
+ private key of the address therefore also external addresses are allowed
129
+ to verify signatures.
130
+ Supported address types are P2PKH, P2WKH, NP2WKH, P2TR.
131
+
132
+ This method is the counterpart of the related signing method
133
+ (SignMessageWithAddr) and aims to provide full compatibility to
134
+ bitcoin-core's implementation. Although bitcoin-core/btcd only provide
135
+ this functionality for legacy addresses this function enhances it to
136
+ the address types: P2PKH, P2WKH, NP2WKH, P2TR.
137
+
138
+ The verification for P2TR addresses is a special case and requires the
139
+ ECDSA compact signature to compare the reovered public key to the internal
140
+ taproot key. The compact ECDSA signature format was used because there
141
+ are still no known compact signature schemes for schnorr signatures.
142
+ */
143
+ rpc VerifyMessageWithAddr (VerifyMessageWithAddrRequest)
144
+ returns (VerifyMessageWithAddrResponse);
145
+
146
+ /* lncli: `wallet accounts import`
147
+ ImportAccount imports an account backed by an account extended public key.
148
+ The master key fingerprint denotes the fingerprint of the root key
149
+ corresponding to the account public key (also known as the key with
150
+ derivation path m/). This may be required by some hardware wallets for
151
+ proper identification and signing.
152
+
153
+ The address type can usually be inferred from the key's version, but may be
154
+ required for certain keys to map them into the proper scope.
155
+
156
+ For BIP-0044 keys, an address type must be specified as we intend to not
157
+ support importing BIP-0044 keys into the wallet using the legacy
158
+ pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force
159
+ the standard BIP-0049 derivation scheme, while a witness address type will
160
+ force the standard BIP-0084 derivation scheme.
161
+
162
+ For BIP-0049 keys, an address type must also be specified to make a
163
+ distinction between the standard BIP-0049 address schema (nested witness
164
+ pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys
165
+ externally, witness pubkeys internally).
166
+
167
+ NOTE: Events (deposits/spends) for keys derived from an account will only be
168
+ detected by lnd if they happen after the import. Rescans to detect past
169
+ events will be supported later on.
170
+ */
171
+ rpc ImportAccount (ImportAccountRequest) returns (ImportAccountResponse);
172
+
173
+ /* lncli: `wallet accounts import-pubkey`
174
+ ImportPublicKey imports a public key as watch-only into the wallet. The
175
+ public key is converted into a simple address of the given type and that
176
+ address script is watched on chain. For Taproot keys, this will only watch
177
+ the BIP-0086 style output script. Use ImportTapscript for more advanced key
178
+ spend or script spend outputs.
179
+
180
+ NOTE: Events (deposits/spends) for a key will only be detected by lnd if
181
+ they happen after the import. Rescans to detect past events will be
182
+ supported later on.
183
+ */
184
+ rpc ImportPublicKey (ImportPublicKeyRequest)
185
+ returns (ImportPublicKeyResponse);
186
+
187
+ /*
188
+ ImportTapscript imports a Taproot script and internal key and adds the
189
+ resulting Taproot output key as a watch-only output script into the wallet.
190
+ For BIP-0086 style Taproot keys (no root hash commitment and no script spend
191
+ path) use ImportPublicKey.
192
+
193
+ NOTE: Events (deposits/spends) for a key will only be detected by lnd if
194
+ they happen after the import. Rescans to detect past events will be
195
+ supported later on.
196
+
197
+ NOTE: Taproot keys imported through this RPC currently _cannot_ be used for
198
+ funding PSBTs. Only tracking the balance and UTXOs is currently supported.
199
+ */
200
+ rpc ImportTapscript (ImportTapscriptRequest)
201
+ returns (ImportTapscriptResponse);
202
+
203
+ /* lncli: `wallet publishtx`
204
+ PublishTransaction attempts to publish the passed transaction to the
205
+ network. Once this returns without an error, the wallet will continually
206
+ attempt to re-broadcast the transaction on start up, until it enters the
207
+ chain.
208
+ */
209
+ rpc PublishTransaction (Transaction) returns (PublishResponse);
210
+
211
+ /* lncli: `wallet removetx`
212
+ RemoveTransaction attempts to remove the provided transaction from the
213
+ internal transaction store of the wallet.
214
+ */
215
+ rpc RemoveTransaction (GetTransactionRequest)
216
+ returns (RemoveTransactionResponse);
217
+
218
+ /*
219
+ SendOutputs is similar to the existing sendmany call in Bitcoind, and
220
+ allows the caller to create a transaction that sends to several outputs at
221
+ once. This is ideal when wanting to batch create a set of transactions.
222
+ */
223
+ rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);
224
+
225
+ /* lncli: `wallet estimatefeerate`
226
+ EstimateFee attempts to query the internal fee estimator of the wallet to
227
+ determine the fee (in sat/kw) to attach to a transaction in order to
228
+ achieve the confirmation target.
229
+ */
230
+ rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
231
+
232
+ /* lncli: `wallet pendingsweeps`
233
+ PendingSweeps returns lists of on-chain outputs that lnd is currently
234
+ attempting to sweep within its central batching engine. Outputs with similar
235
+ fee rates are batched together in order to sweep them within a single
236
+ transaction.
237
+
238
+ NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to
239
+ remain supported. This is an advanced API that depends on the internals of
240
+ the UtxoSweeper, so things may change.
241
+ */
242
+ rpc PendingSweeps (PendingSweepsRequest) returns (PendingSweepsResponse);
243
+
244
+ /* lncli: `wallet bumpfee`
245
+ BumpFee is an endpoint that allows users to interact with lnd's sweeper
246
+ directly. It takes an outpoint from an unconfirmed transaction and sends it
247
+ to the sweeper for potential fee bumping. Depending on whether the outpoint
248
+ has been registered in the sweeper (an existing input, e.g., an anchor
249
+ output) or not (a new input, e.g., an unconfirmed wallet utxo), this will
250
+ either be an RBF or CPFP attempt.
251
+
252
+ When receiving an input, lnd’s sweeper needs to understand its time
253
+ sensitivity to make economical fee bumps - internally a fee function is
254
+ created using the deadline and budget to guide the process. When the
255
+ deadline is approaching, the fee function will increase the fee rate and
256
+ perform an RBF.
257
+
258
+ When a force close happens, all the outputs from the force closing
259
+ transaction will be registered in the sweeper. The sweeper will then handle
260
+ the creation, publish, and fee bumping of the sweeping transactions.
261
+ Everytime a new block comes in, unless the sweeping transaction is
262
+ confirmed, an RBF is attempted. To interfere with this automatic process,
263
+ users can use BumpFee to specify customized fee rate, budget, deadline, and
264
+ whether the sweep should happen immediately. It's recommended to call
265
+ `ListSweeps` to understand the shape of the existing sweeping transaction
266
+ first - depending on the number of inputs in this transaction, the RBF
267
+ requirements can be quite different.
268
+
269
+ This RPC also serves useful when wanting to perform a Child-Pays-For-Parent
270
+ (CPFP), where the child transaction pays for its parent's fee. This can be
271
+ done by specifying an outpoint within the low fee transaction that is under
272
+ the control of the wallet.
273
+ */
274
+ rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse);
275
+
276
+ /* lncli: `wallet bumpforceclosefee`
277
+ BumpForceCloseFee is an endpoint that allows users to bump the fee of a
278
+ channel force close. This only works for channels with option_anchors.
279
+ */
280
+ rpc BumpForceCloseFee (BumpForceCloseFeeRequest)
281
+ returns (BumpForceCloseFeeResponse);
282
+
283
+ /* lncli: `wallet listsweeps`
284
+ ListSweeps returns a list of the sweep transactions our node has produced.
285
+ Note that these sweeps may not be confirmed yet, as we record sweeps on
286
+ broadcast, not confirmation.
287
+ */
288
+ rpc ListSweeps (ListSweepsRequest) returns (ListSweepsResponse);
289
+
290
+ /* lncli: `wallet labeltx`
291
+ LabelTransaction adds a label to a transaction. If the transaction already
292
+ has a label the call will fail unless the overwrite bool is set. This will
293
+ overwrite the existing transaction label. Labels must not be empty, and
294
+ cannot exceed 500 characters.
295
+ */
296
+ rpc LabelTransaction (LabelTransactionRequest)
297
+ returns (LabelTransactionResponse);
298
+
299
+ /* lncli: `wallet psbt fund`
300
+ FundPsbt creates a fully populated PSBT that contains enough inputs to fund
301
+ the outputs specified in the template. There are three ways a user can
302
+ specify what we call the template (a list of inputs and outputs to use in
303
+ the PSBT): Either as a PSBT packet directly with no coin selection (using
304
+ the legacy "psbt" field), a PSBT with advanced coin selection support (using
305
+ the new "coin_select" field) or as a raw RPC message (using the "raw"
306
+ field).
307
+ The legacy "psbt" and "raw" modes, the following restrictions apply:
308
+ 1. If there are no inputs specified in the template, coin selection is
309
+ performed automatically.
310
+ 2. If the template does contain any inputs, it is assumed that full
311
+ coin selection happened externally and no additional inputs are added. If
312
+ the specified inputs aren't enough to fund the outputs with the given fee
313
+ rate, an error is returned.
314
+
315
+ The new "coin_select" mode does not have these restrictions and allows the
316
+ user to specify a PSBT with inputs and outputs and still perform coin
317
+ selection on top of that.
318
+ For all modes this RPC requires any inputs that are specified to be locked
319
+ by the user (if they belong to this node in the first place).
320
+
321
+ After either selecting or verifying the inputs, all input UTXOs are locked
322
+ with an internal app ID.
323
+
324
+ NOTE: If this method returns without an error, it is the caller's
325
+ responsibility to either spend the locked UTXOs (by finalizing and then
326
+ publishing the transaction) or to unlock/release the locked UTXOs in case of
327
+ an error on the caller's side.
328
+ */
329
+ rpc FundPsbt (FundPsbtRequest) returns (FundPsbtResponse);
330
+
331
+ /*
332
+ SignPsbt expects a partial transaction with all inputs and outputs fully
333
+ declared and tries to sign all unsigned inputs that have all required fields
334
+ (UTXO information, BIP32 derivation information, witness or sig scripts)
335
+ set.
336
+ If no error is returned, the PSBT is ready to be given to the next signer or
337
+ to be finalized if lnd was the last signer.
338
+
339
+ NOTE: This RPC only signs inputs (and only those it can sign), it does not
340
+ perform any other tasks (such as coin selection, UTXO locking or
341
+ input/output/fee value validation, PSBT finalization). Any input that is
342
+ incomplete will be skipped.
343
+ */
344
+ rpc SignPsbt (SignPsbtRequest) returns (SignPsbtResponse);
345
+
346
+ /* lncli: `wallet psbt finalize`
347
+ FinalizePsbt expects a partial transaction with all inputs and outputs fully
348
+ declared and tries to sign all inputs that belong to the wallet. Lnd must be
349
+ the last signer of the transaction. That means, if there are any unsigned
350
+ non-witness inputs or inputs without UTXO information attached or inputs
351
+ without witness data that do not belong to lnd's wallet, this method will
352
+ fail. If no error is returned, the PSBT is ready to be extracted and the
353
+ final TX within to be broadcast.
354
+
355
+ NOTE: This method does NOT publish the transaction once finalized. It is the
356
+ caller's responsibility to either publish the transaction on success or
357
+ unlock/release any locked UTXOs in case of an error in this method.
358
+ */
359
+ rpc FinalizePsbt (FinalizePsbtRequest) returns (FinalizePsbtResponse);
360
+ }
361
+
362
+ message ListUnspentRequest {
363
+ // The minimum number of confirmations to be included.
364
+ int32 min_confs = 1;
365
+
366
+ // The maximum number of confirmations to be included.
367
+ int32 max_confs = 2;
368
+
369
+ // An optional filter to only include outputs belonging to an account.
370
+ string account = 3;
371
+
372
+ /*
373
+ When min_confs and max_confs are zero, setting false implicitly
374
+ overrides max_confs to be MaxInt32, otherwise max_confs remains
375
+ zero. An error is returned if the value is true and both min_confs
376
+ and max_confs are non-zero. (default: false)
377
+ */
378
+ bool unconfirmed_only = 4;
379
+ }
380
+
381
+ message ListUnspentResponse {
382
+ // A list of utxos satisfying the specified number of confirmations.
383
+ repeated lnrpc.Utxo utxos = 1;
384
+ }
385
+
386
+ message LeaseOutputRequest {
387
+ /*
388
+ An ID of 32 random bytes that must be unique for each distinct application
389
+ using this RPC which will be used to bound the output lease to.
390
+ */
391
+ bytes id = 1;
392
+
393
+ // The identifying outpoint of the output being leased.
394
+ lnrpc.OutPoint outpoint = 2;
395
+
396
+ // The time in seconds before the lock expires. If set to zero, the default
397
+ // lock duration is used.
398
+ uint64 expiration_seconds = 3;
399
+ }
400
+
401
+ message LeaseOutputResponse {
402
+ /*
403
+ The absolute expiration of the output lease represented as a unix timestamp.
404
+ */
405
+ uint64 expiration = 1;
406
+ }
407
+
408
+ message ReleaseOutputRequest {
409
+ // The unique ID that was used to lock the output.
410
+ bytes id = 1;
411
+
412
+ // The identifying outpoint of the output being released.
413
+ lnrpc.OutPoint outpoint = 2;
414
+ }
415
+
416
+ message ReleaseOutputResponse {
417
+ // The status of the release operation.
418
+ string status = 1;
419
+ }
420
+
421
+ message KeyReq {
422
+ /*
423
+ Is the key finger print of the root pubkey that this request is targeting.
424
+ This allows the WalletKit to possibly serve out keys for multiple HD chains
425
+ via public derivation.
426
+ */
427
+ int32 key_finger_print = 1;
428
+
429
+ /*
430
+ The target key family to derive a key from. In other contexts, this is
431
+ known as the "account".
432
+ */
433
+ int32 key_family = 2;
434
+ }
435
+
436
+ message AddrRequest {
437
+ /*
438
+ The name of the account to retrieve the next address of. If empty, the
439
+ default wallet account is used.
440
+ */
441
+ string account = 1;
442
+
443
+ /*
444
+ The type of address to derive.
445
+ */
446
+ AddressType type = 2;
447
+
448
+ /*
449
+ Whether a change address should be derived.
450
+ */
451
+ bool change = 3;
452
+ }
453
+ message AddrResponse {
454
+ /*
455
+ The address encoded using a bech32 format.
456
+ */
457
+ string addr = 1;
458
+ }
459
+
460
+ enum AddressType {
461
+ UNKNOWN = 0;
462
+ WITNESS_PUBKEY_HASH = 1;
463
+ NESTED_WITNESS_PUBKEY_HASH = 2;
464
+ HYBRID_NESTED_WITNESS_PUBKEY_HASH = 3;
465
+ TAPROOT_PUBKEY = 4;
466
+ }
467
+ message Account {
468
+ // The name used to identify the account.
469
+ string name = 1;
470
+
471
+ // The type of addresses the account supports.
472
+ AddressType address_type = 2;
473
+
474
+ /*
475
+ The public key backing the account that all keys are derived from
476
+ represented as an extended key. This will always be empty for the default
477
+ imported account in which single public keys are imported into.
478
+ */
479
+ string extended_public_key = 3;
480
+
481
+ /*
482
+ The fingerprint of the root key from which the account public key was
483
+ derived from. This will always be zero for the default imported account in
484
+ which single public keys are imported into. The bytes are in big-endian
485
+ order.
486
+ */
487
+ bytes master_key_fingerprint = 4;
488
+
489
+ /*
490
+ The derivation path corresponding to the account public key. This will
491
+ always be empty for the default imported account in which single public keys
492
+ are imported into.
493
+ */
494
+ string derivation_path = 5;
495
+
496
+ /*
497
+ The number of keys derived from the external branch of the account public
498
+ key. This will always be zero for the default imported account in which
499
+ single public keys are imported into.
500
+ */
501
+ uint32 external_key_count = 6;
502
+
503
+ /*
504
+ The number of keys derived from the internal branch of the account public
505
+ key. This will always be zero for the default imported account in which
506
+ single public keys are imported into.
507
+ */
508
+ uint32 internal_key_count = 7;
509
+
510
+ // Whether the wallet stores private keys for the account.
511
+ bool watch_only = 8;
512
+ }
513
+
514
+ message AddressProperty {
515
+ /*
516
+ The address encoded using the appropriate format depending on the
517
+ address type (base58, bech32, bech32m).
518
+
519
+ Note that lnd's internal/custom keys for channels and other
520
+ functionality are derived from the same scope. Since they
521
+ aren't really used as addresses and will never have an
522
+ on-chain balance, we'll show the public key instead (only if
523
+ the show_custom_accounts flag is provided).
524
+ */
525
+ string address = 1;
526
+
527
+ // Denotes if the address is a change address.
528
+ bool is_internal = 2;
529
+
530
+ // The balance of the address.
531
+ int64 balance = 3;
532
+
533
+ // The full derivation path of the address. This will be empty for imported
534
+ // addresses.
535
+ string derivation_path = 4;
536
+
537
+ // The public key of the address. This will be empty for imported addresses.
538
+ bytes public_key = 5;
539
+ }
540
+
541
+ message AccountWithAddresses {
542
+ // The name used to identify the account.
543
+ string name = 1;
544
+
545
+ // The type of addresses the account supports.
546
+ AddressType address_type = 2;
547
+
548
+ /*
549
+ The derivation path corresponding to the account public key. This will
550
+ always be empty for the default imported account in which single public keys
551
+ are imported into.
552
+ */
553
+ string derivation_path = 3;
554
+
555
+ /*
556
+ List of address, its type internal/external & balance.
557
+ Note that the order of addresses will be random and not according to the
558
+ derivation index, since that information is not stored by the underlying
559
+ wallet.
560
+ */
561
+ repeated AddressProperty addresses = 4;
562
+ }
563
+
564
+ message ListAccountsRequest {
565
+ // An optional filter to only return accounts matching this name.
566
+ string name = 1;
567
+
568
+ // An optional filter to only return accounts matching this address type.
569
+ AddressType address_type = 2;
570
+ }
571
+
572
+ message ListAccountsResponse {
573
+ repeated Account accounts = 1;
574
+ }
575
+
576
+ message RequiredReserveRequest {
577
+ // The number of additional channels the user would like to open.
578
+ uint32 additional_public_channels = 1;
579
+ }
580
+
581
+ message RequiredReserveResponse {
582
+ // The amount of reserve required.
583
+ int64 required_reserve = 1;
584
+ }
585
+
586
+ message ListAddressesRequest {
587
+ // An optional filter to only return addresses matching this account.
588
+ string account_name = 1;
589
+
590
+ // An optional flag to return LND's custom accounts (Purpose=1017)
591
+ // public key along with other addresses.
592
+ bool show_custom_accounts = 2;
593
+ }
594
+
595
+ message ListAddressesResponse {
596
+ // A list of all the accounts and their addresses.
597
+ repeated AccountWithAddresses account_with_addresses = 1;
598
+ }
599
+
600
+ message GetTransactionRequest {
601
+ // The txid of the transaction.
602
+ string txid = 1;
603
+ }
604
+
605
+ message SignMessageWithAddrRequest {
606
+ // The message to be signed. When using REST, this field must be encoded as
607
+ // base64.
608
+ bytes msg = 1;
609
+
610
+ // The address which will be used to look up the private key and sign the
611
+ // corresponding message.
612
+ string addr = 2;
613
+ }
614
+
615
+ message SignMessageWithAddrResponse {
616
+ // The compact ECDSA signature for the given message encoded in base64.
617
+ string signature = 1;
618
+ }
619
+
620
+ message VerifyMessageWithAddrRequest {
621
+ // The message to be signed. When using REST, this field must be encoded as
622
+ // base64.
623
+ bytes msg = 1;
624
+
625
+ // The compact ECDSA signature to be verified over the given message
626
+ // ecoded in base64.
627
+ string signature = 2;
628
+
629
+ // The address which will be used to look up the public key and verify the
630
+ // the signature.
631
+ string addr = 3;
632
+ }
633
+
634
+ message VerifyMessageWithAddrResponse {
635
+ // Whether the signature was valid over the given message.
636
+ bool valid = 1;
637
+
638
+ // The pubkey recovered from the signature.
639
+ bytes pubkey = 2;
640
+ }
641
+
642
+ message ImportAccountRequest {
643
+ // A name to identify the account with.
644
+ string name = 1;
645
+
646
+ /*
647
+ A public key that corresponds to a wallet account represented as an extended
648
+ key. It must conform to a derivation path of the form
649
+ m/purpose'/coin_type'/account'.
650
+ */
651
+ string extended_public_key = 2;
652
+
653
+ /*
654
+ The fingerprint of the root key (also known as the key with derivation path
655
+ m/) from which the account public key was derived from. This may be required
656
+ by some hardware wallets for proper identification and signing. The bytes
657
+ must be in big-endian order.
658
+ */
659
+ bytes master_key_fingerprint = 3;
660
+
661
+ /*
662
+ An address type is only required when the extended account public key has a
663
+ legacy version (xpub, tpub, etc.), such that the wallet cannot detect what
664
+ address scheme it belongs to.
665
+ */
666
+ AddressType address_type = 4;
667
+
668
+ /*
669
+ Whether a dry run should be attempted when importing the account. This
670
+ serves as a way to confirm whether the account is being imported correctly
671
+ by returning the first N addresses for the external and internal branches of
672
+ the account. If these addresses match as expected, then it should be safe to
673
+ import the account as is.
674
+ */
675
+ bool dry_run = 5;
676
+ }
677
+ message ImportAccountResponse {
678
+ // The details of the imported account.
679
+ Account account = 1;
680
+
681
+ /*
682
+ The first N addresses that belong to the external branch of the account.
683
+ The external branch is typically used for external non-change addresses.
684
+ These are only returned if a dry run was specified within the request.
685
+ */
686
+ repeated string dry_run_external_addrs = 2;
687
+
688
+ /*
689
+ The first N addresses that belong to the internal branch of the account.
690
+ The internal branch is typically used for change addresses. These are only
691
+ returned if a dry run was specified within the request.
692
+ */
693
+ repeated string dry_run_internal_addrs = 3;
694
+ }
695
+
696
+ message ImportPublicKeyRequest {
697
+ // A compressed public key represented as raw bytes.
698
+ bytes public_key = 1;
699
+
700
+ // The type of address that will be generated from the public key.
701
+ AddressType address_type = 2;
702
+ }
703
+ message ImportPublicKeyResponse {
704
+ // The status of the import operation.
705
+ string status = 1;
706
+ }
707
+
708
+ message ImportTapscriptRequest {
709
+ /*
710
+ The internal public key, serialized as 32-byte x-only public key.
711
+ */
712
+ bytes internal_public_key = 1;
713
+
714
+ oneof script {
715
+ /*
716
+ The full script tree with all individual leaves is known and the root
717
+ hash can be constructed from the full tree directly.
718
+ */
719
+ TapscriptFullTree full_tree = 2;
720
+
721
+ /*
722
+ Only a single script leaf is known. To construct the root hash, the full
723
+ inclusion proof must also be provided.
724
+ */
725
+ TapscriptPartialReveal partial_reveal = 3;
726
+
727
+ /*
728
+ Only the root hash of the Taproot script tree (or other form of Taproot
729
+ commitment) is known.
730
+ */
731
+ bytes root_hash_only = 4;
732
+
733
+ /*
734
+ Only the final, tweaked Taproot key is known and no additional
735
+ information about the internal key or type of tweak that was used to
736
+ derive it. When this is set, the wallet treats the key in
737
+ internal_public_key as the Taproot key directly. This can be useful for
738
+ tracking arbitrary Taproot outputs without the goal of ever being able
739
+ to spend from them through the internal wallet.
740
+ */
741
+ bool full_key_only = 5;
742
+ }
743
+ }
744
+
745
+ message TapscriptFullTree {
746
+ /*
747
+ The complete, ordered list of all tap leaves of the tree.
748
+ */
749
+ repeated TapLeaf all_leaves = 1;
750
+ }
751
+
752
+ message TapLeaf {
753
+ // The leaf version. Should be 0xc0 (192) in case of a SegWit v1 script.
754
+ uint32 leaf_version = 1;
755
+
756
+ // The script of the tap leaf.
757
+ bytes script = 2;
758
+ }
759
+
760
+ message TapscriptPartialReveal {
761
+ // The tap leaf that is known and will be revealed.
762
+ TapLeaf revealed_leaf = 1;
763
+
764
+ // The BIP-0341 serialized inclusion proof that is required to prove that
765
+ // the revealed leaf is part of the tree. This contains 0..n blocks of 32
766
+ // bytes. If the tree only contained a single leaf (which is the revealed
767
+ // leaf), this can be empty.
768
+ bytes full_inclusion_proof = 2;
769
+ }
770
+
771
+ message ImportTapscriptResponse {
772
+ /*
773
+ The resulting pay-to-Taproot address that represents the imported internal
774
+ key with the script committed to it.
775
+ */
776
+ string p2tr_address = 1;
777
+ }
778
+
779
+ message Transaction {
780
+ /*
781
+ The raw serialized transaction. Despite the field name, this does need to be
782
+ specified in raw bytes (or base64 encoded when using REST) and not in hex.
783
+ To not break existing software, the field can't simply be renamed.
784
+ */
785
+ bytes tx_hex = 1;
786
+
787
+ /*
788
+ An optional label to save with the transaction. Limited to 500 characters.
789
+ */
790
+ string label = 2;
791
+ }
792
+
793
+ message PublishResponse {
794
+ /*
795
+ If blank, then no error occurred and the transaction was successfully
796
+ published. If not the empty string, then a string representation of the
797
+ broadcast error.
798
+
799
+ TODO(roasbeef): map to a proper enum type
800
+ */
801
+ string publish_error = 1;
802
+ }
803
+
804
+ message RemoveTransactionResponse {
805
+ // The status of the remove transaction operation.
806
+ string status = 1;
807
+ }
808
+
809
+ message SendOutputsRequest {
810
+ /*
811
+ The number of satoshis per kilo weight that should be used when crafting
812
+ this transaction.
813
+ */
814
+ int64 sat_per_kw = 1;
815
+
816
+ /*
817
+ A slice of the outputs that should be created in the transaction produced.
818
+ */
819
+ repeated signrpc.TxOut outputs = 2;
820
+
821
+ // An optional label for the transaction, limited to 500 characters.
822
+ string label = 3;
823
+
824
+ // The minimum number of confirmations each one of your outputs used for
825
+ // the transaction must satisfy.
826
+ int32 min_confs = 4;
827
+
828
+ // Whether unconfirmed outputs should be used as inputs for the transaction.
829
+ bool spend_unconfirmed = 5;
830
+
831
+ // The strategy to use for selecting coins during sending the outputs.
832
+ lnrpc.CoinSelectionStrategy coin_selection_strategy = 6;
833
+ }
834
+ message SendOutputsResponse {
835
+ /*
836
+ The serialized transaction sent out on the network.
837
+ */
838
+ bytes raw_tx = 1;
839
+ }
840
+
841
+ message EstimateFeeRequest {
842
+ /*
843
+ The number of confirmations to shoot for when estimating the fee.
844
+ */
845
+ int32 conf_target = 1;
846
+ }
847
+ message EstimateFeeResponse {
848
+ /*
849
+ The amount of satoshis per kw that should be used in order to reach the
850
+ confirmation target in the request.
851
+ */
852
+ int64 sat_per_kw = 1;
853
+
854
+ // The current minimum relay fee based on our chain backend in sat/kw.
855
+ int64 min_relay_fee_sat_per_kw = 2;
856
+ }
857
+
858
+ enum WitnessType {
859
+ UNKNOWN_WITNESS = 0;
860
+
861
+ /*
862
+ A witness that allows us to spend the output of a commitment transaction
863
+ after a relative lock-time lockout.
864
+ */
865
+ COMMITMENT_TIME_LOCK = 1;
866
+
867
+ /*
868
+ A witness that allows us to spend a settled no-delay output immediately on a
869
+ counterparty's commitment transaction.
870
+ */
871
+ COMMITMENT_NO_DELAY = 2;
872
+
873
+ /*
874
+ A witness that allows us to sweep the settled output of a malicious
875
+ counterparty's who broadcasts a revoked commitment transaction.
876
+ */
877
+ COMMITMENT_REVOKE = 3;
878
+
879
+ /*
880
+ A witness that allows us to sweep an HTLC which we offered to the remote
881
+ party in the case that they broadcast a revoked commitment state.
882
+ */
883
+ HTLC_OFFERED_REVOKE = 4;
884
+
885
+ /*
886
+ A witness that allows us to sweep an HTLC output sent to us in the case that
887
+ the remote party broadcasts a revoked commitment state.
888
+ */
889
+ HTLC_ACCEPTED_REVOKE = 5;
890
+
891
+ /*
892
+ A witness that allows us to sweep an HTLC output that we extended to a
893
+ party, but was never fulfilled. This HTLC output isn't directly on the
894
+ commitment transaction, but is the result of a confirmed second-level HTLC
895
+ transaction. As a result, we can only spend this after a CSV delay.
896
+ */
897
+ HTLC_OFFERED_TIMEOUT_SECOND_LEVEL = 6;
898
+
899
+ /*
900
+ A witness that allows us to sweep an HTLC output that was offered to us, and
901
+ for which we have a payment preimage. This HTLC output isn't directly on our
902
+ commitment transaction, but is the result of confirmed second-level HTLC
903
+ transaction. As a result, we can only spend this after a CSV delay.
904
+ */
905
+ HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL = 7;
906
+
907
+ /*
908
+ A witness that allows us to sweep an HTLC that we offered to the remote
909
+ party which lies in the commitment transaction of the remote party. We can
910
+ spend this output after the absolute CLTV timeout of the HTLC as passed.
911
+ */
912
+ HTLC_OFFERED_REMOTE_TIMEOUT = 8;
913
+
914
+ /*
915
+ A witness that allows us to sweep an HTLC that was offered to us by the
916
+ remote party. We use this witness in the case that the remote party goes to
917
+ chain, and we know the pre-image to the HTLC. We can sweep this without any
918
+ additional timeout.
919
+ */
920
+ HTLC_ACCEPTED_REMOTE_SUCCESS = 9;
921
+
922
+ /*
923
+ A witness that allows us to sweep an HTLC from the remote party's commitment
924
+ transaction in the case that the broadcast a revoked commitment, but then
925
+ also immediately attempt to go to the second level to claim the HTLC.
926
+ */
927
+ HTLC_SECOND_LEVEL_REVOKE = 10;
928
+
929
+ /*
930
+ A witness type that allows us to spend a regular p2wkh output that's sent to
931
+ an output which is under complete control of the backing wallet.
932
+ */
933
+ WITNESS_KEY_HASH = 11;
934
+
935
+ /*
936
+ A witness type that allows us to sweep an output that sends to a nested P2SH
937
+ script that pays to a key solely under our control.
938
+ */
939
+ NESTED_WITNESS_KEY_HASH = 12;
940
+
941
+ /*
942
+ A witness type that allows us to spend our anchor on the commitment
943
+ transaction.
944
+ */
945
+ COMMITMENT_ANCHOR = 13;
946
+
947
+ /*
948
+ A witness type that is similar to the COMMITMENT_NO_DELAY type,
949
+ but it omits the tweak that randomizes the key we need to
950
+ spend with a channel peer supplied set of randomness.
951
+ */
952
+ COMMITMENT_NO_DELAY_TWEAKLESS = 14;
953
+
954
+ /*
955
+ A witness type that allows us to spend our output on the counterparty's
956
+ commitment transaction after a confirmation.
957
+ */
958
+ COMMITMENT_TO_REMOTE_CONFIRMED = 15;
959
+
960
+ /*
961
+ A witness type that allows us to sweep an HTLC output that we extended
962
+ to a party, but was never fulfilled. This _is_ the HTLC output directly
963
+ on our commitment transaction, and the input to the second-level HTLC
964
+ timeout transaction. It can only be spent after CLTV expiry, and
965
+ commitment confirmation.
966
+ */
967
+ HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED = 16;
968
+
969
+ /*
970
+ A witness type that allows us to sweep an HTLC output that was offered
971
+ to us, and for which we have a payment preimage. This _is_ the HTLC
972
+ output directly on our commitment transaction, and the input to the
973
+ second-level HTLC success transaction. It can only be spent after the
974
+ commitment has confirmed.
975
+ */
976
+ HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED = 17;
977
+
978
+ /*
979
+ A witness type that allows us to spend our output on our local
980
+ commitment transaction after a relative and absolute lock-time lockout as
981
+ part of the script enforced lease commitment type.
982
+ */
983
+ LEASE_COMMITMENT_TIME_LOCK = 18;
984
+
985
+ /*
986
+ A witness type that allows us to spend our output on the counterparty's
987
+ commitment transaction after a confirmation and absolute locktime as part
988
+ of the script enforced lease commitment type.
989
+ */
990
+ LEASE_COMMITMENT_TO_REMOTE_CONFIRMED = 19;
991
+
992
+ /*
993
+ A witness type that allows us to sweep an HTLC output that we extended
994
+ to a party, but was never fulfilled. This HTLC output isn't directly on
995
+ the commitment transaction, but is the result of a confirmed second-level
996
+ HTLC transaction. As a result, we can only spend this after a CSV delay
997
+ and CLTV locktime as part of the script enforced lease commitment type.
998
+ */
999
+ LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL = 20;
1000
+
1001
+ /*
1002
+ A witness type that allows us to sweep an HTLC output that was offered
1003
+ to us, and for which we have a payment preimage. This HTLC output isn't
1004
+ directly on our commitment transaction, but is the result of confirmed
1005
+ second-level HTLC transaction. As a result, we can only spend this after
1006
+ a CSV delay and CLTV locktime as part of the script enforced lease
1007
+ commitment type.
1008
+ */
1009
+ LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL = 21;
1010
+
1011
+ /*
1012
+ A witness type that allows us to spend a regular p2tr output that's sent
1013
+ to an output which is under complete control of the backing wallet.
1014
+ */
1015
+ TAPROOT_PUB_KEY_SPEND = 22;
1016
+
1017
+ /*
1018
+ A witness type that allows us to spend our settled local commitment after a
1019
+ CSV delay when we force close the channel.
1020
+ */
1021
+ TAPROOT_LOCAL_COMMIT_SPEND = 23;
1022
+
1023
+ /*
1024
+ A witness type that allows us to spend our settled local commitment after
1025
+ a CSV delay when the remote party has force closed the channel.
1026
+ */
1027
+ TAPROOT_REMOTE_COMMIT_SPEND = 24;
1028
+
1029
+ /*
1030
+ A witness type that we'll use for spending our own anchor output.
1031
+ */
1032
+ TAPROOT_ANCHOR_SWEEP_SPEND = 25;
1033
+
1034
+ /*
1035
+ A witness that allows us to timeout an HTLC we offered to the remote party
1036
+ on our commitment transaction. We use this when we need to go on chain to
1037
+ time out an HTLC.
1038
+ */
1039
+ TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL = 26;
1040
+
1041
+ /*
1042
+ A witness type that allows us to sweep an HTLC we accepted on our commitment
1043
+ transaction after we go to the second level on chain.
1044
+ */
1045
+ TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL = 27;
1046
+
1047
+ /*
1048
+ A witness that allows us to sweep an HTLC on the revoked transaction of the
1049
+ remote party that goes to the second level.
1050
+ */
1051
+ TAPROOT_HTLC_SECOND_LEVEL_REVOKE = 28;
1052
+
1053
+ /*
1054
+ A witness that allows us to sweep an HTLC sent to us by the remote party
1055
+ in the event that they broadcast a revoked state.
1056
+ */
1057
+ TAPROOT_HTLC_ACCEPTED_REVOKE = 29;
1058
+
1059
+ /*
1060
+ A witness that allows us to sweep an HTLC we offered to the remote party if
1061
+ they broadcast a revoked commitment.
1062
+ */
1063
+ TAPROOT_HTLC_OFFERED_REVOKE = 30;
1064
+
1065
+ /*
1066
+ A witness that allows us to sweep an HTLC we offered to the remote party
1067
+ that lies on the commitment transaction for the remote party. We can spend
1068
+ this output after the absolute CLTV timeout of the HTLC as passed.
1069
+ */
1070
+ TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT = 31;
1071
+
1072
+ /*
1073
+ A witness type that allows us to sign the second level HTLC timeout
1074
+ transaction when spending from an HTLC residing on our local commitment
1075
+ transaction.
1076
+ This is used by the sweeper to re-sign inputs if it needs to aggregate
1077
+ several second level HTLCs.
1078
+ */
1079
+ TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT = 32;
1080
+
1081
+ /*
1082
+ A witness that allows us to sweep an HTLC that was offered to us by the
1083
+ remote party for a taproot channels. We use this witness in the case that
1084
+ the remote party goes to chain, and we know the pre-image to the HTLC. We
1085
+ can sweep this without any additional timeout.
1086
+ */
1087
+ TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS = 33;
1088
+
1089
+ /*
1090
+ A witness type that allows us to sweep the HTLC offered to us on our local
1091
+ commitment transaction. We'll use this when we need to go on chain to sweep
1092
+ the HTLC. In this case, this is the second level HTLC success transaction.
1093
+ */
1094
+ TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS = 34;
1095
+
1096
+ /*
1097
+ A witness that allows us to sweep the settled output of a malicious
1098
+ counterparty's who broadcasts a revoked taproot commitment transaction.
1099
+ */
1100
+ TAPROOT_COMMITMENT_REVOKE = 35;
1101
+ }
1102
+
1103
+ message PendingSweep {
1104
+ // The outpoint of the output we're attempting to sweep.
1105
+ lnrpc.OutPoint outpoint = 1;
1106
+
1107
+ // The witness type of the output we're attempting to sweep.
1108
+ WitnessType witness_type = 2;
1109
+
1110
+ // The value of the output we're attempting to sweep.
1111
+ uint32 amount_sat = 3;
1112
+
1113
+ /*
1114
+ Deprecated, use sat_per_vbyte.
1115
+ The fee rate we'll use to sweep the output, expressed in sat/vbyte. The fee
1116
+ rate is only determined once a sweeping transaction for the output is
1117
+ created, so it's possible for this to be 0 before this.
1118
+ */
1119
+ uint32 sat_per_byte = 4 [deprecated = true];
1120
+
1121
+ // The number of broadcast attempts we've made to sweep the output.
1122
+ uint32 broadcast_attempts = 5;
1123
+
1124
+ /*
1125
+ Deprecated.
1126
+ The next height of the chain at which we'll attempt to broadcast the
1127
+ sweep transaction of the output.
1128
+ */
1129
+ uint32 next_broadcast_height = 6 [deprecated = true];
1130
+
1131
+ /*
1132
+ Deprecated, use immediate.
1133
+ Whether this input must be force-swept. This means that it is swept
1134
+ immediately.
1135
+ */
1136
+ bool force = 7 [deprecated = true];
1137
+
1138
+ /*
1139
+ Deprecated, use deadline.
1140
+ The requested confirmation target for this output, which is the deadline
1141
+ used by the sweeper.
1142
+ */
1143
+ uint32 requested_conf_target = 8 [deprecated = true];
1144
+
1145
+ // Deprecated, use requested_sat_per_vbyte.
1146
+ // The requested fee rate, expressed in sat/vbyte, for this output.
1147
+ uint32 requested_sat_per_byte = 9 [deprecated = true];
1148
+
1149
+ /*
1150
+ The current fee rate we'll use to sweep the output, expressed in sat/vbyte.
1151
+ The fee rate is only determined once a sweeping transaction for the output
1152
+ is created, so it's possible for this to be 0 before this.
1153
+ */
1154
+ uint64 sat_per_vbyte = 10;
1155
+
1156
+ // The requested starting fee rate, expressed in sat/vbyte, for this
1157
+ // output. When not requested, this field will be 0.
1158
+ uint64 requested_sat_per_vbyte = 11;
1159
+
1160
+ /*
1161
+ Whether this input will be swept immediately.
1162
+ */
1163
+ bool immediate = 12;
1164
+
1165
+ /*
1166
+ The budget for this sweep, expressed in satoshis. This is the maximum amount
1167
+ that can be spent as fees to sweep this output.
1168
+ */
1169
+ uint64 budget = 13;
1170
+
1171
+ /*
1172
+ The deadline height used for this output when perform fee bumping.
1173
+ */
1174
+ uint32 deadline_height = 14;
1175
+
1176
+ /*
1177
+ The block height which the input's locktime will expire at. Zero if the
1178
+ input has no locktime.
1179
+ */
1180
+ uint32 maturity_height = 15;
1181
+ }
1182
+
1183
+ message PendingSweepsRequest {
1184
+ }
1185
+
1186
+ message PendingSweepsResponse {
1187
+ /*
1188
+ The set of outputs currently being swept by lnd's central batching engine.
1189
+ */
1190
+ repeated PendingSweep pending_sweeps = 1;
1191
+ }
1192
+
1193
+ message BumpFeeRequest {
1194
+ // The input we're attempting to bump the fee of.
1195
+ lnrpc.OutPoint outpoint = 1;
1196
+
1197
+ // Optional. The conf target the underlying fee estimator will use to
1198
+ // estimate the starting fee rate for the fee function.
1199
+ uint32 target_conf = 2;
1200
+
1201
+ /*
1202
+ Deprecated, use sat_per_vbyte.
1203
+ The fee rate, expressed in sat/vbyte, that should be used to spend the input
1204
+ with.
1205
+ */
1206
+ uint32 sat_per_byte = 3 [deprecated = true];
1207
+
1208
+ /*
1209
+ Deprecated, use immediate.
1210
+ Whether this input must be force-swept. This means that it is swept
1211
+ immediately.
1212
+ */
1213
+ bool force = 4 [deprecated = true];
1214
+
1215
+ /*
1216
+ Optional. The starting fee rate, expressed in sat/vbyte, that will be used
1217
+ to spend the input with initially. This value will be used by the sweeper's
1218
+ fee function as its starting fee rate. When not set, the sweeper will use
1219
+ the estimated fee rate using the `target_conf` as the starting fee rate.
1220
+ */
1221
+ uint64 sat_per_vbyte = 5;
1222
+
1223
+ /*
1224
+ Optional. Whether this input will be swept immediately. When set to true,
1225
+ the sweeper will sweep this input without waiting for the next block.
1226
+ */
1227
+ bool immediate = 6;
1228
+
1229
+ /*
1230
+ Optional. The max amount in sats that can be used as the fees. Setting this
1231
+ value greater than the input's value may result in CPFP - one or more wallet
1232
+ utxos will be used to pay the fees specified by the budget. If not set, for
1233
+ new inputs, by default 50% of the input's value will be treated as the
1234
+ budget for fee bumping; for existing inputs, their current budgets will be
1235
+ retained.
1236
+ */
1237
+ uint64 budget = 7;
1238
+
1239
+ // Optional. The deadline delta in number of blocks that the output
1240
+ // should be spent within. This translates internally to the width of the
1241
+ // fee function that the sweeper will use to bump the fee rate. When the
1242
+ // deadline is reached, ALL the budget will be spent as fees.
1243
+ uint32 deadline_delta = 8;
1244
+ }
1245
+
1246
+ message BumpFeeResponse {
1247
+ // The status of the bump fee operation.
1248
+ string status = 1;
1249
+ }
1250
+
1251
+ message BumpForceCloseFeeRequest {
1252
+ // The channel point which force close transaction we are attempting to
1253
+ // bump the fee rate for.
1254
+ lnrpc.ChannelPoint chan_point = 1;
1255
+
1256
+ // Optional. The deadline delta in number of blocks that the anchor output
1257
+ // should be spent within to bump the closing transaction. When the
1258
+ // deadline is reached, ALL the budget will be spent as fees
1259
+ uint32 deadline_delta = 2;
1260
+
1261
+ /*
1262
+ Optional. The starting fee rate, expressed in sat/vbyte. This value will be
1263
+ used by the sweeper's fee function as its starting fee rate. When not set,
1264
+ the sweeper will use the estimated fee rate using the target_conf as the
1265
+ starting fee rate.
1266
+ */
1267
+ uint64 starting_feerate = 3;
1268
+
1269
+ /*
1270
+ Optional. Whether this cpfp transaction will be triggered immediately. When
1271
+ set to true, the sweeper will consider all currently registered sweeps and
1272
+ trigger new batch transactions including the sweeping of the anchor output
1273
+ related to the selected force close transaction.
1274
+ */
1275
+ bool immediate = 4;
1276
+
1277
+ /*
1278
+ Optional. The max amount in sats that can be used as the fees. For already
1279
+ registered anchor outputs if not set explicitly the old value will be used.
1280
+ For channel force closes which have no HTLCs in their commitment transaction
1281
+ this value has to be set to an appropriate amount to pay for the cpfp
1282
+ transaction of the force closed channel otherwise the fee bumping will fail.
1283
+ */
1284
+ uint64 budget = 5;
1285
+
1286
+ // Optional. The conf target the underlying fee estimator will use to
1287
+ // estimate the starting fee rate for the fee function.
1288
+ uint32 target_conf = 6;
1289
+ }
1290
+
1291
+ message BumpForceCloseFeeResponse {
1292
+ // The status of the force close fee bump operation.
1293
+ string status = 1;
1294
+ }
1295
+
1296
+ message ListSweepsRequest {
1297
+ /*
1298
+ Retrieve the full sweep transaction details. If false, only the sweep txids
1299
+ will be returned. Note that some sweeps that LND publishes will have been
1300
+ replaced-by-fee, so will not be included in this output.
1301
+ */
1302
+ bool verbose = 1;
1303
+
1304
+ /*
1305
+ The start height to use when fetching sweeps. If not specified (0), the
1306
+ result will start from the earliest sweep. If set to -1 the result will
1307
+ only include unconfirmed sweeps (at the time of the call).
1308
+ */
1309
+ int32 start_height = 2;
1310
+ }
1311
+
1312
+ message ListSweepsResponse {
1313
+ message TransactionIDs {
1314
+ /*
1315
+ Reversed, hex-encoded string representing the transaction ids of the
1316
+ sweeps that our node has broadcast. Note that these transactions may
1317
+ not have confirmed yet, we record sweeps on broadcast, not confirmation.
1318
+ */
1319
+ repeated string transaction_ids = 1;
1320
+ }
1321
+
1322
+ oneof sweeps {
1323
+ lnrpc.TransactionDetails transaction_details = 1;
1324
+ TransactionIDs transaction_ids = 2;
1325
+ }
1326
+ }
1327
+
1328
+ message LabelTransactionRequest {
1329
+ // The txid of the transaction to label. Note: When using gRPC, the bytes
1330
+ // must be in little-endian (reverse) order.
1331
+ bytes txid = 1;
1332
+
1333
+ // The label to add to the transaction, limited to 500 characters.
1334
+ string label = 2;
1335
+
1336
+ // Whether to overwrite the existing label, if it is present.
1337
+ bool overwrite = 3;
1338
+ }
1339
+
1340
+ message LabelTransactionResponse {
1341
+ // The status of the label operation.
1342
+ string status = 1;
1343
+ }
1344
+
1345
+ // The possible change address types for default accounts and single imported
1346
+ // public keys. By default, P2WPKH will be used. We don't provide the
1347
+ // possibility to choose P2PKH as it is a legacy key scope, nor NP2WPKH as
1348
+ // no key scope permits to do so. For custom accounts, no change type should
1349
+ // be provided as the coin selection key scope will always be used to generate
1350
+ // the change address.
1351
+ enum ChangeAddressType {
1352
+ // CHANGE_ADDRESS_TYPE_UNSPECIFIED indicates that no change address type is
1353
+ // provided. We will then use P2WPKH address type for change (BIP0084 key
1354
+ // scope).
1355
+ CHANGE_ADDRESS_TYPE_UNSPECIFIED = 0;
1356
+
1357
+ // CHANGE_ADDRESS_TYPE_P2TR indicates to use P2TR address for change output
1358
+ // (BIP0086 key scope).
1359
+ CHANGE_ADDRESS_TYPE_P2TR = 1;
1360
+ }
1361
+
1362
+ message FundPsbtRequest {
1363
+ oneof template {
1364
+ /*
1365
+ Use an existing PSBT packet as the template for the funded PSBT.
1366
+
1367
+ The packet must contain at least one non-dust output. If one or more
1368
+ inputs are specified, no coin selection is performed. In that case every
1369
+ input must be an UTXO known to the wallet that has not been locked
1370
+ before. The sum of all inputs must be sufficiently greater than the sum
1371
+ of all outputs to pay a miner fee with the specified fee rate. A change
1372
+ output is added to the PSBT if necessary.
1373
+ */
1374
+ bytes psbt = 1;
1375
+
1376
+ /*
1377
+ Use the outputs and optional inputs from this raw template.
1378
+ */
1379
+ TxTemplate raw = 2;
1380
+
1381
+ /*
1382
+ Use an existing PSBT packet as the template for the funded PSBT.
1383
+
1384
+ The difference to the pure PSBT template above is that coin selection is
1385
+ performed even if inputs are specified. The output amounts are summed up
1386
+ and used as the target amount for coin selection. A change output must
1387
+ either already exist in the PSBT and be marked as such, otherwise a new
1388
+ change output of the specified output type will be added. Any inputs
1389
+ already specified in the PSBT must already be locked (if they belong to
1390
+ this node), only newly added inputs will be locked by this RPC.
1391
+
1392
+ In case the sum of the already provided inputs exceeds the required
1393
+ output amount, no new coins are selected. Instead only the fee and
1394
+ change amount calculation is performed (e.g. a change output is added if
1395
+ requested or the change is added to the specified existing change
1396
+ output, given there is any non-dust change). This can be identified by
1397
+ the returned locked UTXOs being empty.
1398
+ */
1399
+ PsbtCoinSelect coin_select = 9;
1400
+ }
1401
+
1402
+ oneof fees {
1403
+ /*
1404
+ The target number of blocks that the transaction should be confirmed in.
1405
+ */
1406
+ uint32 target_conf = 3;
1407
+
1408
+ /*
1409
+ The fee rate, expressed in sat/vbyte, that should be used to spend the
1410
+ input with.
1411
+ */
1412
+ uint64 sat_per_vbyte = 4;
1413
+
1414
+ /*
1415
+ The fee rate, expressed in sat/kWU, that should be used to spend the
1416
+ input with.
1417
+ */
1418
+ uint64 sat_per_kw = 11;
1419
+ }
1420
+
1421
+ /*
1422
+ The name of the account to fund the PSBT with. If empty, the default wallet
1423
+ account is used.
1424
+ */
1425
+ string account = 5;
1426
+
1427
+ // The minimum number of confirmations each one of your outputs used for
1428
+ // the transaction must satisfy.
1429
+ int32 min_confs = 6;
1430
+
1431
+ // Whether unconfirmed outputs should be used as inputs for the transaction.
1432
+ bool spend_unconfirmed = 7;
1433
+
1434
+ // The address type for the change. If empty, P2WPKH addresses will be used
1435
+ // for default accounts and single imported public keys. For custom
1436
+ // accounts, no change type should be provided as the coin selection key
1437
+ // scope will always be used to generate the change address.
1438
+ ChangeAddressType change_type = 8;
1439
+
1440
+ // The strategy to use for selecting coins during funding the PSBT.
1441
+ lnrpc.CoinSelectionStrategy coin_selection_strategy = 10;
1442
+
1443
+ // The max fee to total output amount ratio that this psbt should adhere to.
1444
+ double max_fee_ratio = 12;
1445
+
1446
+ // The custom lock ID to use for the inputs in the funded PSBT. The value
1447
+ // if set must be exactly 32 bytes long. If empty, the default lock ID will
1448
+ // be used.
1449
+ bytes custom_lock_id = 13;
1450
+
1451
+ // If set, then the inputs in the funded PSBT will be locked for the
1452
+ // specified duration. The lock duration is specified in seconds. If not
1453
+ // set, the default lock duration will be used.
1454
+ uint64 lock_expiration_seconds = 14;
1455
+ }
1456
+ message FundPsbtResponse {
1457
+ /*
1458
+ The funded but not yet signed PSBT packet.
1459
+ */
1460
+ bytes funded_psbt = 1;
1461
+
1462
+ /*
1463
+ The index of the added change output or -1 if no change was left over.
1464
+ */
1465
+ int32 change_output_index = 2;
1466
+
1467
+ /*
1468
+ The list of lock leases that were acquired for the inputs in the funded PSBT
1469
+ packet. Only inputs added to the PSBT by this RPC are locked, inputs that
1470
+ were already present in the PSBT are not locked.
1471
+ */
1472
+ repeated UtxoLease locked_utxos = 3;
1473
+ }
1474
+
1475
+ message TxTemplate {
1476
+ /*
1477
+ An optional list of inputs to use. Every input must be an UTXO known to the
1478
+ wallet that has not been locked before. The sum of all inputs must be
1479
+ sufficiently greater than the sum of all outputs to pay a miner fee with the
1480
+ fee rate specified in the parent message.
1481
+
1482
+ If no inputs are specified, coin selection will be performed instead and
1483
+ inputs of sufficient value will be added to the resulting PSBT.
1484
+ */
1485
+ repeated lnrpc.OutPoint inputs = 1;
1486
+
1487
+ /*
1488
+ A map of all addresses and the amounts to send to in the funded PSBT.
1489
+ */
1490
+ map<string, uint64> outputs = 2;
1491
+ }
1492
+
1493
+ message PsbtCoinSelect {
1494
+ /*
1495
+ The template to use for the funded PSBT. The template must contain at least
1496
+ one non-dust output. The amount to be funded is calculated by summing up the
1497
+ amounts of all outputs in the template, subtracting all the input values of
1498
+ the already specified inputs. The change value is added to the output that
1499
+ is marked as such (or a new change output is added if none is marked). For
1500
+ the input amount calculation to be correct, the template must have the
1501
+ WitnessUtxo field set for all inputs. Any inputs already specified in the
1502
+ PSBT must already be locked (if they belong to this node), only newly added
1503
+ inputs will be locked by this RPC.
1504
+ */
1505
+ bytes psbt = 1;
1506
+
1507
+ oneof change_output {
1508
+ /*
1509
+ Use the existing output within the template PSBT with the specified
1510
+ index as the change output. Any leftover change will be added to the
1511
+ already specified amount of that output. To add a new change output to
1512
+ the PSBT, set the "add" field below instead. The type of change output
1513
+ added is defined by change_type in the parent message.
1514
+ */
1515
+ int32 existing_output_index = 2;
1516
+
1517
+ /*
1518
+ Add a new change output to the PSBT using the change_type specified in
1519
+ the parent message.
1520
+ */
1521
+ bool add = 3;
1522
+ }
1523
+ }
1524
+
1525
+ message UtxoLease {
1526
+ /*
1527
+ A 32 byte random ID that identifies the lease.
1528
+ */
1529
+ bytes id = 1;
1530
+
1531
+ // The identifying outpoint of the output being leased.
1532
+ lnrpc.OutPoint outpoint = 2;
1533
+
1534
+ /*
1535
+ The absolute expiration of the output lease represented as a unix timestamp.
1536
+ */
1537
+ uint64 expiration = 3;
1538
+
1539
+ /*
1540
+ The public key script of the leased output.
1541
+ */
1542
+ bytes pk_script = 4;
1543
+
1544
+ /*
1545
+ The value of the leased output in satoshis.
1546
+ */
1547
+ uint64 value = 5;
1548
+ }
1549
+
1550
+ message SignPsbtRequest {
1551
+ /*
1552
+ The PSBT that should be signed. The PSBT must contain all required inputs,
1553
+ outputs, UTXO data and custom fields required to identify the signing key.
1554
+ */
1555
+ bytes funded_psbt = 1;
1556
+ }
1557
+
1558
+ message SignPsbtResponse {
1559
+ // The signed transaction in PSBT format.
1560
+ bytes signed_psbt = 1;
1561
+
1562
+ // The indices of signed inputs.
1563
+ repeated uint32 signed_inputs = 2;
1564
+ }
1565
+
1566
+ message FinalizePsbtRequest {
1567
+ /*
1568
+ A PSBT that should be signed and finalized. The PSBT must contain all
1569
+ required inputs, outputs, UTXO data and partial signatures of all other
1570
+ signers.
1571
+ */
1572
+ bytes funded_psbt = 1;
1573
+
1574
+ /*
1575
+ The name of the account to finalize the PSBT with. If empty, the default
1576
+ wallet account is used.
1577
+ */
1578
+ string account = 5;
1579
+ }
1580
+ message FinalizePsbtResponse {
1581
+ // The fully signed and finalized transaction in PSBT format.
1582
+ bytes signed_psbt = 1;
1583
+
1584
+ // The fully signed and finalized transaction in the raw wire format.
1585
+ bytes raw_final_tx = 2;
1586
+ }
1587
+
1588
+ message ListLeasesRequest {
1589
+ }
1590
+
1591
+ message ListLeasesResponse {
1592
+ // The list of currently leased utxos.
1593
+ repeated UtxoLease locked_utxos = 1;
1594
+ }