lnrpc 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -13
  3. data/examples.rb +5 -5
  4. data/generate-grpc-service-files.sh +30 -0
  5. data/lib/grpc_services/autopilotrpc/autopilot_pb.rb +48 -0
  6. data/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb +40 -0
  7. data/lib/grpc_services/chainrpc/chainnotifier_pb.rb +67 -0
  8. data/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb +51 -0
  9. data/lib/grpc_services/invoicesrpc/invoices_pb.rb +48 -0
  10. data/lib/grpc_services/invoicesrpc/invoices_services_pb.rb +41 -0
  11. data/lib/grpc_services/lnclipb/lncli_pb.rb +18 -0
  12. data/lib/grpc_services/routerrpc/router_pb.rb +229 -0
  13. data/lib/{lnrpc → grpc_services/routerrpc}/router_services_pb.rb +33 -16
  14. data/lib/grpc_services/rpc_pb.rb +1265 -0
  15. data/lib/{lnrpc → grpc_services}/rpc_services_pb.rb +83 -115
  16. data/lib/grpc_services/signrpc/signer_pb.rb +83 -0
  17. data/lib/grpc_services/signrpc/signer_services_pb.rb +68 -0
  18. data/lib/grpc_services/verrpc/verrpc_pb.rb +27 -0
  19. data/lib/grpc_services/verrpc/verrpc_services_pb.rb +27 -0
  20. data/lib/grpc_services/walletrpc/walletkit_pb.rb +149 -0
  21. data/lib/grpc_services/walletrpc/walletkit_services_pb.rb +115 -0
  22. data/lib/grpc_services/walletunlocker_pb.rb +51 -0
  23. data/lib/grpc_services/walletunlocker_services_pb.rb +72 -0
  24. data/lib/grpc_services/watchtowerrpc/watchtower_pb.rb +21 -0
  25. data/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb +28 -0
  26. data/lib/grpc_services/wtclientrpc/wtclient_pb.rb +75 -0
  27. data/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb +43 -0
  28. data/lib/lnrpc.rb +6 -2
  29. data/lib/lnrpc/client.rb +50 -9
  30. data/lib/lnrpc/grpc_wrapper.rb +19 -42
  31. data/lib/lnrpc/version.rb +1 -1
  32. data/lnrpc.gemspec +1 -1
  33. metadata +27 -8
  34. data/lib/lnrpc/router.proto +0 -560
  35. data/lib/lnrpc/router_pb.rb +0 -198
  36. data/lib/lnrpc/rpc.proto +0 -3687
  37. data/lib/lnrpc/rpc_pb.rb +0 -1248
@@ -1,198 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: router.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require_relative 'rpc_pb'
7
- Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "routerrpc.SendPaymentRequest" do
9
- optional :dest, :bytes, 1
10
- optional :amt, :int64, 2
11
- optional :amt_msat, :int64, 12
12
- optional :payment_hash, :bytes, 3
13
- optional :final_cltv_delta, :int32, 4
14
- optional :payment_request, :string, 5
15
- optional :timeout_seconds, :int32, 6
16
- optional :fee_limit_sat, :int64, 7
17
- optional :fee_limit_msat, :int64, 13
18
- optional :outgoing_chan_id, :uint64, 8
19
- optional :last_hop_pubkey, :bytes, 14
20
- optional :cltv_limit, :int32, 9
21
- repeated :route_hints, :message, 10, "lnrpc.RouteHint"
22
- map :dest_custom_records, :uint64, :bytes, 11
23
- optional :allow_self_payment, :bool, 15
24
- repeated :dest_features, :enum, 16, "lnrpc.FeatureBit"
25
- optional :max_parts, :uint32, 17
26
- optional :no_inflight_updates, :bool, 18
27
- end
28
- add_message "routerrpc.TrackPaymentRequest" do
29
- optional :payment_hash, :bytes, 1
30
- optional :no_inflight_updates, :bool, 2
31
- end
32
- add_message "routerrpc.RouteFeeRequest" do
33
- optional :dest, :bytes, 1
34
- optional :amt_sat, :int64, 2
35
- end
36
- add_message "routerrpc.RouteFeeResponse" do
37
- optional :routing_fee_msat, :int64, 1
38
- optional :time_lock_delay, :int64, 2
39
- end
40
- add_message "routerrpc.SendToRouteRequest" do
41
- optional :payment_hash, :bytes, 1
42
- optional :route, :message, 2, "lnrpc.Route"
43
- end
44
- add_message "routerrpc.SendToRouteResponse" do
45
- optional :preimage, :bytes, 1
46
- optional :failure, :message, 2, "lnrpc.Failure"
47
- end
48
- add_message "routerrpc.ResetMissionControlRequest" do
49
- end
50
- add_message "routerrpc.ResetMissionControlResponse" do
51
- end
52
- add_message "routerrpc.QueryMissionControlRequest" do
53
- end
54
- add_message "routerrpc.QueryMissionControlResponse" do
55
- repeated :pairs, :message, 2, "routerrpc.PairHistory"
56
- end
57
- add_message "routerrpc.PairHistory" do
58
- optional :node_from, :bytes, 1
59
- optional :node_to, :bytes, 2
60
- optional :history, :message, 7, "routerrpc.PairData"
61
- end
62
- add_message "routerrpc.PairData" do
63
- optional :fail_time, :int64, 1
64
- optional :fail_amt_sat, :int64, 2
65
- optional :fail_amt_msat, :int64, 4
66
- optional :success_time, :int64, 5
67
- optional :success_amt_sat, :int64, 6
68
- optional :success_amt_msat, :int64, 7
69
- end
70
- add_message "routerrpc.QueryProbabilityRequest" do
71
- optional :from_node, :bytes, 1
72
- optional :to_node, :bytes, 2
73
- optional :amt_msat, :int64, 3
74
- end
75
- add_message "routerrpc.QueryProbabilityResponse" do
76
- optional :probability, :double, 1
77
- optional :history, :message, 2, "routerrpc.PairData"
78
- end
79
- add_message "routerrpc.BuildRouteRequest" do
80
- optional :amt_msat, :int64, 1
81
- optional :final_cltv_delta, :int32, 2
82
- optional :outgoing_chan_id, :uint64, 3
83
- repeated :hop_pubkeys, :bytes, 4
84
- end
85
- add_message "routerrpc.BuildRouteResponse" do
86
- optional :route, :message, 1, "lnrpc.Route"
87
- end
88
- add_message "routerrpc.SubscribeHtlcEventsRequest" do
89
- end
90
- add_message "routerrpc.HtlcEvent" do
91
- optional :incoming_channel_id, :uint64, 1
92
- optional :outgoing_channel_id, :uint64, 2
93
- optional :incoming_htlc_id, :uint64, 3
94
- optional :outgoing_htlc_id, :uint64, 4
95
- optional :timestamp_ns, :uint64, 5
96
- optional :event_type, :enum, 6, "routerrpc.HtlcEvent.EventType"
97
- oneof :event do
98
- optional :forward_event, :message, 7, "routerrpc.ForwardEvent"
99
- optional :forward_fail_event, :message, 8, "routerrpc.ForwardFailEvent"
100
- optional :settle_event, :message, 9, "routerrpc.SettleEvent"
101
- optional :link_fail_event, :message, 10, "routerrpc.LinkFailEvent"
102
- end
103
- end
104
- add_enum "routerrpc.HtlcEvent.EventType" do
105
- value :UNKNOWN, 0
106
- value :SEND, 1
107
- value :RECEIVE, 2
108
- value :FORWARD, 3
109
- end
110
- add_message "routerrpc.HtlcInfo" do
111
- optional :incoming_timelock, :uint32, 1
112
- optional :outgoing_timelock, :uint32, 2
113
- optional :incoming_amt_msat, :uint64, 3
114
- optional :outgoing_amt_msat, :uint64, 4
115
- end
116
- add_message "routerrpc.ForwardEvent" do
117
- optional :info, :message, 1, "routerrpc.HtlcInfo"
118
- end
119
- add_message "routerrpc.ForwardFailEvent" do
120
- end
121
- add_message "routerrpc.SettleEvent" do
122
- end
123
- add_message "routerrpc.LinkFailEvent" do
124
- optional :info, :message, 1, "routerrpc.HtlcInfo"
125
- optional :wire_failure, :enum, 2, "lnrpc.Failure.FailureCode"
126
- optional :failure_detail, :enum, 3, "routerrpc.FailureDetail"
127
- optional :failure_string, :string, 4
128
- end
129
- add_message "routerrpc.PaymentStatus" do
130
- optional :state, :enum, 1, "routerrpc.PaymentState"
131
- optional :preimage, :bytes, 2
132
- repeated :htlcs, :message, 4, "lnrpc.HTLCAttempt"
133
- end
134
- add_enum "routerrpc.FailureDetail" do
135
- value :UNKNOWN, 0
136
- value :NO_DETAIL, 1
137
- value :ONION_DECODE, 2
138
- value :LINK_NOT_ELIGIBLE, 3
139
- value :ON_CHAIN_TIMEOUT, 4
140
- value :HTLC_EXCEEDS_MAX, 5
141
- value :INSUFFICIENT_BALANCE, 6
142
- value :INCOMPLETE_FORWARD, 7
143
- value :HTLC_ADD_FAILED, 8
144
- value :FORWARDS_DISABLED, 9
145
- value :INVOICE_CANCELED, 10
146
- value :INVOICE_UNDERPAID, 11
147
- value :INVOICE_EXPIRY_TOO_SOON, 12
148
- value :INVOICE_NOT_OPEN, 13
149
- value :MPP_INVOICE_TIMEOUT, 14
150
- value :ADDRESS_MISMATCH, 15
151
- value :SET_TOTAL_MISMATCH, 16
152
- value :SET_TOTAL_TOO_LOW, 17
153
- value :SET_OVERPAID, 18
154
- value :UNKNOWN_INVOICE, 19
155
- value :INVALID_KEYSEND, 20
156
- value :MPP_IN_PROGRESS, 21
157
- value :CIRCULAR_ROUTE, 22
158
- end
159
- add_enum "routerrpc.PaymentState" do
160
- value :IN_FLIGHT, 0
161
- value :SUCCEEDED, 1
162
- value :FAILED_TIMEOUT, 2
163
- value :FAILED_NO_ROUTE, 3
164
- value :FAILED_ERROR, 4
165
- value :FAILED_INCORRECT_PAYMENT_DETAILS, 5
166
- value :FAILED_INSUFFICIENT_BALANCE, 6
167
- end
168
- end
169
-
170
- module Routerrpc
171
- SendPaymentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendPaymentRequest").msgclass
172
- TrackPaymentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.TrackPaymentRequest").msgclass
173
- RouteFeeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeRequest").msgclass
174
- RouteFeeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeResponse").msgclass
175
- SendToRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteRequest").msgclass
176
- SendToRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteResponse").msgclass
177
- ResetMissionControlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlRequest").msgclass
178
- ResetMissionControlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlResponse").msgclass
179
- QueryMissionControlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlRequest").msgclass
180
- QueryMissionControlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlResponse").msgclass
181
- PairHistory = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairHistory").msgclass
182
- PairData = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairData").msgclass
183
- QueryProbabilityRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityRequest").msgclass
184
- QueryProbabilityResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityResponse").msgclass
185
- BuildRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteRequest").msgclass
186
- BuildRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteResponse").msgclass
187
- SubscribeHtlcEventsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SubscribeHtlcEventsRequest").msgclass
188
- HtlcEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent").msgclass
189
- HtlcEvent::EventType = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent.EventType").enummodule
190
- HtlcInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcInfo").msgclass
191
- ForwardEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardEvent").msgclass
192
- ForwardFailEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardFailEvent").msgclass
193
- SettleEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SettleEvent").msgclass
194
- LinkFailEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.LinkFailEvent").msgclass
195
- PaymentStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentStatus").msgclass
196
- FailureDetail = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.FailureDetail").enummodule
197
- PaymentState = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentState").enummodule
198
- end
@@ -1,3687 +0,0 @@
1
- syntax = "proto3";
2
-
3
- import "google/api/annotations.proto";
4
-
5
- package lnrpc;
6
-
7
- option go_package = "github.com/lightningnetwork/lnd/lnrpc";
8
-
9
- /**
10
- * Comments in this file will be directly parsed into the API
11
- * Documentation as descriptions of the associated method, message, or field.
12
- * These descriptions should go right above the definition of the object, and
13
- * can be in either block or /// comment format.
14
- *
15
- * One edge case exists where a // comment followed by a /// comment in the
16
- * next line will cause the description not to show up in the documentation. In
17
- * that instance, simply separate the two comments with a blank line.
18
- *
19
- * An RPC method can be matched to an lncli command by placing a line in the
20
- * beginning of the description in exactly the following format:
21
- * lncli: `methodname`
22
- *
23
- * Failure to specify the exact name of the command will cause documentation
24
- * generation to fail.
25
- *
26
- * More information on how exactly the gRPC documentation is generated from
27
- * this proto file can be found here:
28
- * https://github.com/lightninglabs/lightning-api
29
- */
30
-
31
- // The WalletUnlocker service is used to set up a wallet password for
32
- // lnd at first startup, and unlock a previously set up wallet.
33
- service WalletUnlocker {
34
- /**
35
- GenSeed is the first method that should be used to instantiate a new lnd
36
- instance. This method allows a caller to generate a new aezeed cipher seed
37
- given an optional passphrase. If provided, the passphrase will be necessary
38
- to decrypt the cipherseed to expose the internal wallet seed.
39
-
40
- Once the cipherseed is obtained and verified by the user, the InitWallet
41
- method should be used to commit the newly generated seed, and create the
42
- wallet.
43
- */
44
- rpc GenSeed (GenSeedRequest) returns (GenSeedResponse) {
45
- option (google.api.http) = {
46
- get: "/v1/genseed"
47
- };
48
- }
49
-
50
- /**
51
- InitWallet is used when lnd is starting up for the first time to fully
52
- initialize the daemon and its internal wallet. At the very least a wallet
53
- password must be provided. This will be used to encrypt sensitive material
54
- on disk.
55
-
56
- In the case of a recovery scenario, the user can also specify their aezeed
57
- mnemonic and passphrase. If set, then the daemon will use this prior state
58
- to initialize its internal wallet.
59
-
60
- Alternatively, this can be used along with the GenSeed RPC to obtain a
61
- seed, then present it to the user. Once it has been verified by the user,
62
- the seed can be fed into this RPC in order to commit the new wallet.
63
- */
64
- rpc InitWallet (InitWalletRequest) returns (InitWalletResponse) {
65
- option (google.api.http) = {
66
- post: "/v1/initwallet"
67
- body: "*"
68
- };
69
- }
70
-
71
- /** lncli: `unlock`
72
- UnlockWallet is used at startup of lnd to provide a password to unlock
73
- the wallet database.
74
- */
75
- rpc UnlockWallet (UnlockWalletRequest) returns (UnlockWalletResponse) {
76
- option (google.api.http) = {
77
- post: "/v1/unlockwallet"
78
- body: "*"
79
- };
80
- }
81
-
82
- /** lncli: `changepassword`
83
- ChangePassword changes the password of the encrypted wallet. This will
84
- automatically unlock the wallet database if successful.
85
- */
86
- rpc ChangePassword (ChangePasswordRequest)
87
- returns (ChangePasswordResponse) {
88
- option (google.api.http) = {
89
- post: "/v1/changepassword"
90
- body: "*"
91
- };
92
- }
93
- }
94
-
95
- message GenSeedRequest {
96
- /**
97
- aezeed_passphrase is an optional user provided passphrase that will be used
98
- to encrypt the generated aezeed cipher seed. When using REST, this field
99
- must be encoded as base64.
100
- */
101
- bytes aezeed_passphrase = 1;
102
-
103
- /**
104
- seed_entropy is an optional 16-bytes generated via CSPRNG. If not
105
- specified, then a fresh set of randomness will be used to create the seed.
106
- When using REST, this field must be encoded as base64.
107
- */
108
- bytes seed_entropy = 2;
109
- }
110
- message GenSeedResponse {
111
- /**
112
- cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
113
- cipher seed obtained by the user. This field is optional, as if not
114
- provided, then the daemon will generate a new cipher seed for the user.
115
- Otherwise, then the daemon will attempt to recover the wallet state linked
116
- to this cipher seed.
117
- */
118
- repeated string cipher_seed_mnemonic = 1;
119
-
120
- /**
121
- enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
122
- cipher text before run through our mnemonic encoding scheme.
123
- */
124
- bytes enciphered_seed = 2;
125
- }
126
-
127
- message InitWalletRequest {
128
- /**
129
- wallet_password is the passphrase that should be used to encrypt the
130
- wallet. This MUST be at least 8 chars in length. After creation, this
131
- password is required to unlock the daemon. When using REST, this field
132
- must be encoded as base64.
133
- */
134
- bytes wallet_password = 1;
135
-
136
- /**
137
- cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
138
- cipher seed obtained by the user. This may have been generated by the
139
- GenSeed method, or be an existing seed.
140
- */
141
- repeated string cipher_seed_mnemonic = 2;
142
-
143
- /**
144
- aezeed_passphrase is an optional user provided passphrase that will be used
145
- to encrypt the generated aezeed cipher seed. When using REST, this field
146
- must be encoded as base64.
147
- */
148
- bytes aezeed_passphrase = 3;
149
-
150
- /**
151
- recovery_window is an optional argument specifying the address lookahead
152
- when restoring a wallet seed. The recovery window applies to each
153
- individual branch of the BIP44 derivation paths. Supplying a recovery
154
- window of zero indicates that no addresses should be recovered, such after
155
- the first initialization of the wallet.
156
- */
157
- int32 recovery_window = 4;
158
-
159
- /**
160
- channel_backups is an optional argument that allows clients to recover the
161
- settled funds within a set of channels. This should be populated if the
162
- user was unable to close out all channels and sweep funds before partial or
163
- total data loss occurred. If specified, then after on-chain recovery of
164
- funds, lnd begin to carry out the data loss recovery protocol in order to
165
- recover the funds in each channel from a remote force closed transaction.
166
- */
167
- ChanBackupSnapshot channel_backups = 5;
168
- }
169
- message InitWalletResponse {
170
- }
171
-
172
- message UnlockWalletRequest {
173
- /**
174
- wallet_password should be the current valid passphrase for the daemon. This
175
- will be required to decrypt on-disk material that the daemon requires to
176
- function properly. When using REST, this field must be encoded as base64.
177
- */
178
- bytes wallet_password = 1;
179
-
180
- /**
181
- recovery_window is an optional argument specifying the address lookahead
182
- when restoring a wallet seed. The recovery window applies to each
183
- individual branch of the BIP44 derivation paths. Supplying a recovery
184
- window of zero indicates that no addresses should be recovered, such after
185
- the first initialization of the wallet.
186
- */
187
- int32 recovery_window = 2;
188
-
189
- /**
190
- channel_backups is an optional argument that allows clients to recover the
191
- settled funds within a set of channels. This should be populated if the
192
- user was unable to close out all channels and sweep funds before partial or
193
- total data loss occurred. If specified, then after on-chain recovery of
194
- funds, lnd begin to carry out the data loss recovery protocol in order to
195
- recover the funds in each channel from a remote force closed transaction.
196
- */
197
- ChanBackupSnapshot channel_backups = 3;
198
- }
199
- message UnlockWalletResponse {
200
- }
201
-
202
- message ChangePasswordRequest {
203
- /**
204
- current_password should be the current valid passphrase used to unlock the
205
- daemon. When using REST, this field must be encoded as base64.
206
- */
207
- bytes current_password = 1;
208
-
209
- /**
210
- new_password should be the new passphrase that will be needed to unlock the
211
- daemon. When using REST, this field must be encoded as base64.
212
- */
213
- bytes new_password = 2;
214
- }
215
- message ChangePasswordResponse {
216
- }
217
-
218
- service Lightning {
219
- /** lncli: `walletbalance`
220
- WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
221
- confirmed unspent outputs and all unconfirmed unspent outputs under control
222
- of the wallet.
223
- */
224
- rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) {
225
- option (google.api.http) = {
226
- get: "/v1/balance/blockchain"
227
- };
228
- }
229
-
230
- /** lncli: `channelbalance`
231
- ChannelBalance returns the total funds available across all open channels
232
- in satoshis.
233
- */
234
- rpc ChannelBalance (ChannelBalanceRequest)
235
- returns (ChannelBalanceResponse) {
236
- option (google.api.http) = {
237
- get: "/v1/balance/channels"
238
- };
239
- }
240
-
241
- /** lncli: `listchaintxns`
242
- GetTransactions returns a list describing all the known transactions
243
- relevant to the wallet.
244
- */
245
- rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) {
246
- option (google.api.http) = {
247
- get: "/v1/transactions"
248
- };
249
- }
250
-
251
- /** lncli: `estimatefee`
252
- EstimateFee asks the chain backend to estimate the fee rate and total fees
253
- for a transaction that pays to multiple specified outputs.
254
- */
255
- rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) {
256
- option (google.api.http) = {
257
- get: "/v1/transactions/fee"
258
- };
259
- }
260
-
261
- /** lncli: `sendcoins`
262
- SendCoins executes a request to send coins to a particular address. Unlike
263
- SendMany, this RPC call only allows creating a single output at a time. If
264
- neither target_conf, or sat_per_byte are set, then the internal wallet will
265
- consult its fee model to determine a fee for the default confirmation
266
- target.
267
- */
268
- rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) {
269
- option (google.api.http) = {
270
- post: "/v1/transactions"
271
- body: "*"
272
- };
273
- }
274
-
275
- /** lncli: `listunspent`
276
- ListUnspent returns a list of all utxos spendable by the wallet with a
277
- number of confirmations between the specified minimum and maximum.
278
- */
279
- rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) {
280
- option (google.api.http) = {
281
- get: "/v1/utxos"
282
- };
283
- }
284
-
285
- /**
286
- SubscribeTransactions creates a uni-directional stream from the server to
287
- the client in which any newly discovered transactions relevant to the
288
- wallet are sent over.
289
- */
290
- rpc SubscribeTransactions (GetTransactionsRequest)
291
- returns (stream Transaction);
292
-
293
- /** lncli: `sendmany`
294
- SendMany handles a request for a transaction that creates multiple specified
295
- outputs in parallel. If neither target_conf, or sat_per_byte are set, then
296
- the internal wallet will consult its fee model to determine a fee for the
297
- default confirmation target.
298
- */
299
- rpc SendMany (SendManyRequest) returns (SendManyResponse);
300
-
301
- /** lncli: `newaddress`
302
- NewAddress creates a new address under control of the local wallet.
303
- */
304
- rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) {
305
- option (google.api.http) = {
306
- get: "/v1/newaddress"
307
- };
308
- }
309
-
310
- /** lncli: `signmessage`
311
- SignMessage signs a message with this node's private key. The returned
312
- signature string is `zbase32` encoded and pubkey recoverable, meaning that
313
- only the message digest and signature are needed for verification.
314
- */
315
- rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) {
316
- option (google.api.http) = {
317
- post: "/v1/signmessage"
318
- body: "*"
319
- };
320
- }
321
-
322
- /** lncli: `verifymessage`
323
- VerifyMessage verifies a signature over a msg. The signature must be
324
- zbase32 encoded and signed by an active node in the resident node's
325
- channel database. In addition to returning the validity of the signature,
326
- VerifyMessage also returns the recovered pubkey from the signature.
327
- */
328
- rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) {
329
- option (google.api.http) = {
330
- post: "/v1/verifymessage"
331
- body: "*"
332
- };
333
- }
334
-
335
- /** lncli: `connect`
336
- ConnectPeer attempts to establish a connection to a remote peer. This is at
337
- the networking level, and is used for communication between nodes. This is
338
- distinct from establishing a channel with a peer.
339
- */
340
- rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) {
341
- option (google.api.http) = {
342
- post: "/v1/peers"
343
- body: "*"
344
- };
345
- }
346
-
347
- /** lncli: `disconnect`
348
- DisconnectPeer attempts to disconnect one peer from another identified by a
349
- given pubKey. In the case that we currently have a pending or active channel
350
- with the target peer, then this action will be not be allowed.
351
- */
352
- rpc DisconnectPeer (DisconnectPeerRequest)
353
- returns (DisconnectPeerResponse) {
354
- option (google.api.http) = {
355
- delete: "/v1/peers/{pub_key}"
356
- };
357
- }
358
-
359
- /** lncli: `listpeers`
360
- ListPeers returns a verbose listing of all currently active peers.
361
- */
362
- rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) {
363
- option (google.api.http) = {
364
- get: "/v1/peers"
365
- };
366
- }
367
-
368
- /**
369
- SubscribePeerEvents creates a uni-directional stream from the server to
370
- the client in which any events relevant to the state of peers are sent
371
- over. Events include peers going online and offline.
372
- */
373
- rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent);
374
-
375
- /** lncli: `getinfo`
376
- GetInfo returns general information concerning the lightning node including
377
- it's identity pubkey, alias, the chains it is connected to, and information
378
- concerning the number of open+pending channels.
379
- */
380
- rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {
381
- option (google.api.http) = {
382
- get: "/v1/getinfo"
383
- };
384
- }
385
-
386
- // TODO(roasbeef): merge with below with bool?
387
- /** lncli: `pendingchannels`
388
- PendingChannels returns a list of all the channels that are currently
389
- considered "pending". A channel is pending if it has finished the funding
390
- workflow and is waiting for confirmations for the funding txn, or is in the
391
- process of closure, either initiated cooperatively or non-cooperatively.
392
- */
393
- rpc PendingChannels (PendingChannelsRequest)
394
- returns (PendingChannelsResponse) {
395
- option (google.api.http) = {
396
- get: "/v1/channels/pending"
397
- };
398
- }
399
-
400
- /** lncli: `listchannels`
401
- ListChannels returns a description of all the open channels that this node
402
- is a participant in.
403
- */
404
- rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) {
405
- option (google.api.http) = {
406
- get: "/v1/channels"
407
- };
408
- }
409
-
410
- /**
411
- SubscribeChannelEvents creates a uni-directional stream from the server to
412
- the client in which any updates relevant to the state of the channels are
413
- sent over. Events include new active channels, inactive channels, and closed
414
- channels.
415
- */
416
- rpc SubscribeChannelEvents (ChannelEventSubscription)
417
- returns (stream ChannelEventUpdate);
418
-
419
- /** lncli: `closedchannels`
420
- ClosedChannels returns a description of all the closed channels that
421
- this node was a participant in.
422
- */
423
- rpc ClosedChannels (ClosedChannelsRequest)
424
- returns (ClosedChannelsResponse) {
425
- option (google.api.http) = {
426
- get: "/v1/channels/closed"
427
- };
428
- }
429
-
430
- /**
431
- OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
432
- call is meant to be consumed by clients to the REST proxy. As with all
433
- other sync calls, all byte slices are intended to be populated as hex
434
- encoded strings.
435
- */
436
- rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) {
437
- option (google.api.http) = {
438
- post: "/v1/channels"
439
- body: "*"
440
- };
441
- }
442
-
443
- /** lncli: `openchannel`
444
- OpenChannel attempts to open a singly funded channel specified in the
445
- request to a remote peer. Users are able to specify a target number of
446
- blocks that the funding transaction should be confirmed in, or a manual fee
447
- rate to us for the funding transaction. If neither are specified, then a
448
- lax block confirmation target is used. Each OpenStatusUpdate will return
449
- the pending channel ID of the in-progress channel. Depending on the
450
- arguments specified in the OpenChannelRequest, this pending channel ID can
451
- then be used to manually progress the channel funding flow.
452
- */
453
- rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
454
-
455
- /**
456
- FundingStateStep is an advanced funding related call that allows the caller
457
- to either execute some preparatory steps for a funding workflow, or
458
- manually progress a funding workflow. The primary way a funding flow is
459
- identified is via its pending channel ID. As an example, this method can be
460
- used to specify that we're expecting a funding flow for a particular
461
- pending channel ID, for which we need to use specific parameters.
462
- Alternatively, this can be used to interactively drive PSBT signing for
463
- funding for partially complete funding transactions.
464
- */
465
- rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp);
466
-
467
- /**
468
- ChannelAcceptor dispatches a bi-directional streaming RPC in which
469
- OpenChannel requests are sent to the client and the client responds with
470
- a boolean that tells LND whether or not to accept the channel. This allows
471
- node operators to specify their own criteria for accepting inbound channels
472
- through a single persistent connection.
473
- */
474
- rpc ChannelAcceptor (stream ChannelAcceptResponse)
475
- returns (stream ChannelAcceptRequest);
476
-
477
- /** lncli: `closechannel`
478
- CloseChannel attempts to close an active channel identified by its channel
479
- outpoint (ChannelPoint). The actions of this method can additionally be
480
- augmented to attempt a force close after a timeout period in the case of an
481
- inactive peer. If a non-force close (cooperative closure) is requested,
482
- then the user can specify either a target number of blocks until the
483
- closure transaction is confirmed, or a manual fee rate. If neither are
484
- specified, then a default lax, block confirmation target is used.
485
- */
486
- rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) {
487
- option (google.api.http) = {
488
- delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}"
489
- };
490
- }
491
-
492
- /** lncli: `abandonchannel`
493
- AbandonChannel removes all channel state from the database except for a
494
- close summary. This method can be used to get rid of permanently unusable
495
- channels due to bugs fixed in newer versions of lnd. Only available
496
- when in debug builds of lnd.
497
- */
498
- rpc AbandonChannel (AbandonChannelRequest)
499
- returns (AbandonChannelResponse) {
500
- option (google.api.http) = {
501
- delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}"
502
- };
503
- }
504
-
505
- /** lncli: `sendpayment`
506
- Deprecated, use routerrpc.SendPayment. SendPayment dispatches a
507
- bi-directional streaming RPC for sending payments through the Lightning
508
- Network. A single RPC invocation creates a persistent bi-directional
509
- stream allowing clients to rapidly send payments through the Lightning
510
- Network with a single persistent connection.
511
- */
512
- rpc SendPayment (stream SendRequest) returns (stream SendResponse) {
513
- option deprecated = true;
514
- }
515
-
516
- /**
517
- SendPaymentSync is the synchronous non-streaming version of SendPayment.
518
- This RPC is intended to be consumed by clients of the REST proxy.
519
- Additionally, this RPC expects the destination's public key and the payment
520
- hash (if any) to be encoded as hex strings.
521
- */
522
- rpc SendPaymentSync (SendRequest) returns (SendResponse) {
523
- option (google.api.http) = {
524
- post: "/v1/channels/transactions"
525
- body: "*"
526
- };
527
- }
528
-
529
- /** lncli: `sendtoroute`
530
- SendToRoute is a bi-directional streaming RPC for sending payment through
531
- the Lightning Network. This method differs from SendPayment in that it
532
- allows users to specify a full route manually. This can be used for things
533
- like rebalancing, and atomic swaps.
534
- */
535
- rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse);
536
-
537
- /**
538
- SendToRouteSync is a synchronous version of SendToRoute. It Will block
539
- until the payment either fails or succeeds.
540
- */
541
- rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) {
542
- option (google.api.http) = {
543
- post: "/v1/channels/transactions/route"
544
- body: "*"
545
- };
546
- }
547
-
548
- /** lncli: `addinvoice`
549
- AddInvoice attempts to add a new invoice to the invoice database. Any
550
- duplicated invoices are rejected, therefore all invoices *must* have a
551
- unique payment preimage.
552
- */
553
- rpc AddInvoice (Invoice) returns (AddInvoiceResponse) {
554
- option (google.api.http) = {
555
- post: "/v1/invoices"
556
- body: "*"
557
- };
558
- }
559
-
560
- /** lncli: `listinvoices`
561
- ListInvoices returns a list of all the invoices currently stored within the
562
- database. Any active debug invoices are ignored. It has full support for
563
- paginated responses, allowing users to query for specific invoices through
564
- their add_index. This can be done by using either the first_index_offset or
565
- last_index_offset fields included in the response as the index_offset of the
566
- next request. By default, the first 100 invoices created will be returned.
567
- Backwards pagination is also supported through the Reversed flag.
568
- */
569
- rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) {
570
- option (google.api.http) = {
571
- get: "/v1/invoices"
572
- };
573
- }
574
-
575
- /** lncli: `lookupinvoice`
576
- LookupInvoice attempts to look up an invoice according to its payment hash.
577
- The passed payment hash *must* be exactly 32 bytes, if not, an error is
578
- returned.
579
- */
580
- rpc LookupInvoice (PaymentHash) returns (Invoice) {
581
- option (google.api.http) = {
582
- get: "/v1/invoice/{r_hash_str}"
583
- };
584
- }
585
-
586
- /**
587
- SubscribeInvoices returns a uni-directional stream (server -> client) for
588
- notifying the client of newly added/settled invoices. The caller can
589
- optionally specify the add_index and/or the settle_index. If the add_index
590
- is specified, then we'll first start by sending add invoice events for all
591
- invoices with an add_index greater than the specified value. If the
592
- settle_index is specified, the next, we'll send out all settle events for
593
- invoices with a settle_index greater than the specified value. One or both
594
- of these fields can be set. If no fields are set, then we'll only send out
595
- the latest add/settle events.
596
- */
597
- rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) {
598
- option (google.api.http) = {
599
- get: "/v1/invoices/subscribe"
600
- };
601
- }
602
-
603
- /** lncli: `decodepayreq`
604
- DecodePayReq takes an encoded payment request string and attempts to decode
605
- it, returning a full description of the conditions encoded within the
606
- payment request.
607
- */
608
- rpc DecodePayReq (PayReqString) returns (PayReq) {
609
- option (google.api.http) = {
610
- get: "/v1/payreq/{pay_req}"
611
- };
612
- }
613
-
614
- /** lncli: `listpayments`
615
- ListPayments returns a list of all outgoing payments.
616
- */
617
- rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) {
618
- option (google.api.http) = {
619
- get: "/v1/payments"
620
- };
621
- };
622
-
623
- /**
624
- DeleteAllPayments deletes all outgoing payments from DB.
625
- */
626
- rpc DeleteAllPayments (DeleteAllPaymentsRequest)
627
- returns (DeleteAllPaymentsResponse) {
628
- option (google.api.http) = {
629
- delete: "/v1/payments"
630
- };
631
- };
632
-
633
- /** lncli: `describegraph`
634
- DescribeGraph returns a description of the latest graph state from the
635
- point of view of the node. The graph information is partitioned into two
636
- components: all the nodes/vertexes, and all the edges that connect the
637
- vertexes themselves. As this is a directed graph, the edges also contain
638
- the node directional specific routing policy which includes: the time lock
639
- delta, fee information, etc.
640
- */
641
- rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) {
642
- option (google.api.http) = {
643
- get: "/v1/graph"
644
- };
645
- }
646
-
647
- /** lncli: `getnodemetrics`
648
- GetNodeMetrics returns node metrics calculated from the graph. Currently
649
- the only supported metric is betweenness centrality of individual nodes.
650
- */
651
- rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse) {
652
- option (google.api.http) = {
653
- get: "/v1/graph/nodemetrics"
654
- };
655
- }
656
-
657
- /** lncli: `getchaninfo`
658
- GetChanInfo returns the latest authenticated network announcement for the
659
- given channel identified by its channel ID: an 8-byte integer which
660
- uniquely identifies the location of transaction's funding output within the
661
- blockchain.
662
- */
663
- rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) {
664
- option (google.api.http) = {
665
- get: "/v1/graph/edge/{chan_id}"
666
- };
667
- }
668
-
669
- /** lncli: `getnodeinfo`
670
- GetNodeInfo returns the latest advertised, aggregated, and authenticated
671
- channel information for the specified node identified by its public key.
672
- */
673
- rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) {
674
- option (google.api.http) = {
675
- get: "/v1/graph/node/{pub_key}"
676
- };
677
- }
678
-
679
- /** lncli: `queryroutes`
680
- QueryRoutes attempts to query the daemon's Channel Router for a possible
681
- route to a target destination capable of carrying a specific amount of
682
- satoshis. The returned route contains the full details required to craft and
683
- send an HTLC, also including the necessary information that should be
684
- present within the Sphinx packet encapsulated within the HTLC.
685
- */
686
- rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse) {
687
- option (google.api.http) = {
688
- get: "/v1/graph/routes/{pub_key}/{amt}"
689
- };
690
- }
691
-
692
- /** lncli: `getnetworkinfo`
693
- GetNetworkInfo returns some basic stats about the known channel graph from
694
- the point of view of the node.
695
- */
696
- rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) {
697
- option (google.api.http) = {
698
- get: "/v1/graph/info"
699
- };
700
- }
701
-
702
- /** lncli: `stop`
703
- StopDaemon will send a shutdown request to the interrupt handler, triggering
704
- a graceful shutdown of the daemon.
705
- */
706
- rpc StopDaemon (StopRequest) returns (StopResponse);
707
-
708
- /**
709
- SubscribeChannelGraph launches a streaming RPC that allows the caller to
710
- receive notifications upon any changes to the channel graph topology from
711
- the point of view of the responding node. Events notified include: new
712
- nodes coming online, nodes updating their authenticated attributes, new
713
- channels being advertised, updates in the routing policy for a directional
714
- channel edge, and when channels are closed on-chain.
715
- */
716
- rpc SubscribeChannelGraph (GraphTopologySubscription)
717
- returns (stream GraphTopologyUpdate);
718
-
719
- /** lncli: `debuglevel`
720
- DebugLevel allows a caller to programmatically set the logging verbosity of
721
- lnd. The logging can be targeted according to a coarse daemon-wide logging
722
- level, or in a granular fashion to specify the logging for a target
723
- sub-system.
724
- */
725
- rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
726
-
727
- /** lncli: `feereport`
728
- FeeReport allows the caller to obtain a report detailing the current fee
729
- schedule enforced by the node globally for each channel.
730
- */
731
- rpc FeeReport (FeeReportRequest) returns (FeeReportResponse) {
732
- option (google.api.http) = {
733
- get: "/v1/fees"
734
- };
735
- }
736
-
737
- /** lncli: `updatechanpolicy`
738
- UpdateChannelPolicy allows the caller to update the fee schedule and
739
- channel policies for all channels globally, or a particular channel.
740
- */
741
- rpc UpdateChannelPolicy (PolicyUpdateRequest)
742
- returns (PolicyUpdateResponse) {
743
- option (google.api.http) = {
744
- post: "/v1/chanpolicy"
745
- body: "*"
746
- };
747
- }
748
-
749
- /** lncli: `fwdinghistory`
750
- ForwardingHistory allows the caller to query the htlcswitch for a record of
751
- all HTLCs forwarded within the target time range, and integer offset
752
- within that time range. If no time-range is specified, then the first chunk
753
- of the past 24 hrs of forwarding history are returned.
754
-
755
- A list of forwarding events are returned. The size of each forwarding event
756
- is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
757
- As a result each message can only contain 50k entries. Each response has
758
- the index offset of the last entry. The index offset can be provided to the
759
- request to allow the caller to skip a series of records.
760
- */
761
- rpc ForwardingHistory (ForwardingHistoryRequest)
762
- returns (ForwardingHistoryResponse) {
763
- option (google.api.http) = {
764
- post: "/v1/switch"
765
- body: "*"
766
- };
767
- };
768
-
769
- /** lncli: `exportchanbackup`
770
- ExportChannelBackup attempts to return an encrypted static channel backup
771
- for the target channel identified by it channel point. The backup is
772
- encrypted with a key generated from the aezeed seed of the user. The
773
- returned backup can either be restored using the RestoreChannelBackup
774
- method once lnd is running, or via the InitWallet and UnlockWallet methods
775
- from the WalletUnlocker service.
776
- */
777
- rpc ExportChannelBackup (ExportChannelBackupRequest)
778
- returns (ChannelBackup) {
779
- option (google.api.http) = {
780
- get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}"
781
- };
782
- };
783
-
784
- /**
785
- ExportAllChannelBackups returns static channel backups for all existing
786
- channels known to lnd. A set of regular singular static channel backups for
787
- each channel are returned. Additionally, a multi-channel backup is returned
788
- as well, which contains a single encrypted blob containing the backups of
789
- each channel.
790
- */
791
- rpc ExportAllChannelBackups (ChanBackupExportRequest)
792
- returns (ChanBackupSnapshot) {
793
- option (google.api.http) = {
794
- get: "/v1/channels/backup"
795
- };
796
- };
797
-
798
- /**
799
- VerifyChanBackup allows a caller to verify the integrity of a channel backup
800
- snapshot. This method will accept either a packed Single or a packed Multi.
801
- Specifying both will result in an error.
802
- */
803
- rpc VerifyChanBackup (ChanBackupSnapshot)
804
- returns (VerifyChanBackupResponse) {
805
- option (google.api.http) = {
806
- post: "/v1/channels/backup/verify"
807
- body: "*"
808
- };
809
- };
810
-
811
- /** lncli: `restorechanbackup`
812
- RestoreChannelBackups accepts a set of singular channel backups, or a
813
- single encrypted multi-chan backup and attempts to recover any funds
814
- remaining within the channel. If we are able to unpack the backup, then the
815
- new channel will be shown under listchannels, as well as pending channels.
816
- */
817
- rpc RestoreChannelBackups (RestoreChanBackupRequest)
818
- returns (RestoreBackupResponse) {
819
- option (google.api.http) = {
820
- post: "/v1/channels/backup/restore"
821
- body: "*"
822
- };
823
- };
824
-
825
- /**
826
- SubscribeChannelBackups allows a client to sub-subscribe to the most up to
827
- date information concerning the state of all channel backups. Each time a
828
- new channel is added, we return the new set of channels, along with a
829
- multi-chan backup containing the backup info for all channels. Each time a
830
- channel is closed, we send a new update, which contains new new chan back
831
- ups, but the updated set of encrypted multi-chan backups with the closed
832
- channel(s) removed.
833
- */
834
- rpc SubscribeChannelBackups (ChannelBackupSubscription)
835
- returns (stream ChanBackupSnapshot) {
836
- };
837
-
838
- /** lncli: `bakemacaroon`
839
- BakeMacaroon allows the creation of a new macaroon with custom read and
840
- write permissions. No first-party caveats are added since this can be done
841
- offline.
842
- */
843
- rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse) {
844
- option (google.api.http) = {
845
- post: "/v1/macaroon"
846
- body: "*"
847
- };
848
- };
849
- }
850
-
851
- message Utxo {
852
- /// The type of address
853
- AddressType address_type = 1;
854
-
855
- /// The address
856
- string address = 2;
857
-
858
- /// The value of the unspent coin in satoshis
859
- int64 amount_sat = 3;
860
-
861
- /// The pkscript in hex
862
- string pk_script = 4;
863
-
864
- /// The outpoint in format txid:n
865
- OutPoint outpoint = 5;
866
-
867
- /// The number of confirmations for the Utxo
868
- int64 confirmations = 6;
869
- }
870
-
871
- message Transaction {
872
- /// The transaction hash
873
- string tx_hash = 1;
874
-
875
- /// The transaction amount, denominated in satoshis
876
- int64 amount = 2;
877
-
878
- /// The number of confirmations
879
- int32 num_confirmations = 3;
880
-
881
- /// The hash of the block this transaction was included in
882
- string block_hash = 4;
883
-
884
- /// The height of the block this transaction was included in
885
- int32 block_height = 5;
886
-
887
- /// Timestamp of this transaction
888
- int64 time_stamp = 6;
889
-
890
- /// Fees paid for this transaction
891
- int64 total_fees = 7;
892
-
893
- /// Addresses that received funds for this transaction
894
- repeated string dest_addresses = 8;
895
-
896
- /// The raw transaction hex.
897
- string raw_tx_hex = 9;
898
- }
899
- message GetTransactionsRequest {
900
- }
901
- message TransactionDetails {
902
- /// The list of transactions relevant to the wallet.
903
- repeated Transaction transactions = 1;
904
- }
905
-
906
- message FeeLimit {
907
- oneof limit {
908
- /**
909
- The fee limit expressed as a fixed amount of satoshis.
910
-
911
- The fields fixed and fixed_msat are mutually exclusive.
912
- */
913
- int64 fixed = 1;
914
-
915
- /**
916
- The fee limit expressed as a fixed amount of millisatoshis.
917
-
918
- The fields fixed and fixed_msat are mutually exclusive.
919
- */
920
- int64 fixed_msat = 3;
921
-
922
- /// The fee limit expressed as a percentage of the payment amount.
923
- int64 percent = 2;
924
- }
925
- }
926
-
927
- message SendRequest {
928
- /**
929
- The identity pubkey of the payment recipient. When using REST, this field
930
- must be encoded as base64.
931
- */
932
- bytes dest = 1;
933
-
934
- /**
935
- The hex-encoded identity pubkey of the payment recipient. Deprecated now
936
- that the REST gateway supports base64 encoding of bytes fields.
937
- */
938
- string dest_string = 2 [deprecated = true];
939
-
940
- /**
941
- The amount to send expressed in satoshis.
942
-
943
- The fields amt and amt_msat are mutually exclusive.
944
- */
945
- int64 amt = 3;
946
-
947
- /**
948
- The amount to send expressed in millisatoshis.
949
-
950
- The fields amt and amt_msat are mutually exclusive.
951
- */
952
- int64 amt_msat = 12;
953
-
954
- /**
955
- The hash to use within the payment's HTLC. When using REST, this field
956
- must be encoded as base64.
957
- */
958
- bytes payment_hash = 4;
959
-
960
- /**
961
- The hex-encoded hash to use within the payment's HTLC. Deprecated now
962
- that the REST gateway supports base64 encoding of bytes fields.
963
- */
964
- string payment_hash_string = 5 [deprecated = true];
965
-
966
- /**
967
- A bare-bones invoice for a payment within the Lightning Network. With the
968
- details of the invoice, the sender has all the data necessary to send a
969
- payment to the recipient.
970
- */
971
- string payment_request = 6;
972
-
973
- /**
974
- The CLTV delta from the current height that should be used to set the
975
- timelock for the final hop.
976
- */
977
- int32 final_cltv_delta = 7;
978
-
979
- /**
980
- The maximum number of satoshis that will be paid as a fee of the payment.
981
- This value can be represented either as a percentage of the amount being
982
- sent, or as a fixed amount of the maximum fee the user is willing the pay to
983
- send the payment.
984
- */
985
- FeeLimit fee_limit = 8;
986
-
987
- /**
988
- The channel id of the channel that must be taken to the first hop. If zero,
989
- any channel may be used.
990
- */
991
- uint64 outgoing_chan_id = 9 [jstype = JS_STRING];
992
-
993
- /**
994
- The pubkey of the last hop of the route. If empty, any hop may be used.
995
- */
996
- bytes last_hop_pubkey = 13;
997
-
998
- /**
999
- An optional maximum total time lock for the route. This should not exceed
1000
- lnd's `--max-cltv-expiry` setting. If zero, then the value of
1001
- `--max-cltv-expiry` is enforced.
1002
- */
1003
- uint32 cltv_limit = 10;
1004
-
1005
- /**
1006
- An optional field that can be used to pass an arbitrary set of TLV records
1007
- to a peer which understands the new records. This can be used to pass
1008
- application specific data during the payment attempt. Record types are
1009
- required to be in the custom range >= 65536. When using REST, the values
1010
- must be encoded as base64.
1011
- */
1012
- map<uint64, bytes> dest_custom_records = 11;
1013
-
1014
- /// If set, circular payments to self are permitted.
1015
- bool allow_self_payment = 14;
1016
-
1017
- /**
1018
- Features assumed to be supported by the final node. All transitive feature
1019
- dependencies must also be set properly. For a given feature bit pair, either
1020
- optional or remote may be set, but not both. If this field is nil or empty,
1021
- the router will try to load destination features from the graph as a
1022
- fallback.
1023
- */
1024
- repeated FeatureBit dest_features = 15;
1025
- }
1026
-
1027
- message SendResponse {
1028
- string payment_error = 1;
1029
- bytes payment_preimage = 2;
1030
- Route payment_route = 3;
1031
- bytes payment_hash = 4;
1032
- }
1033
-
1034
- message SendToRouteRequest {
1035
- /**
1036
- The payment hash to use for the HTLC. When using REST, this field must be
1037
- encoded as base64.
1038
- */
1039
- bytes payment_hash = 1;
1040
-
1041
- /**
1042
- An optional hex-encoded payment hash to be used for the HTLC. Deprecated now
1043
- that the REST gateway supports base64 encoding of bytes fields.
1044
- */
1045
- string payment_hash_string = 2 [deprecated = true];
1046
-
1047
- reserved 3;
1048
-
1049
- /// Route that should be used to attempt to complete the payment.
1050
- Route route = 4;
1051
- }
1052
-
1053
- message ChannelAcceptRequest {
1054
- /// The pubkey of the node that wishes to open an inbound channel.
1055
- bytes node_pubkey = 1;
1056
-
1057
- /// The hash of the genesis block that the proposed channel resides in.
1058
- bytes chain_hash = 2;
1059
-
1060
- /// The pending channel id.
1061
- bytes pending_chan_id = 3;
1062
-
1063
- /// The funding amount in satoshis that initiator wishes to use in the
1064
- /// channel.
1065
- uint64 funding_amt = 4;
1066
-
1067
- /// The push amount of the proposed channel in millisatoshis.
1068
- uint64 push_amt = 5;
1069
-
1070
- /// The dust limit of the initiator's commitment tx.
1071
- uint64 dust_limit = 6;
1072
-
1073
- /// The maximum amount of coins in millisatoshis that can be pending in this
1074
- /// channel.
1075
- uint64 max_value_in_flight = 7;
1076
-
1077
- /// The minimum amount of satoshis the initiator requires us to have at all
1078
- /// times.
1079
- uint64 channel_reserve = 8;
1080
-
1081
- /// The smallest HTLC in millisatoshis that the initiator will accept.
1082
- uint64 min_htlc = 9;
1083
-
1084
- /// The initial fee rate that the initiator suggests for both commitment
1085
- /// transactions.
1086
- uint64 fee_per_kw = 10;
1087
-
1088
- /**
1089
- The number of blocks to use for the relative time lock in the pay-to-self
1090
- output of both commitment transactions.
1091
- */
1092
- uint32 csv_delay = 11;
1093
-
1094
- /// The total number of incoming HTLC's that the initiator will accept.
1095
- uint32 max_accepted_htlcs = 12;
1096
-
1097
- /// A bit-field which the initiator uses to specify proposed channel
1098
- /// behavior.
1099
- uint32 channel_flags = 13;
1100
- }
1101
-
1102
- message ChannelAcceptResponse {
1103
- /// Whether or not the client accepts the channel.
1104
- bool accept = 1;
1105
-
1106
- /// The pending channel id to which this response applies.
1107
- bytes pending_chan_id = 2;
1108
- }
1109
-
1110
- message ChannelPoint {
1111
- oneof funding_txid {
1112
- /**
1113
- Txid of the funding transaction. When using REST, this field must be
1114
- encoded as base64.
1115
- */
1116
- bytes funding_txid_bytes = 1;
1117
-
1118
- /**
1119
- Hex-encoded string representing the byte-reversed hash of the funding
1120
- transaction.
1121
- */
1122
- string funding_txid_str = 2;
1123
- }
1124
-
1125
- /// The index of the output of the funding transaction
1126
- uint32 output_index = 3;
1127
- }
1128
-
1129
- message OutPoint {
1130
- /// Raw bytes representing the transaction id.
1131
- bytes txid_bytes = 1;
1132
-
1133
- /// Reversed, hex-encoded string representing the transaction id.
1134
- string txid_str = 2;
1135
-
1136
- /// The index of the output on the transaction.
1137
- uint32 output_index = 3;
1138
- }
1139
-
1140
- message LightningAddress {
1141
- /// The identity pubkey of the Lightning node
1142
- string pubkey = 1;
1143
-
1144
- /// The network location of the lightning node, e.g. `69.69.69.69:1337` or
1145
- /// `localhost:10011`
1146
- string host = 2;
1147
- }
1148
-
1149
- message EstimateFeeRequest {
1150
- /// The map from addresses to amounts for the transaction.
1151
- map<string, int64> AddrToAmount = 1;
1152
-
1153
- /// The target number of blocks that this transaction should be confirmed
1154
- /// by.
1155
- int32 target_conf = 2;
1156
- }
1157
-
1158
- message EstimateFeeResponse {
1159
- /// The total fee in satoshis.
1160
- int64 fee_sat = 1;
1161
-
1162
- /// The fee rate in satoshi/byte.
1163
- int64 feerate_sat_per_byte = 2;
1164
- }
1165
-
1166
- message SendManyRequest {
1167
- /// The map from addresses to amounts
1168
- map<string, int64> AddrToAmount = 1;
1169
-
1170
- /// The target number of blocks that this transaction should be confirmed
1171
- /// by.
1172
- int32 target_conf = 3;
1173
-
1174
- /// A manual fee rate set in sat/byte that should be used when crafting the
1175
- /// transaction.
1176
- int64 sat_per_byte = 5;
1177
- }
1178
- message SendManyResponse {
1179
- /// The id of the transaction
1180
- string txid = 1;
1181
- }
1182
-
1183
- message SendCoinsRequest {
1184
- /// The address to send coins to
1185
- string addr = 1;
1186
-
1187
- /// The amount in satoshis to send
1188
- int64 amount = 2;
1189
-
1190
- /// The target number of blocks that this transaction should be confirmed
1191
- /// by.
1192
- int32 target_conf = 3;
1193
-
1194
- /// A manual fee rate set in sat/byte that should be used when crafting the
1195
- /// transaction.
1196
- int64 sat_per_byte = 5;
1197
-
1198
- /**
1199
- If set, then the amount field will be ignored, and lnd will attempt to
1200
- send all the coins under control of the internal wallet to the specified
1201
- address.
1202
- */
1203
- bool send_all = 6;
1204
- }
1205
- message SendCoinsResponse {
1206
- /// The transaction ID of the transaction
1207
- string txid = 1;
1208
- }
1209
-
1210
- message ListUnspentRequest {
1211
- /// The minimum number of confirmations to be included.
1212
- int32 min_confs = 1;
1213
-
1214
- /// The maximum number of confirmations to be included.
1215
- int32 max_confs = 2;
1216
- }
1217
- message ListUnspentResponse {
1218
- /// A list of utxos
1219
- repeated Utxo utxos = 1;
1220
- }
1221
-
1222
- /**
1223
- `AddressType` has to be one of:
1224
-
1225
- - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0)
1226
- - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
1227
- */
1228
- enum AddressType {
1229
- WITNESS_PUBKEY_HASH = 0;
1230
- NESTED_PUBKEY_HASH = 1;
1231
- UNUSED_WITNESS_PUBKEY_HASH = 2;
1232
- UNUSED_NESTED_PUBKEY_HASH = 3;
1233
- }
1234
-
1235
- message NewAddressRequest {
1236
- /// The address type
1237
- AddressType type = 1;
1238
- }
1239
- message NewAddressResponse {
1240
- /// The newly generated wallet address
1241
- string address = 1;
1242
- }
1243
-
1244
- message SignMessageRequest {
1245
- /**
1246
- The message to be signed. When using REST, this field must be encoded as
1247
- base64.
1248
- */
1249
- bytes msg = 1;
1250
- }
1251
- message SignMessageResponse {
1252
- /// The signature for the given message
1253
- string signature = 1;
1254
- }
1255
-
1256
- message VerifyMessageRequest {
1257
- /**
1258
- The message over which the signature is to be verified. When using REST,
1259
- this field must be encoded as base64.
1260
- */
1261
- bytes msg = 1;
1262
-
1263
- /// The signature to be verified over the given message
1264
- string signature = 2;
1265
- }
1266
- message VerifyMessageResponse {
1267
- /// Whether the signature was valid over the given message
1268
- bool valid = 1;
1269
-
1270
- /// The pubkey recovered from the signature
1271
- string pubkey = 2;
1272
- }
1273
-
1274
- message ConnectPeerRequest {
1275
- /// Lightning address of the peer, in the format `<pubkey>@host`
1276
- LightningAddress addr = 1;
1277
-
1278
- /** If set, the daemon will attempt to persistently connect to the target
1279
- * peer. Otherwise, the call will be synchronous. */
1280
- bool perm = 2;
1281
- }
1282
- message ConnectPeerResponse {
1283
- }
1284
-
1285
- message DisconnectPeerRequest {
1286
- /// The pubkey of the node to disconnect from
1287
- string pub_key = 1;
1288
- }
1289
- message DisconnectPeerResponse {
1290
- }
1291
-
1292
- message HTLC {
1293
- bool incoming = 1;
1294
- int64 amount = 2;
1295
- bytes hash_lock = 3;
1296
- uint32 expiration_height = 4;
1297
- }
1298
-
1299
- enum CommitmentType {
1300
- /**
1301
- A channel using the legacy commitment format having tweaked to_remote
1302
- keys.
1303
- */
1304
- LEGACY = 0;
1305
-
1306
- /**
1307
- A channel that uses the modern commitment format where the key in the
1308
- output of the remote party does not change each state. This makes back
1309
- up and recovery easier as when the channel is closed, the funds go
1310
- directly to that key.
1311
- */
1312
- STATIC_REMOTE_KEY = 1;
1313
-
1314
- /**
1315
- A channel that uses a commitment format that has anchor outputs on the
1316
- commitments, allowing fee bumping after a force close transaction has
1317
- been broadcast.
1318
- */
1319
- ANCHORS = 2;
1320
-
1321
- /**
1322
- Returned when the commitment type isn't known or unavailable.
1323
- */
1324
- UNKNOWN_COMMITMENT_TYPE = 999;
1325
- }
1326
-
1327
- message Channel {
1328
- /// Whether this channel is active or not
1329
- bool active = 1;
1330
-
1331
- /// The identity pubkey of the remote node
1332
- string remote_pubkey = 2;
1333
-
1334
- /**
1335
- The outpoint (txid:index) of the funding transaction. With this value, Bob
1336
- will be able to generate a signature for Alice's version of the commitment
1337
- transaction.
1338
- */
1339
- string channel_point = 3;
1340
-
1341
- /**
1342
- The unique channel ID for the channel. The first 3 bytes are the block
1343
- height, the next 3 the index within the block, and the last 2 bytes are the
1344
- output index for the channel.
1345
- */
1346
- uint64 chan_id = 4 [jstype = JS_STRING];
1347
-
1348
- /// The total amount of funds held in this channel
1349
- int64 capacity = 5;
1350
-
1351
- /// This node's current balance in this channel
1352
- int64 local_balance = 6;
1353
-
1354
- /// The counterparty's current balance in this channel
1355
- int64 remote_balance = 7;
1356
-
1357
- /**
1358
- The amount calculated to be paid in fees for the current set of commitment
1359
- transactions. The fee amount is persisted with the channel in order to
1360
- allow the fee amount to be removed and recalculated with each channel state
1361
- update, including updates that happen after a system restart.
1362
- */
1363
- int64 commit_fee = 8;
1364
-
1365
- /// The weight of the commitment transaction
1366
- int64 commit_weight = 9;
1367
-
1368
- /**
1369
- The required number of satoshis per kilo-weight that the requester will pay
1370
- at all times, for both the funding transaction and commitment transaction.
1371
- This value can later be updated once the channel is open.
1372
- */
1373
- int64 fee_per_kw = 10;
1374
-
1375
- /// The unsettled balance in this channel
1376
- int64 unsettled_balance = 11;
1377
-
1378
- /**
1379
- The total number of satoshis we've sent within this channel.
1380
- */
1381
- int64 total_satoshis_sent = 12;
1382
-
1383
- /**
1384
- The total number of satoshis we've received within this channel.
1385
- */
1386
- int64 total_satoshis_received = 13;
1387
-
1388
- /**
1389
- The total number of updates conducted within this channel.
1390
- */
1391
- uint64 num_updates = 14;
1392
-
1393
- /**
1394
- The list of active, uncleared HTLCs currently pending within the channel.
1395
- */
1396
- repeated HTLC pending_htlcs = 15;
1397
-
1398
- /**
1399
- The CSV delay expressed in relative blocks. If the channel is force closed,
1400
- we will need to wait for this many blocks before we can regain our funds.
1401
- */
1402
- uint32 csv_delay = 16;
1403
-
1404
- /// Whether this channel is advertised to the network or not.
1405
- bool private = 17;
1406
-
1407
- /// True if we were the ones that created the channel.
1408
- bool initiator = 18;
1409
-
1410
- /// A set of flags showing the current state of the channel.
1411
- string chan_status_flags = 19;
1412
-
1413
- /// The minimum satoshis this node is required to reserve in its balance.
1414
- int64 local_chan_reserve_sat = 20;
1415
-
1416
- /**
1417
- The minimum satoshis the other node is required to reserve in its balance.
1418
- */
1419
- int64 remote_chan_reserve_sat = 21;
1420
-
1421
- /// Deprecated. Use commitment_type.
1422
- bool static_remote_key = 22 [deprecated = true];
1423
-
1424
- /// The commitment type used by this channel.
1425
- CommitmentType commitment_type = 26;
1426
-
1427
- /**
1428
- The number of seconds that the channel has been monitored by the channel
1429
- scoring system. Scores are currently not persisted, so this value may be
1430
- less than the lifetime of the channel [EXPERIMENTAL].
1431
- */
1432
- int64 lifetime = 23;
1433
-
1434
- /**
1435
- The number of seconds that the remote peer has been observed as being online
1436
- by the channel scoring system over the lifetime of the channel
1437
- [EXPERIMENTAL].
1438
- */
1439
- int64 uptime = 24;
1440
-
1441
- /**
1442
- Close address is the address that we will enforce payout to on cooperative
1443
- close if the channel was opened utilizing option upfront shutdown. This
1444
- value can be set on channel open by setting close_address in an open channel
1445
- request. If this value is not set, you can still choose a payout address by
1446
- cooperatively closing with the delivery_address field set.
1447
- */
1448
- string close_address = 25;
1449
-
1450
- /*
1451
- The amount that the initiator of the channel optionally pushed to the remote
1452
- party on channel open. This amount will be zero if the channel initiator did
1453
- not push any funds to the remote peer. If the initiator field is true, we
1454
- pushed this amount to our peer, if it is false, the remote peer pushed this
1455
- amount to us.
1456
- */
1457
- uint64 push_amount_sat = 27;
1458
-
1459
- /**
1460
- This uint32 indicates if this channel is to be considered 'frozen'. A
1461
- frozen channel doest not allow a cooperative channel close by the
1462
- initiator. The thaw_height is the height that this restriction stops
1463
- applying to the channel. This field is optional, not setting it or using a
1464
- value of zero will mean the channel has no additional restrictions.
1465
- */
1466
- uint32 thaw_height = 28;
1467
- }
1468
-
1469
- message ListChannelsRequest {
1470
- bool active_only = 1;
1471
- bool inactive_only = 2;
1472
- bool public_only = 3;
1473
- bool private_only = 4;
1474
-
1475
- /**
1476
- Filters the response for channels with a target peer's pubkey. If peer is
1477
- empty, all channels will be returned.
1478
- */
1479
- bytes peer = 5;
1480
- }
1481
- message ListChannelsResponse {
1482
- /// The list of active channels
1483
- repeated Channel channels = 11;
1484
- }
1485
-
1486
- enum Initiator {
1487
- INITIATOR_UNKNOWN = 0;
1488
- INITIATOR_LOCAL = 1;
1489
- INITIATOR_REMOTE = 2;
1490
- INITIATOR_BOTH = 3;
1491
- }
1492
-
1493
- message ChannelCloseSummary {
1494
- /// The outpoint (txid:index) of the funding transaction.
1495
- string channel_point = 1;
1496
-
1497
- /// The unique channel ID for the channel.
1498
- uint64 chan_id = 2 [jstype = JS_STRING];
1499
-
1500
- /// The hash of the genesis block that this channel resides within.
1501
- string chain_hash = 3;
1502
-
1503
- /// The txid of the transaction which ultimately closed this channel.
1504
- string closing_tx_hash = 4;
1505
-
1506
- /// Public key of the remote peer that we formerly had a channel with.
1507
- string remote_pubkey = 5;
1508
-
1509
- /// Total capacity of the channel.
1510
- int64 capacity = 6;
1511
-
1512
- /// Height at which the funding transaction was spent.
1513
- uint32 close_height = 7;
1514
-
1515
- /// Settled balance at the time of channel closure
1516
- int64 settled_balance = 8;
1517
-
1518
- /// The sum of all the time-locked outputs at the time of channel closure
1519
- int64 time_locked_balance = 9;
1520
-
1521
- enum ClosureType {
1522
- COOPERATIVE_CLOSE = 0;
1523
- LOCAL_FORCE_CLOSE = 1;
1524
- REMOTE_FORCE_CLOSE = 2;
1525
- BREACH_CLOSE = 3;
1526
- FUNDING_CANCELED = 4;
1527
- ABANDONED = 5;
1528
- }
1529
-
1530
- /// Details on how the channel was closed.
1531
- ClosureType close_type = 10;
1532
-
1533
- /**
1534
- Open initiator is the party that initiated opening the channel. Note that
1535
- this value may be unknown if the channel was closed before we migrated to
1536
- store open channel information after close.
1537
- */
1538
- Initiator open_initiator = 11;
1539
-
1540
- /**
1541
- Close initiator indicates which party initiated the close. This value will
1542
- be unknown for channels that were cooperatively closed before we started
1543
- tracking cooperative close initiators. Note that this indicates which party
1544
- initiated a close, and it is possible for both to initiate cooperative or
1545
- force closes, although only one party's close will be confirmed on chain.
1546
- */
1547
- Initiator close_initiator = 12;
1548
- }
1549
-
1550
- message ClosedChannelsRequest {
1551
- bool cooperative = 1;
1552
- bool local_force = 2;
1553
- bool remote_force = 3;
1554
- bool breach = 4;
1555
- bool funding_canceled = 5;
1556
- bool abandoned = 6;
1557
- }
1558
-
1559
- message ClosedChannelsResponse {
1560
- repeated ChannelCloseSummary channels = 1;
1561
- }
1562
-
1563
- message Peer {
1564
- /// The identity pubkey of the peer
1565
- string pub_key = 1;
1566
-
1567
- /// Network address of the peer; eg `127.0.0.1:10011`
1568
- string address = 3;
1569
-
1570
- /// Bytes of data transmitted to this peer
1571
- uint64 bytes_sent = 4;
1572
-
1573
- /// Bytes of data transmitted from this peer
1574
- uint64 bytes_recv = 5;
1575
-
1576
- /// Satoshis sent to this peer
1577
- int64 sat_sent = 6;
1578
-
1579
- /// Satoshis received from this peer
1580
- int64 sat_recv = 7;
1581
-
1582
- /// A channel is inbound if the counterparty initiated the channel
1583
- bool inbound = 8;
1584
-
1585
- /// Ping time to this peer
1586
- int64 ping_time = 9;
1587
-
1588
- enum SyncType {
1589
- /**
1590
- Denotes that we cannot determine the peer's current sync type.
1591
- */
1592
- UNKNOWN_SYNC = 0;
1593
-
1594
- /**
1595
- Denotes that we are actively receiving new graph updates from the peer.
1596
- */
1597
- ACTIVE_SYNC = 1;
1598
-
1599
- /**
1600
- Denotes that we are not receiving new graph updates from the peer.
1601
- */
1602
- PASSIVE_SYNC = 2;
1603
- }
1604
-
1605
- // The type of sync we are currently performing with this peer.
1606
- SyncType sync_type = 10;
1607
-
1608
- /// Features advertised by the remote peer in their init message.
1609
- map<uint32, Feature> features = 11;
1610
-
1611
- /*
1612
- The latest errors received from our peer with timestamps, limited to the 10
1613
- most recent errors. These errors are tracked across peer connections, but
1614
- are not persisted across lnd restarts. Note that these errors are only
1615
- stored for peers that we have channels open with, to prevent peers from
1616
- spamming us with errors at no cost.
1617
- */
1618
- repeated TimestampedError errors = 12;
1619
- }
1620
-
1621
- message TimestampedError {
1622
- // The unix timestamp in seconds when the error occurred.
1623
- uint64 timestamp = 1;
1624
-
1625
- // The string representation of the error sent by our peer.
1626
- string error = 2;
1627
- }
1628
-
1629
- message ListPeersRequest {
1630
- /*
1631
- If true, only the last error that our peer sent us will be returned with
1632
- the peer's information, rather than the full set of historic errors we have
1633
- stored.
1634
- */
1635
- bool latest_error = 1;
1636
- }
1637
- message ListPeersResponse {
1638
- /// The list of currently connected peers
1639
- repeated Peer peers = 1;
1640
- }
1641
-
1642
- message PeerEventSubscription {
1643
- }
1644
-
1645
- message PeerEvent {
1646
- /// The identity pubkey of the peer.
1647
- string pub_key = 1;
1648
-
1649
- enum EventType {
1650
- PEER_ONLINE = 0;
1651
- PEER_OFFLINE = 1;
1652
- }
1653
-
1654
- EventType type = 2;
1655
- }
1656
-
1657
- message GetInfoRequest {
1658
- }
1659
- message GetInfoResponse {
1660
- /// The version of the LND software that the node is running.
1661
- string version = 14;
1662
-
1663
- /// The SHA1 commit hash that the daemon is compiled with.
1664
- string commit_hash = 20;
1665
-
1666
- /// The identity pubkey of the current node.
1667
- string identity_pubkey = 1;
1668
-
1669
- /// If applicable, the alias of the current node, e.g. "bob"
1670
- string alias = 2;
1671
-
1672
- /// The color of the current node in hex code format
1673
- string color = 17;
1674
-
1675
- /// Number of pending channels
1676
- uint32 num_pending_channels = 3;
1677
-
1678
- /// Number of active channels
1679
- uint32 num_active_channels = 4;
1680
-
1681
- /// Number of inactive channels
1682
- uint32 num_inactive_channels = 15;
1683
-
1684
- /// Number of peers
1685
- uint32 num_peers = 5;
1686
-
1687
- /// The node's current view of the height of the best block
1688
- uint32 block_height = 6;
1689
-
1690
- /// The node's current view of the hash of the best block
1691
- string block_hash = 8;
1692
-
1693
- /// Timestamp of the block best known to the wallet
1694
- int64 best_header_timestamp = 13;
1695
-
1696
- /// Whether the wallet's view is synced to the main chain
1697
- bool synced_to_chain = 9;
1698
-
1699
- // Whether we consider ourselves synced with the public channel graph.
1700
- bool synced_to_graph = 18;
1701
-
1702
- /**
1703
- Whether the current node is connected to testnet. This field is
1704
- deprecated and the network field should be used instead
1705
- **/
1706
- bool testnet = 10 [deprecated = true];
1707
-
1708
- reserved 11;
1709
-
1710
- /// A list of active chains the node is connected to
1711
- repeated Chain chains = 16;
1712
-
1713
- /// The URIs of the current node.
1714
- repeated string uris = 12;
1715
-
1716
- /*
1717
- Features that our node has advertised in our init message, node
1718
- announcements and invoices.
1719
- */
1720
- map<uint32, Feature> features = 19;
1721
- }
1722
-
1723
- message Chain {
1724
- /// The blockchain the node is on (eg bitcoin, litecoin)
1725
- string chain = 1;
1726
-
1727
- /// The network the node is on (eg regtest, testnet, mainnet)
1728
- string network = 2;
1729
- }
1730
-
1731
- message ConfirmationUpdate {
1732
- bytes block_sha = 1;
1733
- int32 block_height = 2;
1734
-
1735
- uint32 num_confs_left = 3;
1736
- }
1737
-
1738
- message ChannelOpenUpdate {
1739
- ChannelPoint channel_point = 1;
1740
- }
1741
-
1742
- message ChannelCloseUpdate {
1743
- bytes closing_txid = 1;
1744
-
1745
- bool success = 2;
1746
- }
1747
-
1748
- message CloseChannelRequest {
1749
- /**
1750
- The outpoint (txid:index) of the funding transaction. With this value, Bob
1751
- will be able to generate a signature for Alice's version of the commitment
1752
- transaction.
1753
- */
1754
- ChannelPoint channel_point = 1;
1755
-
1756
- /// If true, then the channel will be closed forcibly. This means the
1757
- /// current commitment transaction will be signed and broadcast.
1758
- bool force = 2;
1759
-
1760
- /// The target number of blocks that the closure transaction should be
1761
- /// confirmed by.
1762
- int32 target_conf = 3;
1763
-
1764
- /// A manual fee rate set in sat/byte that should be used when crafting the
1765
- /// closure transaction.
1766
- int64 sat_per_byte = 4;
1767
-
1768
- /*
1769
- An optional address to send funds to in the case of a cooperative close.
1770
- If the channel was opened with an upfront shutdown script and this field
1771
- is set, the request to close will fail because the channel must pay out
1772
- to the upfront shutdown addresss.
1773
- */
1774
- string delivery_address = 5;
1775
- }
1776
-
1777
- message CloseStatusUpdate {
1778
- oneof update {
1779
- PendingUpdate close_pending = 1;
1780
- ChannelCloseUpdate chan_close = 3;
1781
- }
1782
- }
1783
-
1784
- message PendingUpdate {
1785
- bytes txid = 1;
1786
- uint32 output_index = 2;
1787
- }
1788
-
1789
- message ReadyForPsbtFunding {
1790
- /**
1791
- The P2WSH address of the channel funding multisig address that the below
1792
- specified amount in satoshis needs to be sent to.
1793
- */
1794
- string funding_address = 1;
1795
-
1796
- /**
1797
- The exact amount in satoshis that needs to be sent to the above address to
1798
- fund the pending channel.
1799
- */
1800
- int64 funding_amount = 2;
1801
-
1802
- /**
1803
- A raw PSBT that contains the pending channel output. If a base PSBT was
1804
- provided in the PsbtShim, this is the base PSBT with one additional output.
1805
- If no base PSBT was specified, this is an otherwise empty PSBT with exactly
1806
- one output.
1807
- */
1808
- bytes psbt = 3;
1809
- }
1810
-
1811
- message OpenChannelRequest {
1812
- /**
1813
- The pubkey of the node to open a channel with. When using REST, this field
1814
- must be encoded as base64.
1815
- */
1816
- bytes node_pubkey = 2;
1817
-
1818
- /**
1819
- The hex encoded pubkey of the node to open a channel with. Deprecated now
1820
- that the REST gateway supports base64 encoding of bytes fields.
1821
- */
1822
- string node_pubkey_string = 3 [deprecated = true];
1823
-
1824
- /// The number of satoshis the wallet should commit to the channel
1825
- int64 local_funding_amount = 4;
1826
-
1827
- /// The number of satoshis to push to the remote side as part of the initial
1828
- /// commitment state
1829
- int64 push_sat = 5;
1830
-
1831
- /// The target number of blocks that the funding transaction should be
1832
- /// confirmed by.
1833
- int32 target_conf = 6;
1834
-
1835
- /// A manual fee rate set in sat/byte that should be used when crafting the
1836
- /// funding transaction.
1837
- int64 sat_per_byte = 7;
1838
-
1839
- /// Whether this channel should be private, not announced to the greater
1840
- /// network.
1841
- bool private = 8;
1842
-
1843
- /// The minimum value in millisatoshi we will require for incoming HTLCs on
1844
- /// the channel.
1845
- int64 min_htlc_msat = 9;
1846
-
1847
- /// The delay we require on the remote's commitment transaction. If this is
1848
- /// not set, it will be scaled automatically with the channel size.
1849
- uint32 remote_csv_delay = 10;
1850
-
1851
- /// The minimum number of confirmations each one of your outputs used for
1852
- /// the funding transaction must satisfy.
1853
- int32 min_confs = 11;
1854
-
1855
- /// Whether unconfirmed outputs should be used as inputs for the funding
1856
- /// transaction.
1857
- bool spend_unconfirmed = 12;
1858
-
1859
- /*
1860
- Close address is an optional address which specifies the address to which
1861
- funds should be paid out to upon cooperative close. This field may only be
1862
- set if the peer supports the option upfront feature bit (call listpeers
1863
- to check). The remote peer will only accept cooperative closes to this
1864
- address if it is set.
1865
-
1866
- Note: If this value is set on channel creation, you will *not* be able to
1867
- cooperatively close out to a different address.
1868
- */
1869
- string close_address = 13;
1870
-
1871
- /**
1872
- Funding shims are an optional argument that allow the caller to intercept
1873
- certain funding functionality. For example, a shim can be provided to use a
1874
- particular key for the commitment key (ideally cold) rather than use one
1875
- that is generated by the wallet as normal, or signal that signing will be
1876
- carried out in an interactive manner (PSBT based).
1877
- */
1878
- FundingShim funding_shim = 14;
1879
- }
1880
- message OpenStatusUpdate {
1881
- oneof update {
1882
- /**
1883
- Signals that the channel is now fully negotiated and the funding
1884
- transaction published.
1885
- */
1886
- PendingUpdate chan_pending = 1;
1887
-
1888
- /**
1889
- Signals that the channel's funding transaction has now reached the
1890
- required number of confirmations on chain and can be used.
1891
- */
1892
- ChannelOpenUpdate chan_open = 3;
1893
-
1894
- /**
1895
- Signals that the funding process has been suspended and the construction
1896
- of a PSBT that funds the channel PK script is now required.
1897
- */
1898
- ReadyForPsbtFunding psbt_fund = 5;
1899
- }
1900
-
1901
- /**
1902
- The pending channel ID of the created channel. This value may be used to
1903
- further the funding flow manually via the FundingStateStep method.
1904
- */
1905
- bytes pending_chan_id = 4;
1906
- }
1907
-
1908
- message KeyLocator {
1909
- /// The family of key being identified.
1910
- int32 key_family = 1;
1911
-
1912
- /// The precise index of the key being identified.
1913
- int32 key_index = 2;
1914
- }
1915
-
1916
- message KeyDescriptor {
1917
- /**
1918
- The raw bytes of the key being identified.
1919
- */
1920
- bytes raw_key_bytes = 1;
1921
-
1922
- /**
1923
- The key locator that identifies which key to use for signing.
1924
- */
1925
- KeyLocator key_loc = 2;
1926
- }
1927
-
1928
- message ChanPointShim {
1929
- /**
1930
- The size of the pre-crafted output to be used as the channel point for this
1931
- channel funding.
1932
- */
1933
- int64 amt = 1;
1934
-
1935
- /// The target channel point to refrence in created commitment transactions.
1936
- ChannelPoint chan_point = 2;
1937
-
1938
- /// Our local key to use when creating the multi-sig output.
1939
- KeyDescriptor local_key = 3;
1940
-
1941
- /// The key of the remote party to use when creating the multi-sig output.
1942
- bytes remote_key = 4;
1943
-
1944
- /**
1945
- If non-zero, then this will be used as the pending channel ID on the wire
1946
- protocol to initate the funding request. This is an optional field, and
1947
- should only be set if the responder is already expecting a specific pending
1948
- channel ID.
1949
- */
1950
- bytes pending_chan_id = 5;
1951
-
1952
- /**
1953
- This uint32 indicates if this channel is to be considered 'frozen'. A
1954
- frozen channel does not allow a cooperative channel close by the
1955
- initiator. The thaw_height is the height that this restriction stops
1956
- applying to the channel.
1957
- */
1958
- uint32 thaw_height = 6;
1959
- }
1960
-
1961
- message PsbtShim {
1962
- /**
1963
- A unique identifier of 32 random bytes that will be used as the pending
1964
- channel ID to identify the PSBT state machine when interacting with it and
1965
- on the wire protocol to initiate the funding request.
1966
- */
1967
- bytes pending_chan_id = 1;
1968
-
1969
- /**
1970
- An optional base PSBT the new channel output will be added to. If this is
1971
- non-empty, it must be a binary serialized PSBT.
1972
- */
1973
- bytes base_psbt = 2;
1974
- }
1975
-
1976
- message FundingShim {
1977
- oneof shim {
1978
- /**
1979
- A channel shim where the channel point was fully constructed outside
1980
- of lnd's wallet and the transaction might already be published.
1981
- */
1982
- ChanPointShim chan_point_shim = 1;
1983
-
1984
- /**
1985
- A channel shim that uses a PSBT to fund and sign the channel funding
1986
- transaction.
1987
- */
1988
- PsbtShim psbt_shim = 2;
1989
- }
1990
- }
1991
-
1992
- message FundingShimCancel {
1993
- /// The pending channel ID of the channel to cancel the funding shim for.
1994
- bytes pending_chan_id = 1;
1995
- }
1996
-
1997
- message FundingPsbtVerify {
1998
- /**
1999
- The funded but not yet signed PSBT that sends the exact channel capacity
2000
- amount to the PK script returned in the open channel message in a previous
2001
- step.
2002
- */
2003
- bytes funded_psbt = 1;
2004
-
2005
- /// The pending channel ID of the channel to get the PSBT for.
2006
- bytes pending_chan_id = 2;
2007
- }
2008
-
2009
- message FundingPsbtFinalize {
2010
- /**
2011
- The funded PSBT that contains all witness data to send the exact channel
2012
- capacity amount to the PK script returned in the open channel message in a
2013
- previous step.
2014
- */
2015
- bytes signed_psbt = 1;
2016
-
2017
- /// The pending channel ID of the channel to get the PSBT for.
2018
- bytes pending_chan_id = 2;
2019
- }
2020
-
2021
- message FundingTransitionMsg {
2022
- oneof trigger {
2023
- /**
2024
- The funding shim to register. This should be used before any
2025
- channel funding has began by the remote party, as it is intended as a
2026
- preparatory step for the full channel funding.
2027
- */
2028
- FundingShim shim_register = 1;
2029
-
2030
- /// Used to cancel an existing registered funding shim.
2031
- FundingShimCancel shim_cancel = 2;
2032
-
2033
- /**
2034
- Used to continue a funding flow that was initiated to be executed
2035
- through a PSBT. This step verifies that the PSBT contains the correct
2036
- outputs to fund the channel.
2037
- */
2038
- FundingPsbtVerify psbt_verify = 3;
2039
-
2040
- /**
2041
- Used to continue a funding flow that was initiated to be executed
2042
- through a PSBT. This step finalizes the funded and signed PSBT, finishes
2043
- negotiation with the peer and finally publishes the resulting funding
2044
- transaction.
2045
- */
2046
- FundingPsbtFinalize psbt_finalize = 4;
2047
- }
2048
- }
2049
-
2050
- message FundingStateStepResp {
2051
- }
2052
-
2053
- message PendingHTLC {
2054
- /// The direction within the channel that the htlc was sent
2055
- bool incoming = 1;
2056
-
2057
- /// The total value of the htlc
2058
- int64 amount = 2;
2059
-
2060
- /// The final output to be swept back to the user's wallet
2061
- string outpoint = 3;
2062
-
2063
- /// The next block height at which we can spend the current stage
2064
- uint32 maturity_height = 4;
2065
-
2066
- /**
2067
- The number of blocks remaining until the current stage can be swept.
2068
- Negative values indicate how many blocks have passed since becoming
2069
- mature.
2070
- */
2071
- int32 blocks_til_maturity = 5;
2072
-
2073
- /// Indicates whether the htlc is in its first or second stage of recovery
2074
- uint32 stage = 6;
2075
- }
2076
-
2077
- message PendingChannelsRequest {
2078
- }
2079
- message PendingChannelsResponse {
2080
- message PendingChannel {
2081
- string remote_node_pub = 1;
2082
- string channel_point = 2;
2083
-
2084
- int64 capacity = 3;
2085
-
2086
- int64 local_balance = 4;
2087
- int64 remote_balance = 5;
2088
-
2089
- /// The minimum satoshis this node is required to reserve in its
2090
- /// balance.
2091
- int64 local_chan_reserve_sat = 6;
2092
-
2093
- /**
2094
- The minimum satoshis the other node is required to reserve in its
2095
- balance.
2096
- */
2097
- int64 remote_chan_reserve_sat = 7;
2098
-
2099
- // The party that initiated opening the channel.
2100
- Initiator initiator = 8;
2101
-
2102
- /// The commitment type used by this channel.
2103
- CommitmentType commitment_type = 9;
2104
- }
2105
-
2106
- message PendingOpenChannel {
2107
- /// The pending channel
2108
- PendingChannel channel = 1;
2109
-
2110
- /// The height at which this channel will be confirmed
2111
- uint32 confirmation_height = 2;
2112
-
2113
- /**
2114
- The amount calculated to be paid in fees for the current set of
2115
- commitment transactions. The fee amount is persisted with the channel
2116
- in order to allow the fee amount to be removed and recalculated with
2117
- each channel state update, including updates that happen after a system
2118
- restart.
2119
- */
2120
- int64 commit_fee = 4;
2121
-
2122
- /// The weight of the commitment transaction
2123
- int64 commit_weight = 5;
2124
-
2125
- /**
2126
- The required number of satoshis per kilo-weight that the requester will
2127
- pay at all times, for both the funding transaction and commitment
2128
- transaction. This value can later be updated once the channel is open.
2129
- */
2130
- int64 fee_per_kw = 6;
2131
- }
2132
-
2133
- message WaitingCloseChannel {
2134
- /// The pending channel waiting for closing tx to confirm
2135
- PendingChannel channel = 1;
2136
-
2137
- /// The balance in satoshis encumbered in this channel
2138
- int64 limbo_balance = 2;
2139
-
2140
- /**
2141
- A list of valid commitment transactions. Any of these can confirm at
2142
- this point.
2143
- */
2144
- Commitments commitments = 3;
2145
- }
2146
-
2147
- message Commitments {
2148
- /// Hash of the local version of the commitment tx.
2149
- string local_txid = 1;
2150
-
2151
- /// Hash of the remote version of the commitment tx.
2152
- string remote_txid = 2;
2153
-
2154
- /// Hash of the remote pending version of the commitment tx.
2155
- string remote_pending_txid = 3;
2156
-
2157
- /*
2158
- The amount in satoshis calculated to be paid in fees for the local
2159
- commitment.
2160
- */
2161
- uint64 local_commit_fee_sat = 4;
2162
-
2163
- /*
2164
- The amount in satoshis calculated to be paid in fees for the remote
2165
- commitment.
2166
- */
2167
- uint64 remote_commit_fee_sat = 5;
2168
-
2169
- /*
2170
- The amount in satoshis calculated to be paid in fees for the remote
2171
- pending commitment.
2172
- */
2173
- uint64 remote_pending_commit_fee_sat = 6;
2174
- }
2175
-
2176
- message ClosedChannel {
2177
- /// The pending channel to be closed
2178
- PendingChannel channel = 1;
2179
-
2180
- /// The transaction id of the closing transaction
2181
- string closing_txid = 2;
2182
- }
2183
-
2184
- message ForceClosedChannel {
2185
- /// The pending channel to be force closed
2186
- PendingChannel channel = 1;
2187
-
2188
- /// The transaction id of the closing transaction
2189
- string closing_txid = 2;
2190
-
2191
- /// The balance in satoshis encumbered in this pending channel
2192
- int64 limbo_balance = 3;
2193
-
2194
- /// The height at which funds can be swept into the wallet
2195
- uint32 maturity_height = 4;
2196
-
2197
- /*
2198
- Remaining # of blocks until the commitment output can be swept.
2199
- Negative values indicate how many blocks have passed since becoming
2200
- mature.
2201
- */
2202
- int32 blocks_til_maturity = 5;
2203
-
2204
- /// The total value of funds successfully recovered from this channel
2205
- int64 recovered_balance = 6;
2206
-
2207
- repeated PendingHTLC pending_htlcs = 8;
2208
-
2209
- enum AnchorState {
2210
- LIMBO = 0;
2211
- RECOVERED = 1;
2212
- LOST = 2;
2213
- }
2214
-
2215
- AnchorState anchor = 9;
2216
- }
2217
-
2218
- /// The balance in satoshis encumbered in pending channels
2219
- int64 total_limbo_balance = 1;
2220
-
2221
- /// Channels pending opening
2222
- repeated PendingOpenChannel pending_open_channels = 2;
2223
-
2224
- /*
2225
- Deprecated: Channels pending closing previously contained cooperatively
2226
- closed channels with a single confirmation. These channels are now
2227
- considered closed from the time we see them on chain.
2228
- */
2229
- repeated ClosedChannel pending_closing_channels = 3 [deprecated = true];
2230
-
2231
- /// Channels pending force closing
2232
- repeated ForceClosedChannel pending_force_closing_channels = 4;
2233
-
2234
- /// Channels waiting for closing tx to confirm
2235
- repeated WaitingCloseChannel waiting_close_channels = 5;
2236
- }
2237
-
2238
- message ChannelEventSubscription {
2239
- }
2240
-
2241
- message ChannelEventUpdate {
2242
- oneof channel {
2243
- Channel open_channel = 1;
2244
- ChannelCloseSummary closed_channel = 2;
2245
- ChannelPoint active_channel = 3;
2246
- ChannelPoint inactive_channel = 4;
2247
- PendingUpdate pending_open_channel = 6;
2248
- }
2249
-
2250
- enum UpdateType {
2251
- OPEN_CHANNEL = 0;
2252
- CLOSED_CHANNEL = 1;
2253
- ACTIVE_CHANNEL = 2;
2254
- INACTIVE_CHANNEL = 3;
2255
- PENDING_OPEN_CHANNEL = 4;
2256
- }
2257
-
2258
- UpdateType type = 5;
2259
- }
2260
-
2261
- message WalletBalanceRequest {
2262
- }
2263
- message WalletBalanceResponse {
2264
- /// The balance of the wallet
2265
- int64 total_balance = 1;
2266
-
2267
- /// The confirmed balance of a wallet(with >= 1 confirmations)
2268
- int64 confirmed_balance = 2;
2269
-
2270
- /// The unconfirmed balance of a wallet(with 0 confirmations)
2271
- int64 unconfirmed_balance = 3;
2272
- }
2273
-
2274
- message ChannelBalanceRequest {
2275
- }
2276
- message ChannelBalanceResponse {
2277
- /// Sum of channels balances denominated in satoshis
2278
- int64 balance = 1;
2279
-
2280
- /// Sum of channels pending balances denominated in satoshis
2281
- int64 pending_open_balance = 2;
2282
- }
2283
-
2284
- message QueryRoutesRequest {
2285
- /// The 33-byte hex-encoded public key for the payment destination
2286
- string pub_key = 1;
2287
-
2288
- /**
2289
- The amount to send expressed in satoshis.
2290
-
2291
- The fields amt and amt_msat are mutually exclusive.
2292
- */
2293
- int64 amt = 2;
2294
-
2295
- /**
2296
- The amount to send expressed in millisatoshis.
2297
-
2298
- The fields amt and amt_msat are mutually exclusive.
2299
- */
2300
- int64 amt_msat = 12;
2301
-
2302
- reserved 3;
2303
-
2304
- /**
2305
- An optional CLTV delta from the current height that should be used for the
2306
- timelock of the final hop. Note that unlike SendPayment, QueryRoutes does
2307
- not add any additional block padding on top of final_ctlv_delta. This
2308
- padding of a few blocks needs to be added manually or otherwise failures may
2309
- happen when a block comes in while the payment is in flight.
2310
- */
2311
- int32 final_cltv_delta = 4;
2312
-
2313
- /**
2314
- The maximum number of satoshis that will be paid as a fee of the payment.
2315
- This value can be represented either as a percentage of the amount being
2316
- sent, or as a fixed amount of the maximum fee the user is willing the pay to
2317
- send the payment.
2318
- */
2319
- FeeLimit fee_limit = 5;
2320
-
2321
- /**
2322
- A list of nodes to ignore during path finding. When using REST, these fields
2323
- must be encoded as base64.
2324
- */
2325
- repeated bytes ignored_nodes = 6;
2326
-
2327
- /**
2328
- Deprecated. A list of edges to ignore during path finding.
2329
- */
2330
- repeated EdgeLocator ignored_edges = 7 [deprecated = true];
2331
-
2332
- /**
2333
- The source node where the request route should originated from. If empty,
2334
- self is assumed.
2335
- */
2336
- string source_pub_key = 8;
2337
-
2338
- /**
2339
- If set to true, edge probabilities from mission control will be used to get
2340
- the optimal route.
2341
- */
2342
- bool use_mission_control = 9;
2343
-
2344
- /**
2345
- A list of directed node pairs that will be ignored during path finding.
2346
- */
2347
- repeated NodePair ignored_pairs = 10;
2348
-
2349
- /**
2350
- An optional maximum total time lock for the route. If the source is empty or
2351
- ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If
2352
- zero, then the value of `--max-cltv-expiry` is used as the limit.
2353
- */
2354
- uint32 cltv_limit = 11;
2355
-
2356
- /**
2357
- An optional field that can be used to pass an arbitrary set of TLV records
2358
- to a peer which understands the new records. This can be used to pass
2359
- application specific data during the payment attempt. If the destination
2360
- does not support the specified recrods, and error will be returned.
2361
- Record types are required to be in the custom range >= 65536. When using
2362
- REST, the values must be encoded as base64.
2363
- */
2364
- map<uint64, bytes> dest_custom_records = 13;
2365
-
2366
- /**
2367
- The channel id of the channel that must be taken to the first hop. If zero,
2368
- any channel may be used.
2369
- */
2370
- uint64 outgoing_chan_id = 14 [jstype = JS_STRING];
2371
-
2372
- /**
2373
- The pubkey of the last hop of the route. If empty, any hop may be used.
2374
- */
2375
- bytes last_hop_pubkey = 15;
2376
-
2377
- /**
2378
- Optional route hints to reach the destination through private channels.
2379
- */
2380
- repeated lnrpc.RouteHint route_hints = 16;
2381
-
2382
- /**
2383
- Features assumed to be supported by the final node. All transitive feature
2384
- dependencies must also be set properly. For a given feature bit pair, either
2385
- optional or remote may be set, but not both. If this field is nil or empty,
2386
- the router will try to load destination features from the graph as a
2387
- fallback.
2388
- */
2389
- repeated lnrpc.FeatureBit dest_features = 17;
2390
- }
2391
-
2392
- message NodePair {
2393
- /**
2394
- The sending node of the pair. When using REST, this field must be encoded as
2395
- base64.
2396
- */
2397
- bytes from = 1;
2398
-
2399
- /**
2400
- The receiving node of the pair. When using REST, this field must be encoded
2401
- as base64.
2402
- */
2403
- bytes to = 2;
2404
- }
2405
-
2406
- message EdgeLocator {
2407
- /// The short channel id of this edge.
2408
- uint64 channel_id = 1 [jstype = JS_STRING];
2409
-
2410
- /**
2411
- The direction of this edge. If direction_reverse is false, the direction
2412
- of this edge is from the channel endpoint with the lexicographically smaller
2413
- pub key to the endpoint with the larger pub key. If direction_reverse is
2414
- is true, the edge goes the other way.
2415
- */
2416
- bool direction_reverse = 2;
2417
- }
2418
-
2419
- message QueryRoutesResponse {
2420
- /**
2421
- The route that results from the path finding operation. This is still a
2422
- repeated field to retain backwards compatibility.
2423
- */
2424
- repeated Route routes = 1;
2425
-
2426
- /**
2427
- The success probability of the returned route based on the current mission
2428
- control state. [EXPERIMENTAL]
2429
- */
2430
- double success_prob = 2;
2431
- }
2432
-
2433
- message Hop {
2434
- /**
2435
- The unique channel ID for the channel. The first 3 bytes are the block
2436
- height, the next 3 the index within the block, and the last 2 bytes are the
2437
- output index for the channel.
2438
- */
2439
- uint64 chan_id = 1 [jstype = JS_STRING];
2440
- int64 chan_capacity = 2;
2441
- int64 amt_to_forward = 3 [deprecated = true];
2442
- int64 fee = 4 [deprecated = true];
2443
- uint32 expiry = 5;
2444
- int64 amt_to_forward_msat = 6;
2445
- int64 fee_msat = 7;
2446
-
2447
- /**
2448
- An optional public key of the hop. If the public key is given, the payment
2449
- can be executed without relying on a copy of the channel graph.
2450
- */
2451
- string pub_key = 8;
2452
-
2453
- /**
2454
- If set to true, then this hop will be encoded using the new variable length
2455
- TLV format. Note that if any custom tlv_records below are specified, then
2456
- this field MUST be set to true for them to be encoded properly.
2457
- */
2458
- bool tlv_payload = 9;
2459
-
2460
- /**
2461
- An optional TLV record that signals the use of an MPP payment. If present,
2462
- the receiver will enforce that that the same mpp_record is included in the
2463
- final hop payload of all non-zero payments in the HTLC set. If empty, a
2464
- regular single-shot payment is or was attempted.
2465
- */
2466
- MPPRecord mpp_record = 10;
2467
-
2468
- /**
2469
- An optional set of key-value TLV records. This is useful within the context
2470
- of the SendToRoute call as it allows callers to specify arbitrary K-V pairs
2471
- to drop off at each hop within the onion.
2472
- */
2473
- map<uint64, bytes> custom_records = 11;
2474
- }
2475
-
2476
- message MPPRecord {
2477
- /**
2478
- A unique, random identifier used to authenticate the sender as the intended
2479
- payer of a multi-path payment. The payment_addr must be the same for all
2480
- subpayments, and match the payment_addr provided in the receiver's invoice.
2481
- The same payment_addr must be used on all subpayments.
2482
- */
2483
- bytes payment_addr = 11;
2484
-
2485
- /**
2486
- The total amount in milli-satoshis being sent as part of a larger multi-path
2487
- payment. The caller is responsible for ensuring subpayments to the same node
2488
- and payment_hash sum exactly to total_amt_msat. The same
2489
- total_amt_msat must be used on all subpayments.
2490
- */
2491
- int64 total_amt_msat = 10;
2492
- }
2493
-
2494
- /**
2495
- A path through the channel graph which runs over one or more channels in
2496
- succession. This struct carries all the information required to craft the
2497
- Sphinx onion packet, and send the payment along the first hop in the path. A
2498
- route is only selected as valid if all the channels have sufficient capacity to
2499
- carry the initial payment amount after fees are accounted for.
2500
- */
2501
- message Route {
2502
- /**
2503
- The cumulative (final) time lock across the entire route. This is the CLTV
2504
- value that should be extended to the first hop in the route. All other hops
2505
- will decrement the time-lock as advertised, leaving enough time for all
2506
- hops to wait for or present the payment preimage to complete the payment.
2507
- */
2508
- uint32 total_time_lock = 1;
2509
-
2510
- /**
2511
- The sum of the fees paid at each hop within the final route. In the case
2512
- of a one-hop payment, this value will be zero as we don't need to pay a fee
2513
- to ourselves.
2514
- */
2515
- int64 total_fees = 2 [deprecated = true];
2516
-
2517
- /**
2518
- The total amount of funds required to complete a payment over this route.
2519
- This value includes the cumulative fees at each hop. As a result, the HTLC
2520
- extended to the first-hop in the route will need to have at least this many
2521
- satoshis, otherwise the route will fail at an intermediate node due to an
2522
- insufficient amount of fees.
2523
- */
2524
- int64 total_amt = 3 [deprecated = true];
2525
-
2526
- /**
2527
- Contains details concerning the specific forwarding details at each hop.
2528
- */
2529
- repeated Hop hops = 4;
2530
-
2531
- /**
2532
- The total fees in millisatoshis.
2533
- */
2534
- int64 total_fees_msat = 5;
2535
-
2536
- /**
2537
- The total amount in millisatoshis.
2538
- */
2539
- int64 total_amt_msat = 6;
2540
- }
2541
-
2542
- message NodeInfoRequest {
2543
- /// The 33-byte hex-encoded compressed public of the target node
2544
- string pub_key = 1;
2545
-
2546
- /// If true, will include all known channels associated with the node.
2547
- bool include_channels = 2;
2548
- }
2549
-
2550
- message NodeInfo {
2551
- /**
2552
- An individual vertex/node within the channel graph. A node is
2553
- connected to other nodes by one or more channel edges emanating from it. As
2554
- the graph is directed, a node will also have an incoming edge attached to
2555
- it for each outgoing edge.
2556
- */
2557
- LightningNode node = 1;
2558
-
2559
- /// The total number of channels for the node.
2560
- uint32 num_channels = 2;
2561
-
2562
- /// The sum of all channels capacity for the node, denominated in satoshis.
2563
- int64 total_capacity = 3;
2564
-
2565
- /// A list of all public channels for the node.
2566
- repeated ChannelEdge channels = 4;
2567
- }
2568
-
2569
- /**
2570
- An individual vertex/node within the channel graph. A node is
2571
- connected to other nodes by one or more channel edges emanating from it. As the
2572
- graph is directed, a node will also have an incoming edge attached to it for
2573
- each outgoing edge.
2574
- */
2575
- message LightningNode {
2576
- uint32 last_update = 1;
2577
- string pub_key = 2;
2578
- string alias = 3;
2579
- repeated NodeAddress addresses = 4;
2580
- string color = 5;
2581
- map<uint32, Feature> features = 6;
2582
- }
2583
-
2584
- message NodeAddress {
2585
- string network = 1;
2586
- string addr = 2;
2587
- }
2588
-
2589
- message RoutingPolicy {
2590
- uint32 time_lock_delta = 1;
2591
- int64 min_htlc = 2;
2592
- int64 fee_base_msat = 3;
2593
- int64 fee_rate_milli_msat = 4;
2594
- bool disabled = 5;
2595
- uint64 max_htlc_msat = 6;
2596
- uint32 last_update = 7;
2597
- }
2598
-
2599
- /**
2600
- A fully authenticated channel along with all its unique attributes.
2601
- Once an authenticated channel announcement has been processed on the network,
2602
- then an instance of ChannelEdgeInfo encapsulating the channels attributes is
2603
- stored. The other portions relevant to routing policy of a channel are stored
2604
- within a ChannelEdgePolicy for each direction of the channel.
2605
- */
2606
- message ChannelEdge {
2607
- /**
2608
- The unique channel ID for the channel. The first 3 bytes are the block
2609
- height, the next 3 the index within the block, and the last 2 bytes are the
2610
- output index for the channel.
2611
- */
2612
- uint64 channel_id = 1 [jstype = JS_STRING];
2613
- string chan_point = 2;
2614
-
2615
- uint32 last_update = 3 [deprecated = true];
2616
-
2617
- string node1_pub = 4;
2618
- string node2_pub = 5;
2619
-
2620
- int64 capacity = 6;
2621
-
2622
- RoutingPolicy node1_policy = 7;
2623
- RoutingPolicy node2_policy = 8;
2624
- }
2625
-
2626
- message ChannelGraphRequest {
2627
- /**
2628
- Whether unannounced channels are included in the response or not. If set,
2629
- unannounced channels are included. Unannounced channels are both private
2630
- channels, and public channels that are not yet announced to the network.
2631
- */
2632
- bool include_unannounced = 1;
2633
- }
2634
-
2635
- /// Returns a new instance of the directed channel graph.
2636
- message ChannelGraph {
2637
- /// The list of `LightningNode`s in this channel graph
2638
- repeated LightningNode nodes = 1;
2639
-
2640
- /// The list of `ChannelEdge`s in this channel graph
2641
- repeated ChannelEdge edges = 2;
2642
- }
2643
-
2644
- enum NodeMetricType {
2645
- UNKNOWN = 0;
2646
- BETWEENNESS_CENTRALITY = 1;
2647
- }
2648
-
2649
- message NodeMetricsRequest {
2650
- /// The requested node metrics.
2651
- repeated NodeMetricType types = 1;
2652
- }
2653
-
2654
- message NodeMetricsResponse {
2655
- /**
2656
- Betweenness centrality is the sum of the ratio of shortest paths that pass
2657
- through the node for each pair of nodes in the graph (not counting paths
2658
- starting or ending at this node).
2659
- Map of node pubkey to betweenness centrality of the node. Normalized
2660
- values are in the [0,1] closed interval.
2661
- */
2662
- map<string, FloatMetric> betweenness_centrality = 1;
2663
- }
2664
-
2665
- message FloatMetric {
2666
- /// Arbitrary float value.
2667
- double value = 1;
2668
-
2669
- /// The value normalized to [0,1] or [-1,1].
2670
- double normalized_value = 2;
2671
- }
2672
-
2673
- message ChanInfoRequest {
2674
- /**
2675
- The unique channel ID for the channel. The first 3 bytes are the block
2676
- height, the next 3 the index within the block, and the last 2 bytes are the
2677
- output index for the channel.
2678
- */
2679
- uint64 chan_id = 1 [jstype = JS_STRING];
2680
- }
2681
-
2682
- message NetworkInfoRequest {
2683
- }
2684
- message NetworkInfo {
2685
- uint32 graph_diameter = 1;
2686
- double avg_out_degree = 2;
2687
- uint32 max_out_degree = 3;
2688
-
2689
- uint32 num_nodes = 4;
2690
- uint32 num_channels = 5;
2691
-
2692
- int64 total_network_capacity = 6;
2693
-
2694
- double avg_channel_size = 7;
2695
- int64 min_channel_size = 8;
2696
- int64 max_channel_size = 9;
2697
- int64 median_channel_size_sat = 10;
2698
-
2699
- // The number of edges marked as zombies.
2700
- uint64 num_zombie_chans = 11;
2701
-
2702
- // TODO(roasbeef): fee rate info, expiry
2703
- // * also additional RPC for tracking fee info once in
2704
- }
2705
-
2706
- message StopRequest {
2707
- }
2708
- message StopResponse {
2709
- }
2710
-
2711
- message GraphTopologySubscription {
2712
- }
2713
- message GraphTopologyUpdate {
2714
- repeated NodeUpdate node_updates = 1;
2715
- repeated ChannelEdgeUpdate channel_updates = 2;
2716
- repeated ClosedChannelUpdate closed_chans = 3;
2717
- }
2718
- message NodeUpdate {
2719
- repeated string addresses = 1;
2720
- string identity_key = 2;
2721
- bytes global_features = 3;
2722
- string alias = 4;
2723
- string color = 5;
2724
- }
2725
- message ChannelEdgeUpdate {
2726
- /**
2727
- The unique channel ID for the channel. The first 3 bytes are the block
2728
- height, the next 3 the index within the block, and the last 2 bytes are the
2729
- output index for the channel.
2730
- */
2731
- uint64 chan_id = 1 [jstype = JS_STRING];
2732
-
2733
- ChannelPoint chan_point = 2;
2734
-
2735
- int64 capacity = 3;
2736
-
2737
- RoutingPolicy routing_policy = 4;
2738
-
2739
- string advertising_node = 5;
2740
- string connecting_node = 6;
2741
- }
2742
- message ClosedChannelUpdate {
2743
- /**
2744
- The unique channel ID for the channel. The first 3 bytes are the block
2745
- height, the next 3 the index within the block, and the last 2 bytes are the
2746
- output index for the channel.
2747
- */
2748
- uint64 chan_id = 1 [jstype = JS_STRING];
2749
- int64 capacity = 2;
2750
- uint32 closed_height = 3;
2751
- ChannelPoint chan_point = 4;
2752
- }
2753
-
2754
- message HopHint {
2755
- /// The public key of the node at the start of the channel.
2756
- string node_id = 1;
2757
-
2758
- /// The unique identifier of the channel.
2759
- uint64 chan_id = 2 [jstype = JS_STRING];
2760
-
2761
- /// The base fee of the channel denominated in millisatoshis.
2762
- uint32 fee_base_msat = 3;
2763
-
2764
- /**
2765
- The fee rate of the channel for sending one satoshi across it denominated in
2766
- millionths of a satoshi.
2767
- */
2768
- uint32 fee_proportional_millionths = 4;
2769
-
2770
- /// The time-lock delta of the channel.
2771
- uint32 cltv_expiry_delta = 5;
2772
- }
2773
-
2774
- message RouteHint {
2775
- /**
2776
- A list of hop hints that when chained together can assist in reaching a
2777
- specific destination.
2778
- */
2779
- repeated HopHint hop_hints = 1;
2780
- }
2781
-
2782
- message Invoice {
2783
- /**
2784
- An optional memo to attach along with the invoice. Used for record keeping
2785
- purposes for the invoice's creator, and will also be set in the description
2786
- field of the encoded payment request if the description_hash field is not
2787
- being used.
2788
- */
2789
- string memo = 1;
2790
-
2791
- reserved 2;
2792
-
2793
- /**
2794
- The hex-encoded preimage (32 byte) which will allow settling an incoming
2795
- HTLC payable to this preimage. When using REST, this field must be encoded
2796
- as base64.
2797
- */
2798
- bytes r_preimage = 3;
2799
-
2800
- /**
2801
- The hash of the preimage. When using REST, this field must be encoded as
2802
- base64.
2803
- */
2804
- bytes r_hash = 4;
2805
-
2806
- /**
2807
- The value of this invoice in satoshis
2808
-
2809
- The fields value and value_msat are mutually exclusive.
2810
- */
2811
- int64 value = 5;
2812
-
2813
- /**
2814
- The value of this invoice in millisatoshis
2815
-
2816
- The fields value and value_msat are mutually exclusive.
2817
- */
2818
- int64 value_msat = 23;
2819
-
2820
- /// Whether this invoice has been fulfilled
2821
- bool settled = 6 [deprecated = true];
2822
-
2823
- /// When this invoice was created
2824
- int64 creation_date = 7;
2825
-
2826
- /// When this invoice was settled
2827
- int64 settle_date = 8;
2828
-
2829
- /**
2830
- A bare-bones invoice for a payment within the Lightning Network. With the
2831
- details of the invoice, the sender has all the data necessary to send a
2832
- payment to the recipient.
2833
- */
2834
- string payment_request = 9;
2835
-
2836
- /**
2837
- Hash (SHA-256) of a description of the payment. Used if the description of
2838
- payment (memo) is too long to naturally fit within the description field
2839
- of an encoded payment request. When using REST, this field must be encoded
2840
- as base64.
2841
- */
2842
- bytes description_hash = 10;
2843
-
2844
- /// Payment request expiry time in seconds. Default is 3600 (1 hour).
2845
- int64 expiry = 11;
2846
-
2847
- /// Fallback on-chain address.
2848
- string fallback_addr = 12;
2849
-
2850
- /// Delta to use for the time-lock of the CLTV extended to the final hop.
2851
- uint64 cltv_expiry = 13;
2852
-
2853
- /**
2854
- Route hints that can each be individually used to assist in reaching the
2855
- invoice's destination.
2856
- */
2857
- repeated RouteHint route_hints = 14;
2858
-
2859
- /// Whether this invoice should include routing hints for private channels.
2860
- bool private = 15;
2861
-
2862
- /**
2863
- The "add" index of this invoice. Each newly created invoice will increment
2864
- this index making it monotonically increasing. Callers to the
2865
- SubscribeInvoices call can use this to instantly get notified of all added
2866
- invoices with an add_index greater than this one.
2867
- */
2868
- uint64 add_index = 16;
2869
-
2870
- /**
2871
- The "settle" index of this invoice. Each newly settled invoice will
2872
- increment this index making it monotonically increasing. Callers to the
2873
- SubscribeInvoices call can use this to instantly get notified of all
2874
- settled invoices with an settle_index greater than this one.
2875
- */
2876
- uint64 settle_index = 17;
2877
-
2878
- /// Deprecated, use amt_paid_sat or amt_paid_msat.
2879
- int64 amt_paid = 18 [deprecated = true];
2880
-
2881
- /**
2882
- The amount that was accepted for this invoice, in satoshis. This will ONLY
2883
- be set if this invoice has been settled. We provide this field as if the
2884
- invoice was created with a zero value, then we need to record what amount
2885
- was ultimately accepted. Additionally, it's possible that the sender paid
2886
- MORE that was specified in the original invoice. So we'll record that here
2887
- as well.
2888
- */
2889
- int64 amt_paid_sat = 19;
2890
-
2891
- /**
2892
- The amount that was accepted for this invoice, in millisatoshis. This will
2893
- ONLY be set if this invoice has been settled. We provide this field as if
2894
- the invoice was created with a zero value, then we need to record what
2895
- amount was ultimately accepted. Additionally, it's possible that the sender
2896
- paid MORE that was specified in the original invoice. So we'll record that
2897
- here as well.
2898
- */
2899
- int64 amt_paid_msat = 20;
2900
-
2901
- enum InvoiceState {
2902
- OPEN = 0;
2903
- SETTLED = 1;
2904
- CANCELED = 2;
2905
- ACCEPTED = 3;
2906
- }
2907
-
2908
- /**
2909
- The state the invoice is in.
2910
- */
2911
- InvoiceState state = 21;
2912
-
2913
- /// List of HTLCs paying to this invoice [EXPERIMENTAL].
2914
- repeated InvoiceHTLC htlcs = 22;
2915
-
2916
- /// List of features advertised on the invoice.
2917
- map<uint32, Feature> features = 24;
2918
-
2919
- /**
2920
- Indicates if this invoice was a spontaneous payment that arrived via keysend
2921
- [EXPERIMENTAL].
2922
- */
2923
- bool is_keysend = 25;
2924
- }
2925
-
2926
- enum InvoiceHTLCState {
2927
- ACCEPTED = 0;
2928
- SETTLED = 1;
2929
- CANCELED = 2;
2930
- }
2931
-
2932
- /// Details of an HTLC that paid to an invoice
2933
- message InvoiceHTLC {
2934
- /// Short channel id over which the htlc was received.
2935
- uint64 chan_id = 1 [jstype = JS_STRING];
2936
-
2937
- /// Index identifying the htlc on the channel.
2938
- uint64 htlc_index = 2;
2939
-
2940
- /// The amount of the htlc in msat.
2941
- uint64 amt_msat = 3;
2942
-
2943
- /// Block height at which this htlc was accepted.
2944
- int32 accept_height = 4;
2945
-
2946
- /// Time at which this htlc was accepted.
2947
- int64 accept_time = 5;
2948
-
2949
- /// Time at which this htlc was settled or canceled.
2950
- int64 resolve_time = 6;
2951
-
2952
- /// Block height at which this htlc expires.
2953
- int32 expiry_height = 7;
2954
-
2955
- /// Current state the htlc is in.
2956
- InvoiceHTLCState state = 8;
2957
-
2958
- /// Custom tlv records.
2959
- map<uint64, bytes> custom_records = 9;
2960
-
2961
- /// The total amount of the mpp payment in msat.
2962
- uint64 mpp_total_amt_msat = 10;
2963
- }
2964
-
2965
- message AddInvoiceResponse {
2966
- bytes r_hash = 1;
2967
-
2968
- /**
2969
- A bare-bones invoice for a payment within the Lightning Network. With the
2970
- details of the invoice, the sender has all the data necessary to send a
2971
- payment to the recipient.
2972
- */
2973
- string payment_request = 2;
2974
-
2975
- /**
2976
- The "add" index of this invoice. Each newly created invoice will increment
2977
- this index making it monotonically increasing. Callers to the
2978
- SubscribeInvoices call can use this to instantly get notified of all added
2979
- invoices with an add_index greater than this one.
2980
- */
2981
- uint64 add_index = 16;
2982
- }
2983
- message PaymentHash {
2984
- /**
2985
- The hex-encoded payment hash of the invoice to be looked up. The passed
2986
- payment hash must be exactly 32 bytes, otherwise an error is returned.
2987
- Deprecated now that the REST gateway supports base64 encoding of bytes
2988
- fields.
2989
- */
2990
- string r_hash_str = 1 [deprecated = true];
2991
-
2992
- /**
2993
- The payment hash of the invoice to be looked up. When using REST, this field
2994
- must be encoded as base64.
2995
- */
2996
- bytes r_hash = 2;
2997
- }
2998
-
2999
- message ListInvoiceRequest {
3000
- /**
3001
- If set, only invoices that are not settled and not canceled will be returned
3002
- in the response.
3003
- */
3004
- bool pending_only = 1;
3005
-
3006
- /**
3007
- The index of an invoice that will be used as either the start or end of a
3008
- query to determine which invoices should be returned in the response.
3009
- */
3010
- uint64 index_offset = 4;
3011
-
3012
- /// The max number of invoices to return in the response to this query.
3013
- uint64 num_max_invoices = 5;
3014
-
3015
- /**
3016
- If set, the invoices returned will result from seeking backwards from the
3017
- specified index offset. This can be used to paginate backwards.
3018
- */
3019
- bool reversed = 6;
3020
- }
3021
- message ListInvoiceResponse {
3022
- /**
3023
- A list of invoices from the time slice of the time series specified in the
3024
- request.
3025
- */
3026
- repeated Invoice invoices = 1;
3027
-
3028
- /**
3029
- The index of the last item in the set of returned invoices. This can be used
3030
- to seek further, pagination style.
3031
- */
3032
- uint64 last_index_offset = 2;
3033
-
3034
- /**
3035
- The index of the last item in the set of returned invoices. This can be used
3036
- to seek backwards, pagination style.
3037
- */
3038
- uint64 first_index_offset = 3;
3039
- }
3040
-
3041
- message InvoiceSubscription {
3042
- /**
3043
- If specified (non-zero), then we'll first start by sending out
3044
- notifications for all added indexes with an add_index greater than this
3045
- value. This allows callers to catch up on any events they missed while they
3046
- weren't connected to the streaming RPC.
3047
- */
3048
- uint64 add_index = 1;
3049
-
3050
- /**
3051
- If specified (non-zero), then we'll first start by sending out
3052
- notifications for all settled indexes with an settle_index greater than
3053
- this value. This allows callers to catch up on any events they missed while
3054
- they weren't connected to the streaming RPC.
3055
- */
3056
- uint64 settle_index = 2;
3057
- }
3058
-
3059
- enum PaymentFailureReason {
3060
- /**
3061
- Payment isn't failed (yet).
3062
- */
3063
- FAILURE_REASON_NONE = 0;
3064
-
3065
- /**
3066
- There are more routes to try, but the payment timeout was exceeded.
3067
- */
3068
- FAILURE_REASON_TIMEOUT = 1;
3069
-
3070
- /**
3071
- All possible routes were tried and failed permanently. Or were no
3072
- routes to the destination at all.
3073
- */
3074
- FAILURE_REASON_NO_ROUTE = 2;
3075
-
3076
- /**
3077
- A non-recoverable error has occured.
3078
- */
3079
- FAILURE_REASON_ERROR = 3;
3080
-
3081
- /**
3082
- Payment details incorrect (unknown hash, invalid amt or
3083
- invalid final cltv delta)
3084
- */
3085
- FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4;
3086
-
3087
- /**
3088
- Insufficient local balance.
3089
- */
3090
- FAILURE_REASON_INSUFFICIENT_BALANCE = 5;
3091
- }
3092
-
3093
- message Payment {
3094
- /// The payment hash
3095
- string payment_hash = 1;
3096
-
3097
- /// Deprecated, use value_sat or value_msat.
3098
- int64 value = 2 [deprecated = true];
3099
-
3100
- /// Deprecated, use creation_time_ns
3101
- int64 creation_date = 3 [deprecated = true];
3102
-
3103
- reserved 4;
3104
-
3105
- /// Deprecated, use fee_sat or fee_msat.
3106
- int64 fee = 5 [deprecated = true];
3107
-
3108
- /// The payment preimage
3109
- string payment_preimage = 6;
3110
-
3111
- /// The value of the payment in satoshis
3112
- int64 value_sat = 7;
3113
-
3114
- /// The value of the payment in milli-satoshis
3115
- int64 value_msat = 8;
3116
-
3117
- /// The optional payment request being fulfilled.
3118
- string payment_request = 9;
3119
-
3120
- enum PaymentStatus {
3121
- UNKNOWN = 0;
3122
- IN_FLIGHT = 1;
3123
- SUCCEEDED = 2;
3124
- FAILED = 3;
3125
- }
3126
-
3127
- // The status of the payment.
3128
- PaymentStatus status = 10;
3129
-
3130
- /// The fee paid for this payment in satoshis
3131
- int64 fee_sat = 11;
3132
-
3133
- /// The fee paid for this payment in milli-satoshis
3134
- int64 fee_msat = 12;
3135
-
3136
- /// The time in UNIX nanoseconds at which the payment was created.
3137
- int64 creation_time_ns = 13;
3138
-
3139
- /// The HTLCs made in attempt to settle the payment.
3140
- repeated HTLCAttempt htlcs = 14;
3141
-
3142
- /**
3143
- The creation index of this payment. Each payment can be uniquely identified
3144
- by this index, which may not strictly increment by 1 for payments made in
3145
- older versions of lnd.
3146
- */
3147
- uint64 payment_index = 15;
3148
-
3149
- PaymentFailureReason failure_reason = 16;
3150
- }
3151
-
3152
- message HTLCAttempt {
3153
- enum HTLCStatus {
3154
- IN_FLIGHT = 0;
3155
- SUCCEEDED = 1;
3156
- FAILED = 2;
3157
- }
3158
-
3159
- /// The status of the HTLC.
3160
- HTLCStatus status = 1;
3161
-
3162
- /// The route taken by this HTLC.
3163
- Route route = 2;
3164
-
3165
- /// The time in UNIX nanoseconds at which this HTLC was sent.
3166
- int64 attempt_time_ns = 3;
3167
-
3168
- /**
3169
- The time in UNIX nanoseconds at which this HTLC was settled or failed.
3170
- This value will not be set if the HTLC is still IN_FLIGHT.
3171
- */
3172
- int64 resolve_time_ns = 4;
3173
-
3174
- // Detailed htlc failure info.
3175
- Failure failure = 5;
3176
- }
3177
-
3178
- message ListPaymentsRequest {
3179
- /**
3180
- If true, then return payments that have not yet fully completed. This means
3181
- that pending payments, as well as failed payments will show up if this
3182
- field is set to true. This flag doesn't change the meaning of the indices,
3183
- which are tied to individual payments.
3184
- */
3185
- bool include_incomplete = 1;
3186
-
3187
- /**
3188
- The index of a payment that will be used as either the start or end of a
3189
- query to determine which payments should be returned in the response. The
3190
- index_offset is exclusive. In the case of a zero index_offset, the query
3191
- will start with the oldest payment when paginating forwards, or will end
3192
- with the most recent payment when paginating backwards.
3193
- */
3194
- uint64 index_offset = 2;
3195
-
3196
- /// The maximal number of payments returned in the response to this query.
3197
- uint64 max_payments = 3;
3198
-
3199
- /**
3200
- If set, the payments returned will result from seeking backwards from the
3201
- specified index offset. This can be used to paginate backwards. The order
3202
- of the returned payments is always oldest first (ascending index order).
3203
- */
3204
- bool reversed = 4;
3205
- }
3206
-
3207
- message ListPaymentsResponse {
3208
- /// The list of payments
3209
- repeated Payment payments = 1;
3210
-
3211
- /**
3212
- The index of the first item in the set of returned payments. This can be
3213
- used as the index_offset to continue seeking backwards in the next request.
3214
- */
3215
- uint64 first_index_offset = 2;
3216
-
3217
- /**
3218
- The index of the last item in the set of returned payments. This can be used
3219
- as the index_offset to continue seeking forwards in the next request.
3220
- */
3221
- uint64 last_index_offset = 3;
3222
- }
3223
-
3224
- message DeleteAllPaymentsRequest {
3225
- }
3226
-
3227
- message DeleteAllPaymentsResponse {
3228
- }
3229
-
3230
- message AbandonChannelRequest {
3231
- ChannelPoint channel_point = 1;
3232
- }
3233
-
3234
- message AbandonChannelResponse {
3235
- }
3236
-
3237
- message DebugLevelRequest {
3238
- bool show = 1;
3239
- string level_spec = 2;
3240
- }
3241
- message DebugLevelResponse {
3242
- string sub_systems = 1;
3243
- }
3244
-
3245
- message PayReqString {
3246
- /// The payment request string to be decoded
3247
- string pay_req = 1;
3248
- }
3249
- message PayReq {
3250
- string destination = 1;
3251
- string payment_hash = 2;
3252
- int64 num_satoshis = 3;
3253
- int64 timestamp = 4;
3254
- int64 expiry = 5;
3255
- string description = 6;
3256
- string description_hash = 7;
3257
- string fallback_addr = 8;
3258
- int64 cltv_expiry = 9;
3259
- repeated RouteHint route_hints = 10;
3260
- bytes payment_addr = 11;
3261
- int64 num_msat = 12;
3262
- map<uint32, Feature> features = 13;
3263
- }
3264
-
3265
- enum FeatureBit {
3266
- DATALOSS_PROTECT_REQ = 0;
3267
- DATALOSS_PROTECT_OPT = 1;
3268
- INITIAL_ROUING_SYNC = 3;
3269
- UPFRONT_SHUTDOWN_SCRIPT_REQ = 4;
3270
- UPFRONT_SHUTDOWN_SCRIPT_OPT = 5;
3271
- GOSSIP_QUERIES_REQ = 6;
3272
- GOSSIP_QUERIES_OPT = 7;
3273
- TLV_ONION_REQ = 8;
3274
- TLV_ONION_OPT = 9;
3275
- EXT_GOSSIP_QUERIES_REQ = 10;
3276
- EXT_GOSSIP_QUERIES_OPT = 11;
3277
- STATIC_REMOTE_KEY_REQ = 12;
3278
- STATIC_REMOTE_KEY_OPT = 13;
3279
- PAYMENT_ADDR_REQ = 14;
3280
- PAYMENT_ADDR_OPT = 15;
3281
- MPP_REQ = 16;
3282
- MPP_OPT = 17;
3283
- }
3284
-
3285
- message Feature {
3286
- string name = 2;
3287
- bool is_required = 3;
3288
- bool is_known = 4;
3289
- }
3290
-
3291
- message FeeReportRequest {
3292
- }
3293
- message ChannelFeeReport {
3294
- /// The short channel id that this fee report belongs to.
3295
- uint64 chan_id = 5 [jstype = JS_STRING];
3296
-
3297
- /// The channel that this fee report belongs to.
3298
- string channel_point = 1;
3299
-
3300
- /// The base fee charged regardless of the number of milli-satoshis sent.
3301
- int64 base_fee_msat = 2;
3302
-
3303
- /// The amount charged per milli-satoshis transferred expressed in
3304
- /// millionths of a satoshi.
3305
- int64 fee_per_mil = 3;
3306
-
3307
- /// The effective fee rate in milli-satoshis. Computed by dividing the
3308
- /// fee_per_mil value by 1 million.
3309
- double fee_rate = 4;
3310
- }
3311
- message FeeReportResponse {
3312
- /// An array of channel fee reports which describes the current fee schedule
3313
- /// for each channel.
3314
- repeated ChannelFeeReport channel_fees = 1;
3315
-
3316
- /// The total amount of fee revenue (in satoshis) the switch has collected
3317
- /// over the past 24 hrs.
3318
- uint64 day_fee_sum = 2;
3319
-
3320
- /// The total amount of fee revenue (in satoshis) the switch has collected
3321
- /// over the past 1 week.
3322
- uint64 week_fee_sum = 3;
3323
-
3324
- /// The total amount of fee revenue (in satoshis) the switch has collected
3325
- /// over the past 1 month.
3326
- uint64 month_fee_sum = 4;
3327
- }
3328
-
3329
- message PolicyUpdateRequest {
3330
- oneof scope {
3331
- /// If set, then this update applies to all currently active channels.
3332
- bool global = 1;
3333
-
3334
- /// If set, this update will target a specific channel.
3335
- ChannelPoint chan_point = 2;
3336
- }
3337
-
3338
- /// The base fee charged regardless of the number of milli-satoshis sent.
3339
- int64 base_fee_msat = 3;
3340
-
3341
- /// The effective fee rate in milli-satoshis. The precision of this value
3342
- /// goes up to 6 decimal places, so 1e-6.
3343
- double fee_rate = 4;
3344
-
3345
- /// The required timelock delta for HTLCs forwarded over the channel.
3346
- uint32 time_lock_delta = 5;
3347
-
3348
- /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum
3349
- /// HTLC will be unchanged.
3350
- uint64 max_htlc_msat = 6;
3351
-
3352
- /// The minimum HTLC size in milli-satoshis. Only applied if
3353
- /// min_htlc_msat_specified is true.
3354
- uint64 min_htlc_msat = 7;
3355
-
3356
- /// If true, min_htlc_msat is applied.
3357
- bool min_htlc_msat_specified = 8;
3358
- }
3359
- message PolicyUpdateResponse {
3360
- }
3361
-
3362
- message ForwardingHistoryRequest {
3363
- /// Start time is the starting point of the forwarding history request. All
3364
- /// records beyond this point will be included, respecting the end time, and
3365
- /// the index offset.
3366
- uint64 start_time = 1;
3367
-
3368
- /// End time is the end point of the forwarding history request. The
3369
- /// response will carry at most 50k records between the start time and the
3370
- /// end time. The index offset can be used to implement pagination.
3371
- uint64 end_time = 2;
3372
-
3373
- /// Index offset is the offset in the time series to start at. As each
3374
- /// response can only contain 50k records, callers can use this to skip
3375
- /// around within a packed time series.
3376
- uint32 index_offset = 3;
3377
-
3378
- /// The max number of events to return in the response to this query.
3379
- uint32 num_max_events = 4;
3380
- }
3381
- message ForwardingEvent {
3382
- /// Timestamp is the time (unix epoch offset) that this circuit was
3383
- /// completed.
3384
- uint64 timestamp = 1;
3385
-
3386
- /// The incoming channel ID that carried the HTLC that created the circuit.
3387
- uint64 chan_id_in = 2 [jstype = JS_STRING];
3388
-
3389
- /// The outgoing channel ID that carried the preimage that completed the
3390
- /// circuit.
3391
- uint64 chan_id_out = 4 [jstype = JS_STRING];
3392
-
3393
- /// The total amount (in satoshis) of the incoming HTLC that created half
3394
- /// the circuit.
3395
- uint64 amt_in = 5;
3396
-
3397
- /// The total amount (in satoshis) of the outgoing HTLC that created the
3398
- /// second half of the circuit.
3399
- uint64 amt_out = 6;
3400
-
3401
- /// The total fee (in satoshis) that this payment circuit carried.
3402
- uint64 fee = 7;
3403
-
3404
- /// The total fee (in milli-satoshis) that this payment circuit carried.
3405
- uint64 fee_msat = 8;
3406
-
3407
- /// The total amount (in milli-satoshis) of the incoming HTLC that created
3408
- /// half the circuit.
3409
- uint64 amt_in_msat = 9;
3410
-
3411
- /// The total amount (in milli-satoshis) of the outgoing HTLC that created
3412
- /// the second half of the circuit.
3413
- uint64 amt_out_msat = 10;
3414
-
3415
- // TODO(roasbeef): add settlement latency?
3416
- // * use FPE on the chan id?
3417
- // * also list failures?
3418
- }
3419
- message ForwardingHistoryResponse {
3420
- /// A list of forwarding events from the time slice of the time series
3421
- /// specified in the request.
3422
- repeated ForwardingEvent forwarding_events = 1;
3423
-
3424
- /// The index of the last time in the set of returned forwarding events. Can
3425
- /// be used to seek further, pagination style.
3426
- uint32 last_offset_index = 2;
3427
- }
3428
-
3429
- message ExportChannelBackupRequest {
3430
- /// The target channel point to obtain a back up for.
3431
- ChannelPoint chan_point = 1;
3432
- }
3433
-
3434
- message ChannelBackup {
3435
- /**
3436
- Identifies the channel that this backup belongs to.
3437
- */
3438
- ChannelPoint chan_point = 1;
3439
-
3440
- /**
3441
- Is an encrypted single-chan backup. this can be passed to
3442
- RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in
3443
- order to trigger the recovery protocol. When using REST, this field must be
3444
- encoded as base64.
3445
- */
3446
- bytes chan_backup = 2;
3447
- }
3448
-
3449
- message MultiChanBackup {
3450
- /**
3451
- Is the set of all channels that are included in this multi-channel backup.
3452
- */
3453
- repeated ChannelPoint chan_points = 1;
3454
-
3455
- /**
3456
- A single encrypted blob containing all the static channel backups of the
3457
- channel listed above. This can be stored as a single file or blob, and
3458
- safely be replaced with any prior/future versions. When using REST, this
3459
- field must be encoded as base64.
3460
- */
3461
- bytes multi_chan_backup = 2;
3462
- }
3463
-
3464
- message ChanBackupExportRequest {
3465
- }
3466
- message ChanBackupSnapshot {
3467
- /**
3468
- The set of new channels that have been added since the last channel backup
3469
- snapshot was requested.
3470
- */
3471
- ChannelBackups single_chan_backups = 1;
3472
-
3473
- /**
3474
- A multi-channel backup that covers all open channels currently known to
3475
- lnd.
3476
- */
3477
- MultiChanBackup multi_chan_backup = 2;
3478
- }
3479
-
3480
- message ChannelBackups {
3481
- /**
3482
- A set of single-chan static channel backups.
3483
- */
3484
- repeated ChannelBackup chan_backups = 1;
3485
- }
3486
-
3487
- message RestoreChanBackupRequest {
3488
- oneof backup {
3489
- /**
3490
- The channels to restore as a list of channel/backup pairs.
3491
- */
3492
- ChannelBackups chan_backups = 1;
3493
-
3494
- /**
3495
- The channels to restore in the packed multi backup format. When using
3496
- REST, this field must be encoded as base64.
3497
- */
3498
- bytes multi_chan_backup = 2;
3499
- }
3500
- }
3501
- message RestoreBackupResponse {
3502
- }
3503
-
3504
- message ChannelBackupSubscription {
3505
- }
3506
-
3507
- message VerifyChanBackupResponse {
3508
- }
3509
-
3510
- message MacaroonPermission {
3511
- /// The entity a permission grants access to.
3512
- string entity = 1;
3513
-
3514
- /// The action that is granted.
3515
- string action = 2;
3516
- }
3517
- message BakeMacaroonRequest {
3518
- /// The list of permissions the new macaroon should grant.
3519
- repeated MacaroonPermission permissions = 1;
3520
- }
3521
- message BakeMacaroonResponse {
3522
- /// The hex encoded macaroon, serialized in binary format.
3523
- string macaroon = 1;
3524
- }
3525
-
3526
- message Failure {
3527
- enum FailureCode {
3528
- /**
3529
- The numbers assigned in this enumeration match the failure codes as
3530
- defined in BOLT #4. Because protobuf 3 requires enums to start with 0,
3531
- a RESERVED value is added.
3532
- */
3533
- RESERVED = 0;
3534
-
3535
- INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1;
3536
- INCORRECT_PAYMENT_AMOUNT = 2;
3537
- FINAL_INCORRECT_CLTV_EXPIRY = 3;
3538
- FINAL_INCORRECT_HTLC_AMOUNT = 4;
3539
- FINAL_EXPIRY_TOO_SOON = 5;
3540
- INVALID_REALM = 6;
3541
- EXPIRY_TOO_SOON = 7;
3542
- INVALID_ONION_VERSION = 8;
3543
- INVALID_ONION_HMAC = 9;
3544
- INVALID_ONION_KEY = 10;
3545
- AMOUNT_BELOW_MINIMUM = 11;
3546
- FEE_INSUFFICIENT = 12;
3547
- INCORRECT_CLTV_EXPIRY = 13;
3548
- CHANNEL_DISABLED = 14;
3549
- TEMPORARY_CHANNEL_FAILURE = 15;
3550
- REQUIRED_NODE_FEATURE_MISSING = 16;
3551
- REQUIRED_CHANNEL_FEATURE_MISSING = 17;
3552
- UNKNOWN_NEXT_PEER = 18;
3553
- TEMPORARY_NODE_FAILURE = 19;
3554
- PERMANENT_NODE_FAILURE = 20;
3555
- PERMANENT_CHANNEL_FAILURE = 21;
3556
- EXPIRY_TOO_FAR = 22;
3557
- MPP_TIMEOUT = 23;
3558
-
3559
- /**
3560
- An internal error occurred.
3561
- */
3562
- INTERNAL_FAILURE = 997;
3563
-
3564
- /**
3565
- The error source is known, but the failure itself couldn't be decoded.
3566
- */
3567
- UNKNOWN_FAILURE = 998;
3568
-
3569
- /**
3570
- An unreadable failure result is returned if the received failure message
3571
- cannot be decrypted. In that case the error source is unknown.
3572
- */
3573
- UNREADABLE_FAILURE = 999;
3574
- }
3575
-
3576
- /// Failure code as defined in the Lightning spec
3577
- FailureCode code = 1;
3578
-
3579
- reserved 2;
3580
-
3581
- /// An optional channel update message.
3582
- ChannelUpdate channel_update = 3;
3583
-
3584
- /// A failure type-dependent htlc value.
3585
- uint64 htlc_msat = 4;
3586
-
3587
- /// The sha256 sum of the onion payload.
3588
- bytes onion_sha_256 = 5;
3589
-
3590
- /// A failure type-dependent cltv expiry value.
3591
- uint32 cltv_expiry = 6;
3592
-
3593
- /// A failure type-dependent flags value.
3594
- uint32 flags = 7;
3595
-
3596
- /**
3597
- The position in the path of the intermediate or final node that generated
3598
- the failure message. Position zero is the sender node.
3599
- **/
3600
- uint32 failure_source_index = 8;
3601
-
3602
- /// A failure type-dependent block height.
3603
- uint32 height = 9;
3604
- }
3605
-
3606
- message ChannelUpdate {
3607
- /**
3608
- The signature that validates the announced data and proves the ownership
3609
- of node id.
3610
- */
3611
- bytes signature = 1;
3612
-
3613
- /**
3614
- The target chain that this channel was opened within. This value
3615
- should be the genesis hash of the target chain. Along with the short
3616
- channel ID, this uniquely identifies the channel globally in a
3617
- blockchain.
3618
- */
3619
- bytes chain_hash = 2;
3620
-
3621
- /**
3622
- The unique description of the funding transaction.
3623
- */
3624
- uint64 chan_id = 3 [jstype = JS_STRING];
3625
-
3626
- /**
3627
- A timestamp that allows ordering in the case of multiple announcements.
3628
- We should ignore the message if timestamp is not greater than the
3629
- last-received.
3630
- */
3631
- uint32 timestamp = 4;
3632
-
3633
- /**
3634
- The bitfield that describes whether optional fields are present in this
3635
- update. Currently, the least-significant bit must be set to 1 if the
3636
- optional field MaxHtlc is present.
3637
- */
3638
- uint32 message_flags = 10;
3639
-
3640
- /**
3641
- The bitfield that describes additional meta-data concerning how the
3642
- update is to be interpreted. Currently, the least-significant bit must be
3643
- set to 0 if the creating node corresponds to the first node in the
3644
- previously sent channel announcement and 1 otherwise. If the second bit
3645
- is set, then the channel is set to be disabled.
3646
- */
3647
- uint32 channel_flags = 5;
3648
-
3649
- /**
3650
- The minimum number of blocks this node requires to be added to the expiry
3651
- of HTLCs. This is a security parameter determined by the node operator.
3652
- This value represents the required gap between the time locks of the
3653
- incoming and outgoing HTLC's set to this node.
3654
- */
3655
- uint32 time_lock_delta = 6;
3656
-
3657
- /**
3658
- The minimum HTLC value which will be accepted.
3659
- */
3660
- uint64 htlc_minimum_msat = 7;
3661
-
3662
- /**
3663
- The base fee that must be used for incoming HTLC's to this particular
3664
- channel. This value will be tacked onto the required for a payment
3665
- independent of the size of the payment.
3666
- */
3667
- uint32 base_fee = 8;
3668
-
3669
- /**
3670
- The fee rate that will be charged per millionth of a satoshi.
3671
- */
3672
- uint32 fee_rate = 9;
3673
-
3674
- /**
3675
- The maximum HTLC value which will be accepted.
3676
- */
3677
- uint64 htlc_maximum_msat = 11;
3678
-
3679
- /**
3680
- The set of data that was appended to this message, some of which we may
3681
- not actually know how to iterate or parse. By holding onto this data, we
3682
- ensure that we're able to properly validate the set of signatures that
3683
- cover these new fields, and ensure we're able to make upgrades to the
3684
- network in a forwards compatible manner.
3685
- */
3686
- bytes extra_opaque_data = 12;
3687
- }