lnrpc 0.8.0 → 0.12.1

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/.gitignore +2 -0
  3. data/Gemfile.lock +24 -24
  4. data/README.md +30 -16
  5. data/examples.rb +14 -12
  6. data/generate-grpc-service-files.sh +30 -0
  7. data/lib/grpc_services/autopilotrpc/autopilot_pb.rb +48 -0
  8. data/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb +40 -0
  9. data/lib/grpc_services/chainrpc/chainnotifier_pb.rb +67 -0
  10. data/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb +51 -0
  11. data/lib/grpc_services/invoicesrpc/invoices_pb.rb +48 -0
  12. data/lib/grpc_services/invoicesrpc/invoices_services_pb.rb +41 -0
  13. data/lib/grpc_services/lnclipb/lncli_pb.rb +18 -0
  14. data/lib/grpc_services/routerrpc/router_pb.rb +233 -0
  15. data/lib/grpc_services/routerrpc/router_services_pb.rb +86 -0
  16. data/lib/grpc_services/rpc_pb.rb +1347 -0
  17. data/lib/{lnrpc → grpc_services}/rpc_services_pb.rb +185 -175
  18. data/lib/grpc_services/signrpc/signer_pb.rb +84 -0
  19. data/lib/grpc_services/signrpc/signer_services_pb.rb +69 -0
  20. data/lib/grpc_services/verrpc/verrpc_pb.rb +27 -0
  21. data/lib/grpc_services/verrpc/verrpc_services_pb.rb +27 -0
  22. data/lib/grpc_services/walletrpc/walletkit_pb.rb +188 -0
  23. data/lib/grpc_services/walletrpc/walletkit_services_pb.rb +148 -0
  24. data/lib/grpc_services/walletunlocker_pb.rb +57 -0
  25. data/lib/grpc_services/walletunlocker_services_pb.rb +72 -0
  26. data/lib/grpc_services/watchtowerrpc/watchtower_pb.rb +21 -0
  27. data/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb +28 -0
  28. data/lib/grpc_services/wtclientrpc/wtclient_pb.rb +81 -0
  29. data/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb +43 -0
  30. data/lib/lnrpc.rb +19 -3
  31. data/lib/lnrpc/client.rb +62 -46
  32. data/lib/lnrpc/grpc_wrapper.rb +43 -0
  33. data/lib/lnrpc/version.rb +1 -1
  34. data/lnrpc.gemspec +7 -5
  35. metadata +41 -17
  36. data/lib/lnrpc/rpc.proto +0 -2580
  37. data/lib/lnrpc/rpc_pb.rb +0 -938
@@ -0,0 +1,43 @@
1
+ module Lnrpc
2
+ class GrpcWrapper
3
+ attr_reader :grpc, :service
4
+
5
+ def initialize(service:, grpc:)
6
+ @grpc = grpc
7
+ @service = service
8
+ end
9
+
10
+ def method_missing(m, *args, &block)
11
+ if grpc.respond_to?(m)
12
+ params = args[0]
13
+
14
+ args[0] = params.nil? ? request_class_for(m).new : request_class_for(m).new(params)
15
+ grpc.send(m, *args, &block)
16
+ else
17
+ super
18
+ end
19
+ end
20
+
21
+ def inspect
22
+ "#{self} @grpc=\"#{grpc}\""
23
+ end
24
+
25
+ private
26
+
27
+ def request_class_for(method_name)
28
+ rpc_desc = service.rpc_descs[camelize(method_name).to_sym]
29
+ raise "Request class not found for: #{method_name}" unless rpc_desc
30
+
31
+ rpc_desc.input
32
+ end
33
+
34
+ def camelize(name)
35
+ str = name.to_s
36
+ separators = ['_', '\s']
37
+ separators.each do |s|
38
+ str = str.gsub(/(?:#{s}+)([a-z])/) { $1.upcase }
39
+ end
40
+ str.gsub(/(\A|\s)([a-z])/) { $1 + $2.upcase }
41
+ end
42
+ end
43
+ end
data/lib/lnrpc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lnrpc
2
- VERSION = "0.8.0"
2
+ VERSION = "0.12.1"
3
3
  end
data/lnrpc.gemspec CHANGED
@@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/bumi/lnrpc"
15
15
  spec.license = "MIT"
16
16
 
17
+ spec.metadata['funding'] = 'lightning:02ad33d99d0bb3bf3bb8ec8e089cbefa8fd7de23a13cfa59aec9af9730816be76f'
18
+
17
19
  # Specify which files should be added to the gem when it is released.
18
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
21
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
@@ -21,12 +23,12 @@ Gem::Specification.new do |spec|
21
23
  end
22
24
  spec.bindir = "exe"
23
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ["lib"]
26
+ spec.require_paths = ["lib", "lib/grpc_services"]
25
27
 
26
- spec.add_development_dependency "bundler", "~> 1.17"
27
- spec.add_development_dependency "rake", "~> 10.0"
28
+ spec.add_development_dependency "bundler", "> 2.0"
29
+ spec.add_development_dependency "rake", "~> 13.0"
28
30
  spec.add_development_dependency "rspec", "~> 3.0"
29
31
 
30
- spec.add_dependency "grpc", ">= 1.19.0"
31
- spec.add_dependency "google-protobuf", ">=3.7"
32
+ spec.add_dependency "grpc", ">= 1.28.0"
33
+ spec.add_dependency "google-protobuf", ">=3.12"
32
34
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lnrpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bumann
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-27 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.19.0
61
+ version: 1.28.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.19.0
68
+ version: 1.28.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: google-protobuf
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.7'
75
+ version: '3.12'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.7'
82
+ version: '3.12'
83
83
  description: gRPC service definitions for the Lightning Network Daemon (lnd) gRPC
84
84
  interface packed as ruby gem
85
85
  email:
@@ -98,22 +98,46 @@ files:
98
98
  - bin/console
99
99
  - bin/setup
100
100
  - examples.rb
101
+ - generate-grpc-service-files.sh
102
+ - lib/grpc_services/autopilotrpc/autopilot_pb.rb
103
+ - lib/grpc_services/autopilotrpc/autopilot_services_pb.rb
104
+ - lib/grpc_services/chainrpc/chainnotifier_pb.rb
105
+ - lib/grpc_services/chainrpc/chainnotifier_services_pb.rb
106
+ - lib/grpc_services/invoicesrpc/invoices_pb.rb
107
+ - lib/grpc_services/invoicesrpc/invoices_services_pb.rb
108
+ - lib/grpc_services/lnclipb/lncli_pb.rb
109
+ - lib/grpc_services/routerrpc/router_pb.rb
110
+ - lib/grpc_services/routerrpc/router_services_pb.rb
111
+ - lib/grpc_services/rpc_pb.rb
112
+ - lib/grpc_services/rpc_services_pb.rb
113
+ - lib/grpc_services/signrpc/signer_pb.rb
114
+ - lib/grpc_services/signrpc/signer_services_pb.rb
115
+ - lib/grpc_services/verrpc/verrpc_pb.rb
116
+ - lib/grpc_services/verrpc/verrpc_services_pb.rb
117
+ - lib/grpc_services/walletrpc/walletkit_pb.rb
118
+ - lib/grpc_services/walletrpc/walletkit_services_pb.rb
119
+ - lib/grpc_services/walletunlocker_pb.rb
120
+ - lib/grpc_services/walletunlocker_services_pb.rb
121
+ - lib/grpc_services/watchtowerrpc/watchtower_pb.rb
122
+ - lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb
123
+ - lib/grpc_services/wtclientrpc/wtclient_pb.rb
124
+ - lib/grpc_services/wtclientrpc/wtclient_services_pb.rb
101
125
  - lib/lnrpc.rb
102
126
  - lib/lnrpc/client.rb
127
+ - lib/lnrpc/grpc_wrapper.rb
103
128
  - lib/lnrpc/macaroon_interceptor.rb
104
- - lib/lnrpc/rpc.proto
105
- - lib/lnrpc/rpc_pb.rb
106
- - lib/lnrpc/rpc_services_pb.rb
107
129
  - lib/lnrpc/version.rb
108
130
  - lnrpc.gemspec
109
131
  homepage: https://github.com/bumi/lnrpc
110
132
  licenses:
111
133
  - MIT
112
- metadata: {}
134
+ metadata:
135
+ funding: lightning:02ad33d99d0bb3bf3bb8ec8e089cbefa8fd7de23a13cfa59aec9af9730816be76f
113
136
  post_install_message:
114
137
  rdoc_options: []
115
138
  require_paths:
116
139
  - lib
140
+ - lib/grpc_services
117
141
  required_ruby_version: !ruby/object:Gem::Requirement
118
142
  requirements:
119
143
  - - ">="
@@ -125,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
149
  - !ruby/object:Gem::Version
126
150
  version: '0'
127
151
  requirements: []
128
- rubygems_version: 3.0.6
152
+ rubygems_version: 3.1.4
129
153
  signing_key:
130
154
  specification_version: 4
131
155
  summary: gRPC interface for lnd packed as ruby gem
data/lib/lnrpc/rpc.proto DELETED
@@ -1,2580 +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) returns (ChangePasswordResponse) {
87
- option (google.api.http) = {
88
- post: "/v1/changepassword"
89
- body: "*"
90
- };
91
- }
92
- }
93
-
94
- message GenSeedRequest {
95
- /**
96
- aezeed_passphrase is an optional user provided passphrase that will be used
97
- to encrypt the generated aezeed cipher seed.
98
- */
99
- bytes aezeed_passphrase = 1;
100
-
101
- /**
102
- seed_entropy is an optional 16-bytes generated via CSPRNG. If not
103
- specified, then a fresh set of randomness will be used to create the seed.
104
- */
105
- bytes seed_entropy = 2;
106
- }
107
- message GenSeedResponse {
108
- /**
109
- cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
110
- cipher seed obtained by the user. This field is optional, as if not
111
- provided, then the daemon will generate a new cipher seed for the user.
112
- Otherwise, then the daemon will attempt to recover the wallet state linked
113
- to this cipher seed.
114
- */
115
- repeated string cipher_seed_mnemonic = 1;
116
-
117
- /**
118
- enciphered_seed are the raw aezeed cipher seed bytes. This is the raw
119
- cipher text before run through our mnemonic encoding scheme.
120
- */
121
- bytes enciphered_seed = 2;
122
- }
123
-
124
- message InitWalletRequest {
125
- /**
126
- wallet_password is the passphrase that should be used to encrypt the
127
- wallet. This MUST be at least 8 chars in length. After creation, this
128
- password is required to unlock the daemon.
129
- */
130
- bytes wallet_password = 1;
131
-
132
- /**
133
- cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed
134
- cipher seed obtained by the user. This may have been generated by the
135
- GenSeed method, or be an existing seed.
136
- */
137
- repeated string cipher_seed_mnemonic = 2;
138
-
139
- /**
140
- aezeed_passphrase is an optional user provided passphrase that will be used
141
- to encrypt the generated aezeed cipher seed.
142
- */
143
- bytes aezeed_passphrase = 3;
144
-
145
- /**
146
- recovery_window is an optional argument specifying the address lookahead
147
- when restoring a wallet seed. The recovery window applies to each
148
- individual branch of the BIP44 derivation paths. Supplying a recovery
149
- window of zero indicates that no addresses should be recovered, such after
150
- the first initialization of the wallet.
151
- */
152
- int32 recovery_window = 4;
153
-
154
- /**
155
- channel_backups is an optional argument that allows clients to recover the
156
- settled funds within a set of channels. This should be populated if the
157
- user was unable to close out all channels and sweep funds before partial or
158
- total data loss occurred. If specified, then after on-chain recovery of
159
- funds, lnd begin to carry out the data loss recovery protocol in order to
160
- recover the funds in each channel from a remote force closed transaction.
161
- */
162
- ChanBackupSnapshot channel_backups = 5;
163
- }
164
- message InitWalletResponse {
165
- }
166
-
167
- message UnlockWalletRequest {
168
- /**
169
- wallet_password should be the current valid passphrase for the daemon. This
170
- will be required to decrypt on-disk material that the daemon requires to
171
- function properly.
172
- */
173
- bytes wallet_password = 1;
174
-
175
- /**
176
- recovery_window is an optional argument specifying the address lookahead
177
- when restoring a wallet seed. The recovery window applies to each
178
- individual branch of the BIP44 derivation paths. Supplying a recovery
179
- window of zero indicates that no addresses should be recovered, such after
180
- the first initialization of the wallet.
181
- */
182
- int32 recovery_window = 2;
183
-
184
- /**
185
- channel_backups is an optional argument that allows clients to recover the
186
- settled funds within a set of channels. This should be populated if the
187
- user was unable to close out all channels and sweep funds before partial or
188
- total data loss occurred. If specified, then after on-chain recovery of
189
- funds, lnd begin to carry out the data loss recovery protocol in order to
190
- recover the funds in each channel from a remote force closed transaction.
191
- */
192
- ChanBackupSnapshot channel_backups = 3;
193
- }
194
- message UnlockWalletResponse {}
195
-
196
- message ChangePasswordRequest {
197
- /**
198
- current_password should be the current valid passphrase used to unlock the
199
- daemon.
200
- */
201
- bytes current_password = 1;
202
-
203
- /**
204
- new_password should be the new passphrase that will be needed to unlock the
205
- daemon.
206
- */
207
- bytes new_password = 2;
208
- }
209
- message ChangePasswordResponse {}
210
-
211
- service Lightning {
212
- /** lncli: `walletbalance`
213
- WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
214
- confirmed unspent outputs and all unconfirmed unspent outputs under control
215
- of the wallet.
216
- */
217
- rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) {
218
- option (google.api.http) = {
219
- get: "/v1/balance/blockchain"
220
- };
221
- }
222
-
223
- /** lncli: `channelbalance`
224
- ChannelBalance returns the total funds available across all open channels
225
- in satoshis.
226
- */
227
- rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse) {
228
- option (google.api.http) = {
229
- get: "/v1/balance/channels"
230
- };
231
- }
232
-
233
- /** lncli: `listchaintxns`
234
- GetTransactions returns a list describing all the known transactions
235
- relevant to the wallet.
236
- */
237
- rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) {
238
- option (google.api.http) = {
239
- get: "/v1/transactions"
240
- };
241
- }
242
-
243
- /** lncli: `estimatefee`
244
- EstimateFee asks the chain backend to estimate the fee rate and total fees
245
- for a transaction that pays to multiple specified outputs.
246
- */
247
- rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) {
248
- option (google.api.http) = {
249
- get: "/v1/transactions/fee"
250
- };
251
- }
252
-
253
- /** lncli: `sendcoins`
254
- SendCoins executes a request to send coins to a particular address. Unlike
255
- SendMany, this RPC call only allows creating a single output at a time. If
256
- neither target_conf, or sat_per_byte are set, then the internal wallet will
257
- consult its fee model to determine a fee for the default confirmation
258
- target.
259
- */
260
- rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) {
261
- option (google.api.http) = {
262
- post: "/v1/transactions"
263
- body: "*"
264
- };
265
- }
266
-
267
- /** lncli: `listunspent`
268
- ListUnspent returns a list of all utxos spendable by the wallet with a
269
- number of confirmations between the specified minimum and maximum.
270
- */
271
- rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) {
272
- option (google.api.http) = {
273
- get: "/v1/utxos"
274
- };
275
- }
276
-
277
- /**
278
- SubscribeTransactions creates a uni-directional stream from the server to
279
- the client in which any newly discovered transactions relevant to the
280
- wallet are sent over.
281
- */
282
- rpc SubscribeTransactions (GetTransactionsRequest) returns (stream Transaction);
283
-
284
- /** lncli: `sendmany`
285
- SendMany handles a request for a transaction that creates multiple specified
286
- outputs in parallel. If neither target_conf, or sat_per_byte are set, then
287
- the internal wallet will consult its fee model to determine a fee for the
288
- default confirmation target.
289
- */
290
- rpc SendMany (SendManyRequest) returns (SendManyResponse);
291
-
292
- /** lncli: `newaddress`
293
- NewAddress creates a new address under control of the local wallet.
294
- */
295
- rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) {
296
- option (google.api.http) = {
297
- get: "/v1/newaddress"
298
- };
299
- }
300
-
301
- /** lncli: `signmessage`
302
- SignMessage signs a message with this node's private key. The returned
303
- signature string is `zbase32` encoded and pubkey recoverable, meaning that
304
- only the message digest and signature are needed for verification.
305
- */
306
- rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) {
307
- option (google.api.http) = {
308
- post: "/v1/signmessage"
309
- body: "*"
310
- };
311
- }
312
-
313
- /** lncli: `verifymessage`
314
- VerifyMessage verifies a signature over a msg. The signature must be
315
- zbase32 encoded and signed by an active node in the resident node's
316
- channel database. In addition to returning the validity of the signature,
317
- VerifyMessage also returns the recovered pubkey from the signature.
318
- */
319
- rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) {
320
- option (google.api.http) = {
321
- post: "/v1/verifymessage"
322
- body: "*"
323
- };
324
- }
325
-
326
- /** lncli: `connect`
327
- ConnectPeer attempts to establish a connection to a remote peer. This is at
328
- the networking level, and is used for communication between nodes. This is
329
- distinct from establishing a channel with a peer.
330
- */
331
- rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) {
332
- option (google.api.http) = {
333
- post: "/v1/peers"
334
- body: "*"
335
- };
336
- }
337
-
338
- /** lncli: `disconnect`
339
- DisconnectPeer attempts to disconnect one peer from another identified by a
340
- given pubKey. In the case that we currently have a pending or active channel
341
- with the target peer, then this action will be not be allowed.
342
- */
343
- rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse) {
344
- option (google.api.http) = {
345
- delete: "/v1/peers/{pub_key}"
346
- };
347
- }
348
-
349
- /** lncli: `listpeers`
350
- ListPeers returns a verbose listing of all currently active peers.
351
- */
352
- rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) {
353
- option (google.api.http) = {
354
- get: "/v1/peers"
355
- };
356
- }
357
-
358
- /** lncli: `getinfo`
359
- GetInfo returns general information concerning the lightning node including
360
- it's identity pubkey, alias, the chains it is connected to, and information
361
- concerning the number of open+pending channels.
362
- */
363
- rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) {
364
- option (google.api.http) = {
365
- get: "/v1/getinfo"
366
- };
367
- }
368
-
369
- // TODO(roasbeef): merge with below with bool?
370
- /** lncli: `pendingchannels`
371
- PendingChannels returns a list of all the channels that are currently
372
- considered "pending". A channel is pending if it has finished the funding
373
- workflow and is waiting for confirmations for the funding txn, or is in the
374
- process of closure, either initiated cooperatively or non-cooperatively.
375
- */
376
- rpc PendingChannels (PendingChannelsRequest) returns (PendingChannelsResponse) {
377
- option (google.api.http) = {
378
- get: "/v1/channels/pending"
379
- };
380
- }
381
-
382
- /** lncli: `listchannels`
383
- ListChannels returns a description of all the open channels that this node
384
- is a participant in.
385
- */
386
- rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) {
387
- option (google.api.http) = {
388
- get: "/v1/channels"
389
- };
390
- }
391
-
392
- /**
393
- SubscribeChannelEvents creates a uni-directional stream from the server to
394
- the client in which any updates relevant to the state of the channels are
395
- sent over. Events include new active channels, inactive channels, and closed
396
- channels.
397
- */
398
- rpc SubscribeChannelEvents (ChannelEventSubscription) returns (stream ChannelEventUpdate);
399
-
400
- /** lncli: `closedchannels`
401
- ClosedChannels returns a description of all the closed channels that
402
- this node was a participant in.
403
- */
404
- rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse) {
405
- option (google.api.http) = {
406
- get: "/v1/channels/closed"
407
- };
408
- }
409
-
410
-
411
- /**
412
- OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
413
- call is meant to be consumed by clients to the REST proxy. As with all
414
- other sync calls, all byte slices are intended to be populated as hex
415
- encoded strings.
416
- */
417
- rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) {
418
- option (google.api.http) = {
419
- post: "/v1/channels"
420
- body: "*"
421
- };
422
- }
423
-
424
- /** lncli: `openchannel`
425
- OpenChannel attempts to open a singly funded channel specified in the
426
- request to a remote peer. Users are able to specify a target number of
427
- blocks that the funding transaction should be confirmed in, or a manual fee
428
- rate to us for the funding transaction. If neither are specified, then a
429
- lax block confirmation target is used.
430
- */
431
- rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate);
432
-
433
- /**
434
- ChannelAcceptor dispatches a bi-directional streaming RPC in which
435
- OpenChannel requests are sent to the client and the client responds with
436
- a boolean that tells LND whether or not to accept the channel. This allows
437
- node operators to specify their own criteria for accepting inbound channels
438
- through a single persistent connection.
439
- */
440
- rpc ChannelAcceptor (stream ChannelAcceptResponse) returns (stream ChannelAcceptRequest);
441
-
442
- /** lncli: `closechannel`
443
- CloseChannel attempts to close an active channel identified by its channel
444
- outpoint (ChannelPoint). The actions of this method can additionally be
445
- augmented to attempt a force close after a timeout period in the case of an
446
- inactive peer. If a non-force close (cooperative closure) is requested,
447
- then the user can specify either a target number of blocks until the
448
- closure transaction is confirmed, or a manual fee rate. If neither are
449
- specified, then a default lax, block confirmation target is used.
450
- */
451
- rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) {
452
- option (google.api.http) = {
453
- delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}"
454
- };
455
- }
456
-
457
- /** lncli: `abandonchannel`
458
- AbandonChannel removes all channel state from the database except for a
459
- close summary. This method can be used to get rid of permanently unusable
460
- channels due to bugs fixed in newer versions of lnd. Only available
461
- when in debug builds of lnd.
462
- */
463
- rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse) {
464
- option (google.api.http) = {
465
- delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}"
466
- };
467
- }
468
-
469
-
470
- /** lncli: `sendpayment`
471
- SendPayment dispatches a bi-directional streaming RPC for sending payments
472
- through the Lightning Network. A single RPC invocation creates a persistent
473
- bi-directional stream allowing clients to rapidly send payments through the
474
- Lightning Network with a single persistent connection.
475
- */
476
- rpc SendPayment (stream SendRequest) returns (stream SendResponse);
477
-
478
- /**
479
- SendPaymentSync is the synchronous non-streaming version of SendPayment.
480
- This RPC is intended to be consumed by clients of the REST proxy.
481
- Additionally, this RPC expects the destination's public key and the payment
482
- hash (if any) to be encoded as hex strings.
483
- */
484
- rpc SendPaymentSync (SendRequest) returns (SendResponse) {
485
- option (google.api.http) = {
486
- post: "/v1/channels/transactions"
487
- body: "*"
488
- };
489
- }
490
-
491
- /** lncli: `sendtoroute`
492
- SendToRoute is a bi-directional streaming RPC for sending payment through
493
- the Lightning Network. This method differs from SendPayment in that it
494
- allows users to specify a full route manually. This can be used for things
495
- like rebalancing, and atomic swaps.
496
- */
497
- rpc SendToRoute(stream SendToRouteRequest) returns (stream SendResponse);
498
-
499
- /**
500
- SendToRouteSync is a synchronous version of SendToRoute. It Will block
501
- until the payment either fails or succeeds.
502
- */
503
- rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) {
504
- option (google.api.http) = {
505
- post: "/v1/channels/transactions/route"
506
- body: "*"
507
- };
508
- }
509
-
510
- /** lncli: `addinvoice`
511
- AddInvoice attempts to add a new invoice to the invoice database. Any
512
- duplicated invoices are rejected, therefore all invoices *must* have a
513
- unique payment preimage.
514
- */
515
- rpc AddInvoice (Invoice) returns (AddInvoiceResponse) {
516
- option (google.api.http) = {
517
- post: "/v1/invoices"
518
- body: "*"
519
- };
520
- }
521
-
522
- /** lncli: `listinvoices`
523
- ListInvoices returns a list of all the invoices currently stored within the
524
- database. Any active debug invoices are ignored. It has full support for
525
- paginated responses, allowing users to query for specific invoices through
526
- their add_index. This can be done by using either the first_index_offset or
527
- last_index_offset fields included in the response as the index_offset of the
528
- next request. By default, the first 100 invoices created will be returned.
529
- Backwards pagination is also supported through the Reversed flag.
530
- */
531
- rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) {
532
- option (google.api.http) = {
533
- get: "/v1/invoices"
534
- };
535
- }
536
-
537
- /** lncli: `lookupinvoice`
538
- LookupInvoice attempts to look up an invoice according to its payment hash.
539
- The passed payment hash *must* be exactly 32 bytes, if not, an error is
540
- returned.
541
- */
542
- rpc LookupInvoice (PaymentHash) returns (Invoice) {
543
- option (google.api.http) = {
544
- get: "/v1/invoice/{r_hash_str}"
545
- };
546
- }
547
-
548
- /**
549
- SubscribeInvoices returns a uni-directional stream (server -> client) for
550
- notifying the client of newly added/settled invoices. The caller can
551
- optionally specify the add_index and/or the settle_index. If the add_index
552
- is specified, then we'll first start by sending add invoice events for all
553
- invoices with an add_index greater than the specified value. If the
554
- settle_index is specified, the next, we'll send out all settle events for
555
- invoices with a settle_index greater than the specified value. One or both
556
- of these fields can be set. If no fields are set, then we'll only send out
557
- the latest add/settle events.
558
- */
559
- rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) {
560
- option (google.api.http) = {
561
- get: "/v1/invoices/subscribe"
562
- };
563
- }
564
-
565
- /** lncli: `decodepayreq`
566
- DecodePayReq takes an encoded payment request string and attempts to decode
567
- it, returning a full description of the conditions encoded within the
568
- payment request.
569
- */
570
- rpc DecodePayReq (PayReqString) returns (PayReq) {
571
- option (google.api.http) = {
572
- get: "/v1/payreq/{pay_req}"
573
- };
574
- }
575
-
576
- /** lncli: `listpayments`
577
- ListPayments returns a list of all outgoing payments.
578
- */
579
- rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) {
580
- option (google.api.http) = {
581
- get: "/v1/payments"
582
- };
583
- };
584
-
585
- /**
586
- DeleteAllPayments deletes all outgoing payments from DB.
587
- */
588
- rpc DeleteAllPayments (DeleteAllPaymentsRequest) returns (DeleteAllPaymentsResponse) {
589
- option (google.api.http) = {
590
- delete: "/v1/payments"
591
- };
592
- };
593
-
594
- /** lncli: `describegraph`
595
- DescribeGraph returns a description of the latest graph state from the
596
- point of view of the node. The graph information is partitioned into two
597
- components: all the nodes/vertexes, and all the edges that connect the
598
- vertexes themselves. As this is a directed graph, the edges also contain
599
- the node directional specific routing policy which includes: the time lock
600
- delta, fee information, etc.
601
- */
602
- rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) {
603
- option (google.api.http) = {
604
- get: "/v1/graph"
605
- };
606
- }
607
-
608
- /** lncli: `getchaninfo`
609
- GetChanInfo returns the latest authenticated network announcement for the
610
- given channel identified by its channel ID: an 8-byte integer which
611
- uniquely identifies the location of transaction's funding output within the
612
- blockchain.
613
- */
614
- rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) {
615
- option (google.api.http) = {
616
- get: "/v1/graph/edge/{chan_id}"
617
- };
618
- }
619
-
620
- /** lncli: `getnodeinfo`
621
- GetNodeInfo returns the latest advertised, aggregated, and authenticated
622
- channel information for the specified node identified by its public key.
623
- */
624
- rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) {
625
- option (google.api.http) = {
626
- get: "/v1/graph/node/{pub_key}"
627
- };
628
- }
629
-
630
- /** lncli: `queryroutes`
631
- QueryRoutes attempts to query the daemon's Channel Router for a possible
632
- route to a target destination capable of carrying a specific amount of
633
- satoshis. The returned route contains the full details required to craft and
634
- send an HTLC, also including the necessary information that should be
635
- present within the Sphinx packet encapsulated within the HTLC.
636
- */
637
- rpc QueryRoutes(QueryRoutesRequest) returns (QueryRoutesResponse) {
638
- option (google.api.http) = {
639
- get: "/v1/graph/routes/{pub_key}/{amt}"
640
- };
641
- }
642
-
643
- /** lncli: `getnetworkinfo`
644
- GetNetworkInfo returns some basic stats about the known channel graph from
645
- the point of view of the node.
646
- */
647
- rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) {
648
- option (google.api.http) = {
649
- get: "/v1/graph/info"
650
- };
651
- }
652
-
653
- /** lncli: `stop`
654
- StopDaemon will send a shutdown request to the interrupt handler, triggering
655
- a graceful shutdown of the daemon.
656
- */
657
- rpc StopDaemon(StopRequest) returns (StopResponse);
658
-
659
- /**
660
- SubscribeChannelGraph launches a streaming RPC that allows the caller to
661
- receive notifications upon any changes to the channel graph topology from
662
- the point of view of the responding node. Events notified include: new
663
- nodes coming online, nodes updating their authenticated attributes, new
664
- channels being advertised, updates in the routing policy for a directional
665
- channel edge, and when channels are closed on-chain.
666
- */
667
- rpc SubscribeChannelGraph(GraphTopologySubscription) returns (stream GraphTopologyUpdate);
668
-
669
- /** lncli: `debuglevel`
670
- DebugLevel allows a caller to programmatically set the logging verbosity of
671
- lnd. The logging can be targeted according to a coarse daemon-wide logging
672
- level, or in a granular fashion to specify the logging for a target
673
- sub-system.
674
- */
675
- rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse);
676
-
677
- /** lncli: `feereport`
678
- FeeReport allows the caller to obtain a report detailing the current fee
679
- schedule enforced by the node globally for each channel.
680
- */
681
- rpc FeeReport(FeeReportRequest) returns (FeeReportResponse) {
682
- option (google.api.http) = {
683
- get: "/v1/fees"
684
- };
685
- }
686
-
687
- /** lncli: `updatechanpolicy`
688
- UpdateChannelPolicy allows the caller to update the fee schedule and
689
- channel policies for all channels globally, or a particular channel.
690
- */
691
- rpc UpdateChannelPolicy(PolicyUpdateRequest) returns (PolicyUpdateResponse) {
692
- option (google.api.http) = {
693
- post: "/v1/chanpolicy"
694
- body: "*"
695
- };
696
- }
697
-
698
- /** lncli: `fwdinghistory`
699
- ForwardingHistory allows the caller to query the htlcswitch for a record of
700
- all HTLCs forwarded within the target time range, and integer offset
701
- within that time range. If no time-range is specified, then the first chunk
702
- of the past 24 hrs of forwarding history are returned.
703
-
704
- A list of forwarding events are returned. The size of each forwarding event
705
- is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
706
- As a result each message can only contain 50k entries. Each response has
707
- the index offset of the last entry. The index offset can be provided to the
708
- request to allow the caller to skip a series of records.
709
- */
710
- rpc ForwardingHistory(ForwardingHistoryRequest) returns (ForwardingHistoryResponse) {
711
- option (google.api.http) = {
712
- post: "/v1/switch"
713
- body: "*"
714
- };
715
- };
716
-
717
- /** lncli: `exportchanbackup`
718
- ExportChannelBackup attempts to return an encrypted static channel backup
719
- for the target channel identified by it channel point. The backup is
720
- encrypted with a key generated from the aezeed seed of the user. The
721
- returned backup can either be restored using the RestoreChannelBackup
722
- method once lnd is running, or via the InitWallet and UnlockWallet methods
723
- from the WalletUnlocker service.
724
- */
725
- rpc ExportChannelBackup(ExportChannelBackupRequest) returns (ChannelBackup) {
726
- option (google.api.http) = {
727
- get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}"
728
- };
729
- };
730
-
731
- /**
732
- ExportAllChannelBackups returns static channel backups for all existing
733
- channels known to lnd. A set of regular singular static channel backups for
734
- each channel are returned. Additionally, a multi-channel backup is returned
735
- as well, which contains a single encrypted blob containing the backups of
736
- each channel.
737
- */
738
- rpc ExportAllChannelBackups(ChanBackupExportRequest) returns (ChanBackupSnapshot) {
739
- option (google.api.http) = {
740
- get: "/v1/channels/backup"
741
- };
742
- };
743
-
744
- /**
745
- VerifyChanBackup allows a caller to verify the integrity of a channel backup
746
- snapshot. This method will accept either a packed Single or a packed Multi.
747
- Specifying both will result in an error.
748
- */
749
- rpc VerifyChanBackup(ChanBackupSnapshot) returns (VerifyChanBackupResponse) {
750
- option (google.api.http) = {
751
- post: "/v1/channels/backup/verify"
752
- body: "*"
753
- };
754
- };
755
-
756
- /** lncli: `restorechanbackup`
757
- RestoreChannelBackups accepts a set of singular channel backups, or a
758
- single encrypted multi-chan backup and attempts to recover any funds
759
- remaining within the channel. If we are able to unpack the backup, then the
760
- new channel will be shown under listchannels, as well as pending channels.
761
- */
762
- rpc RestoreChannelBackups(RestoreChanBackupRequest) returns (RestoreBackupResponse) {
763
- option (google.api.http) = {
764
- post: "/v1/channels/backup/restore"
765
- body: "*"
766
- };
767
- };
768
-
769
- /**
770
- SubscribeChannelBackups allows a client to sub-subscribe to the most up to
771
- date information concerning the state of all channel backups. Each time a
772
- new channel is added, we return the new set of channels, along with a
773
- multi-chan backup containing the backup info for all channels. Each time a
774
- channel is closed, we send a new update, which contains new new chan back
775
- ups, but the updated set of encrypted multi-chan backups with the closed
776
- channel(s) removed.
777
- */
778
- rpc SubscribeChannelBackups(ChannelBackupSubscription) returns (stream ChanBackupSnapshot) {
779
- };
780
- }
781
-
782
- message Utxo {
783
- /// The type of address
784
- AddressType type = 1 [json_name = "address_type"];
785
-
786
- /// The address
787
- string address = 2 [json_name = "address"];
788
-
789
- /// The value of the unspent coin in satoshis
790
- int64 amount_sat = 3 [json_name = "amount_sat"];
791
-
792
- /// The pkscript in hex
793
- string pk_script = 4 [json_name = "pk_script"];
794
-
795
- /// The outpoint in format txid:n
796
- OutPoint outpoint = 5 [json_name = "outpoint"];
797
-
798
- /// The number of confirmations for the Utxo
799
- int64 confirmations = 6 [json_name = "confirmations"];
800
- }
801
-
802
- message Transaction {
803
- /// The transaction hash
804
- string tx_hash = 1 [ json_name = "tx_hash" ];
805
-
806
- /// The transaction amount, denominated in satoshis
807
- int64 amount = 2 [ json_name = "amount" ];
808
-
809
- /// The number of confirmations
810
- int32 num_confirmations = 3 [ json_name = "num_confirmations" ];
811
-
812
- /// The hash of the block this transaction was included in
813
- string block_hash = 4 [ json_name = "block_hash" ];
814
-
815
- /// The height of the block this transaction was included in
816
- int32 block_height = 5 [ json_name = "block_height" ];
817
-
818
- /// Timestamp of this transaction
819
- int64 time_stamp = 6 [ json_name = "time_stamp" ];
820
-
821
- /// Fees paid for this transaction
822
- int64 total_fees = 7 [ json_name = "total_fees" ];
823
-
824
- /// Addresses that received funds for this transaction
825
- repeated string dest_addresses = 8 [ json_name = "dest_addresses" ];
826
-
827
- /// The raw transaction hex.
828
- string raw_tx_hex = 9 [ json_name = "raw_tx_hex" ];
829
- }
830
- message GetTransactionsRequest {
831
- }
832
- message TransactionDetails {
833
- /// The list of transactions relevant to the wallet.
834
- repeated Transaction transactions = 1 [json_name = "transactions"];
835
- }
836
-
837
- message FeeLimit {
838
- oneof limit {
839
- /// The fee limit expressed as a fixed amount of satoshis.
840
- int64 fixed = 1;
841
-
842
- /// The fee limit expressed as a percentage of the payment amount.
843
- int64 percent = 2;
844
- }
845
- }
846
-
847
- message SendRequest {
848
- /// The identity pubkey of the payment recipient
849
- bytes dest = 1;
850
-
851
- /// The hex-encoded identity pubkey of the payment recipient
852
- string dest_string = 2;
853
-
854
- /// Number of satoshis to send.
855
- int64 amt = 3;
856
-
857
- /// The hash to use within the payment's HTLC
858
- bytes payment_hash = 4;
859
-
860
- /// The hex-encoded hash to use within the payment's HTLC
861
- string payment_hash_string = 5;
862
-
863
- /**
864
- A bare-bones invoice for a payment within the Lightning Network. With the
865
- details of the invoice, the sender has all the data necessary to send a
866
- payment to the recipient.
867
- */
868
- string payment_request = 6;
869
-
870
- /**
871
- The CLTV delta from the current height that should be used to set the
872
- timelock for the final hop.
873
- */
874
- int32 final_cltv_delta = 7;
875
-
876
- /**
877
- The maximum number of satoshis that will be paid as a fee of the payment.
878
- This value can be represented either as a percentage of the amount being
879
- sent, or as a fixed amount of the maximum fee the user is willing the pay to
880
- send the payment.
881
- */
882
- FeeLimit fee_limit = 8;
883
-
884
- /**
885
- The channel id of the channel that must be taken to the first hop. If zero,
886
- any channel may be used.
887
- */
888
- uint64 outgoing_chan_id = 9;
889
-
890
- /**
891
- An optional maximum total time lock for the route. This should not exceed
892
- lnd's `--max-cltv-expiry` setting. If zero, then the value of
893
- `--max-cltv-expiry` is enforced.
894
- */
895
- uint32 cltv_limit = 10;
896
-
897
- /**
898
- An optional field that can be used to pass an arbitrary set of TLV records
899
- to a peer which understands the new records. This can be used to pass
900
- application specific data during the payment attempt.
901
- */
902
- map<uint64, bytes> dest_tlv = 11;
903
- }
904
-
905
- message SendResponse {
906
- string payment_error = 1 [json_name = "payment_error"];
907
- bytes payment_preimage = 2 [json_name = "payment_preimage"];
908
- Route payment_route = 3 [json_name = "payment_route"];
909
- bytes payment_hash = 4 [json_name = "payment_hash"];
910
- }
911
-
912
- message SendToRouteRequest {
913
- /// The payment hash to use for the HTLC.
914
- bytes payment_hash = 1;
915
-
916
- /// An optional hex-encoded payment hash to be used for the HTLC.
917
- string payment_hash_string = 2;
918
-
919
- reserved 3;
920
-
921
- /// Route that should be used to attempt to complete the payment.
922
- Route route = 4;
923
- }
924
-
925
- message ChannelAcceptRequest {
926
- /// The pubkey of the node that wishes to open an inbound channel.
927
- bytes node_pubkey = 1;
928
-
929
- /// The hash of the genesis block that the proposed channel resides in.
930
- bytes chain_hash = 2;
931
-
932
- /// The pending channel id.
933
- bytes pending_chan_id = 3;
934
-
935
- /// The funding amount in satoshis that initiator wishes to use in the channel.
936
- uint64 funding_amt = 4;
937
-
938
- /// The push amount of the proposed channel in millisatoshis.
939
- uint64 push_amt = 5;
940
-
941
- /// The dust limit of the initiator's commitment tx.
942
- uint64 dust_limit = 6;
943
-
944
- /// The maximum amount of coins in millisatoshis that can be pending in this channel.
945
- uint64 max_value_in_flight = 7;
946
-
947
- /// The minimum amount of satoshis the initiator requires us to have at all times.
948
- uint64 channel_reserve = 8;
949
-
950
- /// The smallest HTLC in millisatoshis that the initiator will accept.
951
- uint64 min_htlc = 9;
952
-
953
- /// The initial fee rate that the initiator suggests for both commitment transactions.
954
- uint64 fee_per_kw = 10;
955
-
956
- /**
957
- The number of blocks to use for the relative time lock in the pay-to-self output
958
- of both commitment transactions.
959
- */
960
- uint32 csv_delay = 11;
961
-
962
- /// The total number of incoming HTLC's that the initiator will accept.
963
- uint32 max_accepted_htlcs = 12;
964
-
965
- /// A bit-field which the initiator uses to specify proposed channel behavior.
966
- uint32 channel_flags = 13;
967
- }
968
-
969
- message ChannelAcceptResponse {
970
- /// Whether or not the client accepts the channel.
971
- bool accept = 1;
972
-
973
- /// The pending channel id to which this response applies.
974
- bytes pending_chan_id = 2;
975
- }
976
-
977
- message ChannelPoint {
978
- oneof funding_txid {
979
- /// Txid of the funding transaction
980
- bytes funding_txid_bytes = 1 [json_name = "funding_txid_bytes"];
981
-
982
- /// Hex-encoded string representing the funding transaction
983
- string funding_txid_str = 2 [json_name = "funding_txid_str"];
984
- }
985
-
986
- /// The index of the output of the funding transaction
987
- uint32 output_index = 3 [json_name = "output_index"];
988
- }
989
-
990
- message OutPoint {
991
- /// Raw bytes representing the transaction id.
992
- bytes txid_bytes = 1 [json_name = "txid_bytes"];
993
-
994
- /// Reversed, hex-encoded string representing the transaction id.
995
- string txid_str = 2 [json_name = "txid_str"];
996
-
997
- /// The index of the output on the transaction.
998
- uint32 output_index = 3 [json_name = "output_index"];
999
- }
1000
-
1001
- message LightningAddress {
1002
- /// The identity pubkey of the Lightning node
1003
- string pubkey = 1 [json_name = "pubkey"];
1004
-
1005
- /// The network location of the lightning node, e.g. `69.69.69.69:1337` or `localhost:10011`
1006
- string host = 2 [json_name = "host"];
1007
- }
1008
-
1009
- message EstimateFeeRequest {
1010
- /// The map from addresses to amounts for the transaction.
1011
- map<string, int64> AddrToAmount = 1;
1012
-
1013
- /// The target number of blocks that this transaction should be confirmed by.
1014
- int32 target_conf = 2;
1015
- }
1016
-
1017
- message EstimateFeeResponse {
1018
- /// The total fee in satoshis.
1019
- int64 fee_sat = 1 [json_name = "fee_sat"];
1020
-
1021
- /// The fee rate in satoshi/byte.
1022
- int64 feerate_sat_per_byte = 2 [json_name = "feerate_sat_per_byte"];
1023
- }
1024
-
1025
- message SendManyRequest {
1026
- /// The map from addresses to amounts
1027
- map<string, int64> AddrToAmount = 1;
1028
-
1029
- /// The target number of blocks that this transaction should be confirmed by.
1030
- int32 target_conf = 3;
1031
-
1032
- /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
1033
- int64 sat_per_byte = 5;
1034
- }
1035
- message SendManyResponse {
1036
- /// The id of the transaction
1037
- string txid = 1 [json_name = "txid"];
1038
- }
1039
-
1040
- message SendCoinsRequest {
1041
- /// The address to send coins to
1042
- string addr = 1;
1043
-
1044
- /// The amount in satoshis to send
1045
- int64 amount = 2;
1046
-
1047
- /// The target number of blocks that this transaction should be confirmed by.
1048
- int32 target_conf = 3;
1049
-
1050
- /// A manual fee rate set in sat/byte that should be used when crafting the transaction.
1051
- int64 sat_per_byte = 5;
1052
-
1053
- /**
1054
- If set, then the amount field will be ignored, and lnd will attempt to
1055
- send all the coins under control of the internal wallet to the specified
1056
- address.
1057
- */
1058
- bool send_all = 6;
1059
- }
1060
- message SendCoinsResponse {
1061
- /// The transaction ID of the transaction
1062
- string txid = 1 [json_name = "txid"];
1063
- }
1064
-
1065
- message ListUnspentRequest {
1066
- /// The minimum number of confirmations to be included.
1067
- int32 min_confs = 1;
1068
-
1069
- /// The maximum number of confirmations to be included.
1070
- int32 max_confs = 2;
1071
- }
1072
- message ListUnspentResponse {
1073
- /// A list of utxos
1074
- repeated Utxo utxos = 1 [json_name = "utxos"];
1075
- }
1076
-
1077
- /**
1078
- `AddressType` has to be one of:
1079
-
1080
- - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0)
1081
- - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1)
1082
- */
1083
- enum AddressType {
1084
- WITNESS_PUBKEY_HASH = 0;
1085
- NESTED_PUBKEY_HASH = 1;
1086
- UNUSED_WITNESS_PUBKEY_HASH = 2;
1087
- UNUSED_NESTED_PUBKEY_HASH = 3;
1088
- }
1089
-
1090
- message NewAddressRequest {
1091
- /// The address type
1092
- AddressType type = 1;
1093
- }
1094
- message NewAddressResponse {
1095
- /// The newly generated wallet address
1096
- string address = 1 [json_name = "address"];
1097
- }
1098
-
1099
- message SignMessageRequest {
1100
- /// The message to be signed
1101
- bytes msg = 1 [ json_name = "msg" ];
1102
- }
1103
- message SignMessageResponse {
1104
- /// The signature for the given message
1105
- string signature = 1 [ json_name = "signature" ];
1106
- }
1107
-
1108
- message VerifyMessageRequest {
1109
- /// The message over which the signature is to be verified
1110
- bytes msg = 1 [ json_name = "msg" ];
1111
-
1112
- /// The signature to be verified over the given message
1113
- string signature = 2 [ json_name = "signature" ];
1114
- }
1115
- message VerifyMessageResponse {
1116
- /// Whether the signature was valid over the given message
1117
- bool valid = 1 [ json_name = "valid" ];
1118
-
1119
- /// The pubkey recovered from the signature
1120
- string pubkey = 2 [ json_name = "pubkey" ];
1121
- }
1122
-
1123
- message ConnectPeerRequest {
1124
- /// Lightning address of the peer, in the format `<pubkey>@host`
1125
- LightningAddress addr = 1;
1126
-
1127
- /** If set, the daemon will attempt to persistently connect to the target
1128
- * peer. Otherwise, the call will be synchronous. */
1129
- bool perm = 2;
1130
- }
1131
- message ConnectPeerResponse {
1132
- }
1133
-
1134
- message DisconnectPeerRequest {
1135
- /// The pubkey of the node to disconnect from
1136
- string pub_key = 1 [json_name = "pub_key"];
1137
- }
1138
- message DisconnectPeerResponse {
1139
- }
1140
-
1141
- message HTLC {
1142
- bool incoming = 1 [json_name = "incoming"];
1143
- int64 amount = 2 [json_name = "amount"];
1144
- bytes hash_lock = 3 [json_name = "hash_lock"];
1145
- uint32 expiration_height = 4 [json_name = "expiration_height"];
1146
- }
1147
-
1148
- message Channel {
1149
- /// Whether this channel is active or not
1150
- bool active = 1 [json_name = "active"];
1151
-
1152
- /// The identity pubkey of the remote node
1153
- string remote_pubkey = 2 [json_name = "remote_pubkey"];
1154
-
1155
- /**
1156
- The outpoint (txid:index) of the funding transaction. With this value, Bob
1157
- will be able to generate a signature for Alice's version of the commitment
1158
- transaction.
1159
- */
1160
- string channel_point = 3 [json_name = "channel_point"];
1161
-
1162
- /**
1163
- The unique channel ID for the channel. The first 3 bytes are the block
1164
- height, the next 3 the index within the block, and the last 2 bytes are the
1165
- output index for the channel.
1166
- */
1167
- uint64 chan_id = 4 [json_name = "chan_id"];
1168
-
1169
- /// The total amount of funds held in this channel
1170
- int64 capacity = 5 [json_name = "capacity"];
1171
-
1172
- /// This node's current balance in this channel
1173
- int64 local_balance = 6 [json_name = "local_balance"];
1174
-
1175
- /// The counterparty's current balance in this channel
1176
- int64 remote_balance = 7 [json_name = "remote_balance"];
1177
-
1178
- /**
1179
- The amount calculated to be paid in fees for the current set of commitment
1180
- transactions. The fee amount is persisted with the channel in order to
1181
- allow the fee amount to be removed and recalculated with each channel state
1182
- update, including updates that happen after a system restart.
1183
- */
1184
- int64 commit_fee = 8 [json_name = "commit_fee"];
1185
-
1186
- /// The weight of the commitment transaction
1187
- int64 commit_weight = 9 [json_name = "commit_weight"];
1188
-
1189
- /**
1190
- The required number of satoshis per kilo-weight that the requester will pay
1191
- at all times, for both the funding transaction and commitment transaction.
1192
- This value can later be updated once the channel is open.
1193
- */
1194
- int64 fee_per_kw = 10 [json_name = "fee_per_kw"];
1195
-
1196
- /// The unsettled balance in this channel
1197
- int64 unsettled_balance = 11 [json_name = "unsettled_balance"];
1198
-
1199
- /**
1200
- The total number of satoshis we've sent within this channel.
1201
- */
1202
- int64 total_satoshis_sent = 12 [json_name = "total_satoshis_sent"];
1203
-
1204
- /**
1205
- The total number of satoshis we've received within this channel.
1206
- */
1207
- int64 total_satoshis_received = 13 [json_name = "total_satoshis_received"];
1208
-
1209
- /**
1210
- The total number of updates conducted within this channel.
1211
- */
1212
- uint64 num_updates = 14 [json_name = "num_updates"];
1213
-
1214
- /**
1215
- The list of active, uncleared HTLCs currently pending within the channel.
1216
- */
1217
- repeated HTLC pending_htlcs = 15 [json_name = "pending_htlcs"];
1218
-
1219
- /**
1220
- The CSV delay expressed in relative blocks. If the channel is force closed,
1221
- we will need to wait for this many blocks before we can regain our funds.
1222
- */
1223
- uint32 csv_delay = 16 [json_name = "csv_delay"];
1224
-
1225
- /// Whether this channel is advertised to the network or not.
1226
- bool private = 17 [json_name = "private"];
1227
-
1228
- /// True if we were the ones that created the channel.
1229
- bool initiator = 18 [json_name = "initiator"];
1230
-
1231
- /// A set of flags showing the current state of the channel.
1232
- string chan_status_flags = 19 [json_name = "chan_status_flags"];
1233
-
1234
- /// The minimum satoshis this node is required to reserve in its balance.
1235
- int64 local_chan_reserve_sat = 20 [json_name = "local_chan_reserve_sat"];
1236
-
1237
- /**
1238
- The minimum satoshis the other node is required to reserve in its balance.
1239
- */
1240
- int64 remote_chan_reserve_sat = 21 [json_name = "remote_chan_reserve_sat"];
1241
-
1242
- /**
1243
- If true, then this channel uses the modern commitment format where the key
1244
- in the output of the remote party does not change each state. This makes
1245
- back up and recovery easier as when the channel is closed, the funds go
1246
- directly to that key.
1247
- */
1248
- bool static_remote_key = 22 [json_name = "static_remote_key"];
1249
- }
1250
-
1251
-
1252
- message ListChannelsRequest {
1253
- bool active_only = 1;
1254
- bool inactive_only = 2;
1255
- bool public_only = 3;
1256
- bool private_only = 4;
1257
- }
1258
- message ListChannelsResponse {
1259
- /// The list of active channels
1260
- repeated Channel channels = 11 [json_name = "channels"];
1261
- }
1262
-
1263
- message ChannelCloseSummary {
1264
- /// The outpoint (txid:index) of the funding transaction.
1265
- string channel_point = 1 [json_name = "channel_point"];
1266
-
1267
- /// The unique channel ID for the channel.
1268
- uint64 chan_id = 2 [json_name = "chan_id"];
1269
-
1270
- /// The hash of the genesis block that this channel resides within.
1271
- string chain_hash = 3 [json_name = "chain_hash"];
1272
-
1273
- /// The txid of the transaction which ultimately closed this channel.
1274
- string closing_tx_hash = 4 [json_name = "closing_tx_hash"];
1275
-
1276
- /// Public key of the remote peer that we formerly had a channel with.
1277
- string remote_pubkey = 5 [json_name = "remote_pubkey"];
1278
-
1279
- /// Total capacity of the channel.
1280
- int64 capacity = 6 [json_name = "capacity"];
1281
-
1282
- /// Height at which the funding transaction was spent.
1283
- uint32 close_height = 7 [json_name = "close_height"];
1284
-
1285
- /// Settled balance at the time of channel closure
1286
- int64 settled_balance = 8 [json_name = "settled_balance"];
1287
-
1288
- /// The sum of all the time-locked outputs at the time of channel closure
1289
- int64 time_locked_balance = 9 [json_name = "time_locked_balance"];
1290
-
1291
- enum ClosureType {
1292
- COOPERATIVE_CLOSE = 0;
1293
- LOCAL_FORCE_CLOSE = 1;
1294
- REMOTE_FORCE_CLOSE = 2;
1295
- BREACH_CLOSE = 3;
1296
- FUNDING_CANCELED = 4;
1297
- ABANDONED = 5;
1298
- }
1299
-
1300
- /// Details on how the channel was closed.
1301
- ClosureType close_type = 10 [json_name = "close_type"];
1302
- }
1303
-
1304
- message ClosedChannelsRequest {
1305
- bool cooperative = 1;
1306
- bool local_force = 2;
1307
- bool remote_force = 3;
1308
- bool breach = 4;
1309
- bool funding_canceled = 5;
1310
- bool abandoned = 6;
1311
- }
1312
-
1313
- message ClosedChannelsResponse {
1314
- repeated ChannelCloseSummary channels = 1 [json_name = "channels"];
1315
- }
1316
-
1317
- message Peer {
1318
- /// The identity pubkey of the peer
1319
- string pub_key = 1 [json_name = "pub_key"];
1320
-
1321
- /// Network address of the peer; eg `127.0.0.1:10011`
1322
- string address = 3 [json_name = "address"];
1323
-
1324
- /// Bytes of data transmitted to this peer
1325
- uint64 bytes_sent = 4 [json_name = "bytes_sent"];
1326
-
1327
- /// Bytes of data transmitted from this peer
1328
- uint64 bytes_recv = 5 [json_name = "bytes_recv"];
1329
-
1330
- /// Satoshis sent to this peer
1331
- int64 sat_sent = 6 [json_name = "sat_sent"];
1332
-
1333
- /// Satoshis received from this peer
1334
- int64 sat_recv = 7 [json_name = "sat_recv"];
1335
-
1336
- /// A channel is inbound if the counterparty initiated the channel
1337
- bool inbound = 8 [json_name = "inbound"];
1338
-
1339
- /// Ping time to this peer
1340
- int64 ping_time = 9 [json_name = "ping_time"];
1341
-
1342
- enum SyncType {
1343
- /**
1344
- Denotes that we cannot determine the peer's current sync type.
1345
- */
1346
- UNKNOWN_SYNC = 0;
1347
-
1348
- /**
1349
- Denotes that we are actively receiving new graph updates from the peer.
1350
- */
1351
- ACTIVE_SYNC = 1;
1352
-
1353
- /**
1354
- Denotes that we are not receiving new graph updates from the peer.
1355
- */
1356
- PASSIVE_SYNC = 2;
1357
- }
1358
-
1359
- // The type of sync we are currently performing with this peer.
1360
- SyncType sync_type = 10 [json_name = "sync_type"];
1361
- }
1362
-
1363
- message ListPeersRequest {
1364
- }
1365
- message ListPeersResponse {
1366
- /// The list of currently connected peers
1367
- repeated Peer peers = 1 [json_name = "peers"];
1368
- }
1369
-
1370
- message GetInfoRequest {
1371
- }
1372
- message GetInfoResponse {
1373
-
1374
- /// The identity pubkey of the current node.
1375
- string identity_pubkey = 1 [json_name = "identity_pubkey"];
1376
-
1377
- /// If applicable, the alias of the current node, e.g. "bob"
1378
- string alias = 2 [json_name = "alias"];
1379
-
1380
- /// Number of pending channels
1381
- uint32 num_pending_channels = 3 [json_name = "num_pending_channels"];
1382
-
1383
- /// Number of active channels
1384
- uint32 num_active_channels = 4 [json_name = "num_active_channels"];
1385
-
1386
- /// Number of peers
1387
- uint32 num_peers = 5 [json_name = "num_peers"];
1388
-
1389
- /// The node's current view of the height of the best block
1390
- uint32 block_height = 6 [json_name = "block_height"];
1391
-
1392
- /// The node's current view of the hash of the best block
1393
- string block_hash = 8 [json_name = "block_hash"];
1394
-
1395
- /// Whether the wallet's view is synced to the main chain
1396
- bool synced_to_chain = 9 [json_name = "synced_to_chain"];
1397
-
1398
- /**
1399
- Whether the current node is connected to testnet. This field is
1400
- deprecated and the network field should be used instead
1401
- **/
1402
- bool testnet = 10 [json_name = "testnet", deprecated = true];
1403
-
1404
- reserved 11;
1405
-
1406
- /// The URIs of the current node.
1407
- repeated string uris = 12 [json_name = "uris"];
1408
-
1409
- /// Timestamp of the block best known to the wallet
1410
- int64 best_header_timestamp = 13 [ json_name = "best_header_timestamp" ];
1411
-
1412
- /// The version of the LND software that the node is running.
1413
- string version = 14 [ json_name = "version" ];
1414
-
1415
- /// Number of inactive channels
1416
- uint32 num_inactive_channels = 15 [json_name = "num_inactive_channels"];
1417
-
1418
- /// A list of active chains the node is connected to
1419
- repeated Chain chains = 16 [json_name = "chains"];
1420
-
1421
- /// The color of the current node in hex code format
1422
- string color = 17 [json_name = "color"];
1423
-
1424
- // Whether we consider ourselves synced with the public channel graph.
1425
- bool synced_to_graph = 18 [json_name = "synced_to_graph"];
1426
- }
1427
-
1428
- message Chain {
1429
- /// The blockchain the node is on (eg bitcoin, litecoin)
1430
- string chain = 1 [json_name = "chain"];
1431
-
1432
- /// The network the node is on (eg regtest, testnet, mainnet)
1433
- string network = 2 [json_name = "network"];
1434
- }
1435
-
1436
- message ConfirmationUpdate {
1437
- bytes block_sha = 1;
1438
- int32 block_height = 2;
1439
-
1440
- uint32 num_confs_left = 3;
1441
- }
1442
-
1443
- message ChannelOpenUpdate {
1444
- ChannelPoint channel_point = 1 [json_name = "channel_point"];
1445
- }
1446
-
1447
- message ChannelCloseUpdate {
1448
- bytes closing_txid = 1 [json_name = "closing_txid"];
1449
-
1450
- bool success = 2 [json_name = "success"];
1451
- }
1452
-
1453
- message CloseChannelRequest {
1454
- /**
1455
- The outpoint (txid:index) of the funding transaction. With this value, Bob
1456
- will be able to generate a signature for Alice's version of the commitment
1457
- transaction.
1458
- */
1459
- ChannelPoint channel_point = 1;
1460
-
1461
- /// If true, then the channel will be closed forcibly. This means the current commitment transaction will be signed and broadcast.
1462
- bool force = 2;
1463
-
1464
- /// The target number of blocks that the closure transaction should be confirmed by.
1465
- int32 target_conf = 3;
1466
-
1467
- /// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
1468
- int64 sat_per_byte = 4;
1469
- }
1470
-
1471
- message CloseStatusUpdate {
1472
- oneof update {
1473
- PendingUpdate close_pending = 1 [json_name = "close_pending"];
1474
- ChannelCloseUpdate chan_close = 3 [json_name = "chan_close"];
1475
- }
1476
- }
1477
-
1478
- message PendingUpdate {
1479
- bytes txid = 1 [json_name = "txid"];
1480
- uint32 output_index = 2 [json_name = "output_index"];
1481
- }
1482
-
1483
- message OpenChannelRequest {
1484
- /// The pubkey of the node to open a channel with
1485
- bytes node_pubkey = 2 [json_name = "node_pubkey"];
1486
-
1487
- /// The hex encoded pubkey of the node to open a channel with
1488
- string node_pubkey_string = 3 [json_name = "node_pubkey_string"];
1489
-
1490
- /// The number of satoshis the wallet should commit to the channel
1491
- int64 local_funding_amount = 4 [json_name = "local_funding_amount"];
1492
-
1493
- /// The number of satoshis to push to the remote side as part of the initial commitment state
1494
- int64 push_sat = 5 [json_name = "push_sat"];
1495
-
1496
- /// The target number of blocks that the funding transaction should be confirmed by.
1497
- int32 target_conf = 6;
1498
-
1499
- /// A manual fee rate set in sat/byte that should be used when crafting the funding transaction.
1500
- int64 sat_per_byte = 7;
1501
-
1502
- /// Whether this channel should be private, not announced to the greater network.
1503
- bool private = 8 [json_name = "private"];
1504
-
1505
- /// The minimum value in millisatoshi we will require for incoming HTLCs on the channel.
1506
- int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"];
1507
-
1508
- /// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size.
1509
- uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"];
1510
-
1511
- /// The minimum number of confirmations each one of your outputs used for the funding transaction must satisfy.
1512
- int32 min_confs = 11 [json_name = "min_confs"];
1513
-
1514
- /// Whether unconfirmed outputs should be used as inputs for the funding transaction.
1515
- bool spend_unconfirmed = 12 [json_name = "spend_unconfirmed"];
1516
- }
1517
- message OpenStatusUpdate {
1518
- oneof update {
1519
- PendingUpdate chan_pending = 1 [json_name = "chan_pending"];
1520
- ChannelOpenUpdate chan_open = 3 [json_name = "chan_open"];
1521
- }
1522
- }
1523
-
1524
- message PendingHTLC {
1525
-
1526
- /// The direction within the channel that the htlc was sent
1527
- bool incoming = 1 [ json_name = "incoming" ];
1528
-
1529
- /// The total value of the htlc
1530
- int64 amount = 2 [ json_name = "amount" ];
1531
-
1532
- /// The final output to be swept back to the user's wallet
1533
- string outpoint = 3 [ json_name = "outpoint" ];
1534
-
1535
- /// The next block height at which we can spend the current stage
1536
- uint32 maturity_height = 4 [ json_name = "maturity_height" ];
1537
-
1538
- /**
1539
- The number of blocks remaining until the current stage can be swept.
1540
- Negative values indicate how many blocks have passed since becoming
1541
- mature.
1542
- */
1543
- int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
1544
-
1545
- /// Indicates whether the htlc is in its first or second stage of recovery
1546
- uint32 stage = 6 [ json_name = "stage" ];
1547
- }
1548
-
1549
- message PendingChannelsRequest {}
1550
- message PendingChannelsResponse {
1551
- message PendingChannel {
1552
- string remote_node_pub = 1 [ json_name = "remote_node_pub" ];
1553
- string channel_point = 2 [ json_name = "channel_point" ];
1554
-
1555
- int64 capacity = 3 [ json_name = "capacity" ];
1556
-
1557
- int64 local_balance = 4 [ json_name = "local_balance" ];
1558
- int64 remote_balance = 5 [ json_name = "remote_balance" ];
1559
-
1560
- /// The minimum satoshis this node is required to reserve in its balance.
1561
- int64 local_chan_reserve_sat = 6 [json_name = "local_chan_reserve_sat"];
1562
-
1563
- /**
1564
- The minimum satoshis the other node is required to reserve in its
1565
- balance.
1566
- */
1567
- int64 remote_chan_reserve_sat = 7 [json_name = "remote_chan_reserve_sat"];
1568
- }
1569
-
1570
- message PendingOpenChannel {
1571
- /// The pending channel
1572
- PendingChannel channel = 1 [ json_name = "channel" ];
1573
-
1574
- /// The height at which this channel will be confirmed
1575
- uint32 confirmation_height = 2 [ json_name = "confirmation_height" ];
1576
-
1577
- /**
1578
- The amount calculated to be paid in fees for the current set of
1579
- commitment transactions. The fee amount is persisted with the channel
1580
- in order to allow the fee amount to be removed and recalculated with
1581
- each channel state update, including updates that happen after a system
1582
- restart.
1583
- */
1584
- int64 commit_fee = 4 [json_name = "commit_fee" ];
1585
-
1586
- /// The weight of the commitment transaction
1587
- int64 commit_weight = 5 [ json_name = "commit_weight" ];
1588
-
1589
- /**
1590
- The required number of satoshis per kilo-weight that the requester will
1591
- pay at all times, for both the funding transaction and commitment
1592
- transaction. This value can later be updated once the channel is open.
1593
- */
1594
- int64 fee_per_kw = 6 [ json_name = "fee_per_kw" ];
1595
- }
1596
-
1597
- message WaitingCloseChannel {
1598
- /// The pending channel waiting for closing tx to confirm
1599
- PendingChannel channel = 1;
1600
-
1601
- /// The balance in satoshis encumbered in this channel
1602
- int64 limbo_balance = 2 [ json_name = "limbo_balance" ];
1603
- }
1604
-
1605
- message ClosedChannel {
1606
- /// The pending channel to be closed
1607
- PendingChannel channel = 1;
1608
-
1609
- /// The transaction id of the closing transaction
1610
- string closing_txid = 2 [ json_name = "closing_txid" ];
1611
- }
1612
-
1613
- message ForceClosedChannel {
1614
- /// The pending channel to be force closed
1615
- PendingChannel channel = 1 [ json_name = "channel" ];
1616
-
1617
- /// The transaction id of the closing transaction
1618
- string closing_txid = 2 [ json_name = "closing_txid" ];
1619
-
1620
- /// The balance in satoshis encumbered in this pending channel
1621
- int64 limbo_balance = 3 [ json_name = "limbo_balance" ];
1622
-
1623
- /// The height at which funds can be swept into the wallet
1624
- uint32 maturity_height = 4 [ json_name = "maturity_height" ];
1625
-
1626
- /*
1627
- Remaining # of blocks until the commitment output can be swept.
1628
- Negative values indicate how many blocks have passed since becoming
1629
- mature.
1630
- */
1631
- int32 blocks_til_maturity = 5 [ json_name = "blocks_til_maturity" ];
1632
-
1633
- /// The total value of funds successfully recovered from this channel
1634
- int64 recovered_balance = 6 [ json_name = "recovered_balance" ];
1635
-
1636
- repeated PendingHTLC pending_htlcs = 8 [ json_name = "pending_htlcs" ];
1637
- }
1638
-
1639
- /// The balance in satoshis encumbered in pending channels
1640
- int64 total_limbo_balance = 1 [ json_name = "total_limbo_balance" ];
1641
-
1642
- /// Channels pending opening
1643
- repeated PendingOpenChannel pending_open_channels = 2 [ json_name = "pending_open_channels" ];
1644
-
1645
- /// Channels pending closing
1646
- repeated ClosedChannel pending_closing_channels = 3 [ json_name = "pending_closing_channels" ];
1647
-
1648
- /// Channels pending force closing
1649
- repeated ForceClosedChannel pending_force_closing_channels = 4 [ json_name = "pending_force_closing_channels" ];
1650
-
1651
- /// Channels waiting for closing tx to confirm
1652
- repeated WaitingCloseChannel waiting_close_channels = 5 [ json_name = "waiting_close_channels" ];
1653
- }
1654
-
1655
- message ChannelEventSubscription {
1656
- }
1657
-
1658
- message ChannelEventUpdate {
1659
- oneof channel {
1660
- Channel open_channel = 1 [ json_name = "open_channel" ];
1661
- ChannelCloseSummary closed_channel = 2 [ json_name = "closed_channel" ];
1662
- ChannelPoint active_channel = 3 [ json_name = "active_channel" ];
1663
- ChannelPoint inactive_channel = 4 [ json_name = "inactive_channel" ];
1664
- }
1665
-
1666
- enum UpdateType {
1667
- OPEN_CHANNEL = 0;
1668
- CLOSED_CHANNEL = 1;
1669
- ACTIVE_CHANNEL = 2;
1670
- INACTIVE_CHANNEL = 3;
1671
- }
1672
-
1673
- UpdateType type = 5 [ json_name = "type" ];
1674
- }
1675
-
1676
- message WalletBalanceRequest {
1677
- }
1678
- message WalletBalanceResponse {
1679
- /// The balance of the wallet
1680
- int64 total_balance = 1 [json_name = "total_balance"];
1681
-
1682
- /// The confirmed balance of a wallet(with >= 1 confirmations)
1683
- int64 confirmed_balance = 2 [json_name = "confirmed_balance"];
1684
-
1685
- /// The unconfirmed balance of a wallet(with 0 confirmations)
1686
- int64 unconfirmed_balance = 3 [json_name = "unconfirmed_balance"];
1687
- }
1688
-
1689
- message ChannelBalanceRequest {
1690
- }
1691
- message ChannelBalanceResponse {
1692
- /// Sum of channels balances denominated in satoshis
1693
- int64 balance = 1 [json_name = "balance"];
1694
-
1695
- /// Sum of channels pending balances denominated in satoshis
1696
- int64 pending_open_balance = 2 [json_name = "pending_open_balance"];
1697
- }
1698
-
1699
- message QueryRoutesRequest {
1700
- /// The 33-byte hex-encoded public key for the payment destination
1701
- string pub_key = 1;
1702
-
1703
- /// The amount to send expressed in satoshis
1704
- int64 amt = 2;
1705
-
1706
- reserved 3;
1707
-
1708
- /// An optional CLTV delta from the current height that should be used for the timelock of the final hop
1709
- int32 final_cltv_delta = 4;
1710
-
1711
- /**
1712
- The maximum number of satoshis that will be paid as a fee of the payment.
1713
- This value can be represented either as a percentage of the amount being
1714
- sent, or as a fixed amount of the maximum fee the user is willing the pay to
1715
- send the payment.
1716
- */
1717
- FeeLimit fee_limit = 5;
1718
-
1719
- /**
1720
- A list of nodes to ignore during path finding.
1721
- */
1722
- repeated bytes ignored_nodes = 6;
1723
-
1724
- /**
1725
- Deprecated. A list of edges to ignore during path finding.
1726
- */
1727
- repeated EdgeLocator ignored_edges = 7 [deprecated = true];
1728
-
1729
- /**
1730
- The source node where the request route should originated from. If empty,
1731
- self is assumed.
1732
- */
1733
- string source_pub_key = 8;
1734
-
1735
- /**
1736
- If set to true, edge probabilities from mission control will be used to get
1737
- the optimal route.
1738
- */
1739
- bool use_mission_control = 9;
1740
-
1741
- /**
1742
- A list of directed node pairs that will be ignored during path finding.
1743
- */
1744
- repeated NodePair ignored_pairs = 10;
1745
-
1746
- /**
1747
- An optional maximum total time lock for the route. If the source is empty or
1748
- ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If
1749
- zero, then the value of `--max-cltv-expiry` is used as the limit.
1750
- */
1751
- uint32 cltv_limit = 11;
1752
- }
1753
-
1754
- message NodePair {
1755
- /// The sending node of the pair.
1756
- bytes from = 1;
1757
-
1758
- /// The receiving node of the pair.
1759
- bytes to = 2;
1760
- }
1761
-
1762
- message EdgeLocator {
1763
- /// The short channel id of this edge.
1764
- uint64 channel_id = 1;
1765
-
1766
- /**
1767
- The direction of this edge. If direction_reverse is false, the direction
1768
- of this edge is from the channel endpoint with the lexicographically smaller
1769
- pub key to the endpoint with the larger pub key. If direction_reverse is
1770
- is true, the edge goes the other way.
1771
- */
1772
- bool direction_reverse = 2;
1773
- }
1774
-
1775
- message QueryRoutesResponse {
1776
- /**
1777
- The route that results from the path finding operation. This is still a
1778
- repeated field to retain backwards compatibility.
1779
- */
1780
- repeated Route routes = 1 [json_name = "routes"];
1781
-
1782
- /**
1783
- The success probability of the returned route based on the current mission
1784
- control state. [EXPERIMENTAL]
1785
- */
1786
- double success_prob = 2 [json_name = "success_prob"];
1787
- }
1788
-
1789
- message Hop {
1790
- /**
1791
- The unique channel ID for the channel. The first 3 bytes are the block
1792
- height, the next 3 the index within the block, and the last 2 bytes are the
1793
- output index for the channel.
1794
- */
1795
- uint64 chan_id = 1 [json_name = "chan_id"];
1796
- int64 chan_capacity = 2 [json_name = "chan_capacity"];
1797
- int64 amt_to_forward = 3 [json_name = "amt_to_forward", deprecated = true];
1798
- int64 fee = 4 [json_name = "fee", deprecated = true];
1799
- uint32 expiry = 5 [json_name = "expiry"];
1800
- int64 amt_to_forward_msat = 6 [json_name = "amt_to_forward_msat"];
1801
- int64 fee_msat = 7 [json_name = "fee_msat"];
1802
-
1803
- /**
1804
- An optional public key of the hop. If the public key is given, the payment
1805
- can be executed without relying on a copy of the channel graph.
1806
- */
1807
- string pub_key = 8 [json_name = "pub_key"];
1808
-
1809
- /**
1810
- If set to true, then this hop will be encoded using the new variable length
1811
- TLV format.
1812
- */
1813
- bool tlv_payload = 9 [json_name = "tlv_payload"];
1814
- }
1815
-
1816
- /**
1817
- A path through the channel graph which runs over one or more channels in
1818
- succession. This struct carries all the information required to craft the
1819
- Sphinx onion packet, and send the payment along the first hop in the path. A
1820
- route is only selected as valid if all the channels have sufficient capacity to
1821
- carry the initial payment amount after fees are accounted for.
1822
- */
1823
- message Route {
1824
-
1825
- /**
1826
- The cumulative (final) time lock across the entire route. This is the CLTV
1827
- value that should be extended to the first hop in the route. All other hops
1828
- will decrement the time-lock as advertised, leaving enough time for all
1829
- hops to wait for or present the payment preimage to complete the payment.
1830
- */
1831
- uint32 total_time_lock = 1 [json_name = "total_time_lock"];
1832
-
1833
- /**
1834
- The sum of the fees paid at each hop within the final route. In the case
1835
- of a one-hop payment, this value will be zero as we don't need to pay a fee
1836
- to ourselves.
1837
- */
1838
- int64 total_fees = 2 [json_name = "total_fees", deprecated = true];
1839
-
1840
- /**
1841
- The total amount of funds required to complete a payment over this route.
1842
- This value includes the cumulative fees at each hop. As a result, the HTLC
1843
- extended to the first-hop in the route will need to have at least this many
1844
- satoshis, otherwise the route will fail at an intermediate node due to an
1845
- insufficient amount of fees.
1846
- */
1847
- int64 total_amt = 3 [json_name = "total_amt", deprecated = true];
1848
-
1849
- /**
1850
- Contains details concerning the specific forwarding details at each hop.
1851
- */
1852
- repeated Hop hops = 4 [json_name = "hops"];
1853
-
1854
- /**
1855
- The total fees in millisatoshis.
1856
- */
1857
- int64 total_fees_msat = 5 [json_name = "total_fees_msat"];
1858
-
1859
- /**
1860
- The total amount in millisatoshis.
1861
- */
1862
- int64 total_amt_msat = 6 [json_name = "total_amt_msat"];
1863
- }
1864
-
1865
- message NodeInfoRequest {
1866
- /// The 33-byte hex-encoded compressed public of the target node
1867
- string pub_key = 1;
1868
-
1869
- /// If true, will include all known channels associated with the node.
1870
- bool include_channels = 2;
1871
- }
1872
-
1873
- message NodeInfo {
1874
-
1875
- /**
1876
- An individual vertex/node within the channel graph. A node is
1877
- connected to other nodes by one or more channel edges emanating from it. As
1878
- the graph is directed, a node will also have an incoming edge attached to
1879
- it for each outgoing edge.
1880
- */
1881
- LightningNode node = 1 [json_name = "node"];
1882
-
1883
- /// The total number of channels for the node.
1884
- uint32 num_channels = 2 [json_name = "num_channels"];
1885
-
1886
- /// The sum of all channels capacity for the node, denominated in satoshis.
1887
- int64 total_capacity = 3 [json_name = "total_capacity"];
1888
-
1889
- /// A list of all public channels for the node.
1890
- repeated ChannelEdge channels = 4 [json_name = "channels"];
1891
- }
1892
-
1893
- /**
1894
- An individual vertex/node within the channel graph. A node is
1895
- connected to other nodes by one or more channel edges emanating from it. As the
1896
- graph is directed, a node will also have an incoming edge attached to it for
1897
- each outgoing edge.
1898
- */
1899
- message LightningNode {
1900
- uint32 last_update = 1 [ json_name = "last_update" ];
1901
- string pub_key = 2 [ json_name = "pub_key" ];
1902
- string alias = 3 [ json_name = "alias" ];
1903
- repeated NodeAddress addresses = 4 [ json_name = "addresses" ];
1904
- string color = 5 [ json_name = "color" ];
1905
- }
1906
-
1907
- message NodeAddress {
1908
- string network = 1 [ json_name = "network" ];
1909
- string addr = 2 [ json_name = "addr" ];
1910
- }
1911
-
1912
- message RoutingPolicy {
1913
- uint32 time_lock_delta = 1 [json_name = "time_lock_delta"];
1914
- int64 min_htlc = 2 [json_name = "min_htlc"];
1915
- int64 fee_base_msat = 3 [json_name = "fee_base_msat"];
1916
- int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat"];
1917
- bool disabled = 5 [json_name = "disabled"];
1918
- uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"];
1919
- uint32 last_update = 7 [json_name = "last_update"];
1920
- }
1921
-
1922
- /**
1923
- A fully authenticated channel along with all its unique attributes.
1924
- Once an authenticated channel announcement has been processed on the network,
1925
- then an instance of ChannelEdgeInfo encapsulating the channels attributes is
1926
- stored. The other portions relevant to routing policy of a channel are stored
1927
- within a ChannelEdgePolicy for each direction of the channel.
1928
- */
1929
- message ChannelEdge {
1930
-
1931
- /**
1932
- The unique channel ID for the channel. The first 3 bytes are the block
1933
- height, the next 3 the index within the block, and the last 2 bytes are the
1934
- output index for the channel.
1935
- */
1936
- uint64 channel_id = 1 [json_name = "channel_id"];
1937
- string chan_point = 2 [json_name = "chan_point"];
1938
-
1939
- uint32 last_update = 3 [json_name = "last_update", deprecated = true];
1940
-
1941
- string node1_pub = 4 [json_name = "node1_pub"];
1942
- string node2_pub = 5 [json_name = "node2_pub"];
1943
-
1944
- int64 capacity = 6 [json_name = "capacity"];
1945
-
1946
- RoutingPolicy node1_policy = 7 [json_name = "node1_policy"];
1947
- RoutingPolicy node2_policy = 8 [json_name = "node2_policy"];
1948
- }
1949
-
1950
- message ChannelGraphRequest {
1951
- /**
1952
- Whether unannounced channels are included in the response or not. If set,
1953
- unannounced channels are included. Unannounced channels are both private
1954
- channels, and public channels that are not yet announced to the network.
1955
- */
1956
- bool include_unannounced = 1 [json_name = "include_unannounced"];
1957
- }
1958
-
1959
- /// Returns a new instance of the directed channel graph.
1960
- message ChannelGraph {
1961
- /// The list of `LightningNode`s in this channel graph
1962
- repeated LightningNode nodes = 1 [json_name = "nodes"];
1963
-
1964
- /// The list of `ChannelEdge`s in this channel graph
1965
- repeated ChannelEdge edges = 2 [json_name = "edges"];
1966
- }
1967
-
1968
- message ChanInfoRequest {
1969
- /**
1970
- The unique channel ID for the channel. The first 3 bytes are the block
1971
- height, the next 3 the index within the block, and the last 2 bytes are the
1972
- output index for the channel.
1973
- */
1974
- uint64 chan_id = 1;
1975
- }
1976
-
1977
- message NetworkInfoRequest {
1978
- }
1979
- message NetworkInfo {
1980
- uint32 graph_diameter = 1 [json_name = "graph_diameter"];
1981
- double avg_out_degree = 2 [json_name = "avg_out_degree"];
1982
- uint32 max_out_degree = 3 [json_name = "max_out_degree"];
1983
-
1984
- uint32 num_nodes = 4 [json_name = "num_nodes"];
1985
- uint32 num_channels = 5 [json_name = "num_channels"];
1986
-
1987
- int64 total_network_capacity = 6 [json_name = "total_network_capacity"];
1988
-
1989
- double avg_channel_size = 7 [json_name = "avg_channel_size"];
1990
- int64 min_channel_size = 8 [json_name = "min_channel_size"];
1991
- int64 max_channel_size = 9 [json_name = "max_channel_size"];
1992
- int64 median_channel_size_sat = 10 [json_name = "median_channel_size_sat"];
1993
-
1994
- // The number of edges marked as zombies.
1995
- uint64 num_zombie_chans = 11 [json_name = "num_zombie_chans"];
1996
-
1997
- // TODO(roasbeef): fee rate info, expiry
1998
- // * also additional RPC for tracking fee info once in
1999
- }
2000
-
2001
- message StopRequest{}
2002
- message StopResponse{}
2003
-
2004
- message GraphTopologySubscription {}
2005
- message GraphTopologyUpdate {
2006
- repeated NodeUpdate node_updates = 1;
2007
- repeated ChannelEdgeUpdate channel_updates = 2;
2008
- repeated ClosedChannelUpdate closed_chans = 3;
2009
- }
2010
- message NodeUpdate {
2011
- repeated string addresses = 1;
2012
- string identity_key = 2;
2013
- bytes global_features = 3;
2014
- string alias = 4;
2015
- string color = 5;
2016
- }
2017
- message ChannelEdgeUpdate {
2018
- /**
2019
- The unique channel ID for the channel. The first 3 bytes are the block
2020
- height, the next 3 the index within the block, and the last 2 bytes are the
2021
- output index for the channel.
2022
- */
2023
- uint64 chan_id = 1;
2024
-
2025
- ChannelPoint chan_point = 2;
2026
-
2027
- int64 capacity = 3;
2028
-
2029
- RoutingPolicy routing_policy = 4;
2030
-
2031
- string advertising_node = 5;
2032
- string connecting_node = 6;
2033
- }
2034
- message ClosedChannelUpdate {
2035
- /**
2036
- The unique channel ID for the channel. The first 3 bytes are the block
2037
- height, the next 3 the index within the block, and the last 2 bytes are the
2038
- output index for the channel.
2039
- */
2040
- uint64 chan_id = 1;
2041
- int64 capacity = 2;
2042
- uint32 closed_height = 3;
2043
- ChannelPoint chan_point = 4;
2044
- }
2045
-
2046
- message HopHint {
2047
- /// The public key of the node at the start of the channel.
2048
- string node_id = 1 [json_name = "node_id"];
2049
-
2050
- /// The unique identifier of the channel.
2051
- uint64 chan_id = 2 [json_name = "chan_id"];
2052
-
2053
- /// The base fee of the channel denominated in millisatoshis.
2054
- uint32 fee_base_msat = 3 [json_name = "fee_base_msat"];
2055
-
2056
- /**
2057
- The fee rate of the channel for sending one satoshi across it denominated in
2058
- millionths of a satoshi.
2059
- */
2060
- uint32 fee_proportional_millionths = 4 [json_name = "fee_proportional_millionths"];
2061
-
2062
- /// The time-lock delta of the channel.
2063
- uint32 cltv_expiry_delta = 5 [json_name = "cltv_expiry_delta"];
2064
- }
2065
-
2066
- message RouteHint {
2067
- /**
2068
- A list of hop hints that when chained together can assist in reaching a
2069
- specific destination.
2070
- */
2071
- repeated HopHint hop_hints = 1 [json_name = "hop_hints"];
2072
- }
2073
-
2074
- message Invoice {
2075
- /**
2076
- An optional memo to attach along with the invoice. Used for record keeping
2077
- purposes for the invoice's creator, and will also be set in the description
2078
- field of the encoded payment request if the description_hash field is not
2079
- being used.
2080
- */
2081
- string memo = 1 [json_name = "memo"];
2082
-
2083
- /** Deprecated. An optional cryptographic receipt of payment which is not
2084
- implemented.
2085
- */
2086
- bytes receipt = 2 [json_name = "receipt", deprecated = true];
2087
-
2088
- /**
2089
- The hex-encoded preimage (32 byte) which will allow settling an incoming
2090
- HTLC payable to this preimage
2091
- */
2092
- bytes r_preimage = 3 [json_name = "r_preimage"];
2093
-
2094
- /// The hash of the preimage
2095
- bytes r_hash = 4 [json_name = "r_hash"];
2096
-
2097
- /// The value of this invoice in satoshis
2098
- int64 value = 5 [json_name = "value"];
2099
-
2100
- /// Whether this invoice has been fulfilled
2101
- bool settled = 6 [json_name = "settled", deprecated = true];
2102
-
2103
- /// When this invoice was created
2104
- int64 creation_date = 7 [json_name = "creation_date"];
2105
-
2106
- /// When this invoice was settled
2107
- int64 settle_date = 8 [json_name = "settle_date"];
2108
-
2109
- /**
2110
- A bare-bones invoice for a payment within the Lightning Network. With the
2111
- details of the invoice, the sender has all the data necessary to send a
2112
- payment to the recipient.
2113
- */
2114
- string payment_request = 9 [json_name = "payment_request"];
2115
-
2116
- /**
2117
- Hash (SHA-256) of a description of the payment. Used if the description of
2118
- payment (memo) is too long to naturally fit within the description field
2119
- of an encoded payment request.
2120
- */
2121
- bytes description_hash = 10 [json_name = "description_hash"];
2122
-
2123
- /// Payment request expiry time in seconds. Default is 3600 (1 hour).
2124
- int64 expiry = 11 [json_name = "expiry"];
2125
-
2126
- /// Fallback on-chain address.
2127
- string fallback_addr = 12 [json_name = "fallback_addr"];
2128
-
2129
- /// Delta to use for the time-lock of the CLTV extended to the final hop.
2130
- uint64 cltv_expiry = 13 [json_name = "cltv_expiry"];
2131
-
2132
- /**
2133
- Route hints that can each be individually used to assist in reaching the
2134
- invoice's destination.
2135
- */
2136
- repeated RouteHint route_hints = 14 [json_name = "route_hints"];
2137
-
2138
- /// Whether this invoice should include routing hints for private channels.
2139
- bool private = 15 [json_name = "private"];
2140
-
2141
- /**
2142
- The "add" index of this invoice. Each newly created invoice will increment
2143
- this index making it monotonically increasing. Callers to the
2144
- SubscribeInvoices call can use this to instantly get notified of all added
2145
- invoices with an add_index greater than this one.
2146
- */
2147
- uint64 add_index = 16 [json_name = "add_index"];
2148
-
2149
- /**
2150
- The "settle" index of this invoice. Each newly settled invoice will
2151
- increment this index making it monotonically increasing. Callers to the
2152
- SubscribeInvoices call can use this to instantly get notified of all
2153
- settled invoices with an settle_index greater than this one.
2154
- */
2155
- uint64 settle_index = 17 [json_name = "settle_index"];
2156
-
2157
- /// Deprecated, use amt_paid_sat or amt_paid_msat.
2158
- int64 amt_paid = 18 [json_name = "amt_paid", deprecated = true];
2159
-
2160
- /**
2161
- The amount that was accepted for this invoice, in satoshis. This will ONLY
2162
- be set if this invoice has been settled. We provide this field as if the
2163
- invoice was created with a zero value, then we need to record what amount
2164
- was ultimately accepted. Additionally, it's possible that the sender paid
2165
- MORE that was specified in the original invoice. So we'll record that here
2166
- as well.
2167
- */
2168
- int64 amt_paid_sat = 19 [json_name = "amt_paid_sat"];
2169
-
2170
- /**
2171
- The amount that was accepted for this invoice, in millisatoshis. This will
2172
- ONLY be set if this invoice has been settled. We provide this field as if
2173
- the invoice was created with a zero value, then we need to record what
2174
- amount was ultimately accepted. Additionally, it's possible that the sender
2175
- paid MORE that was specified in the original invoice. So we'll record that
2176
- here as well.
2177
- */
2178
- int64 amt_paid_msat = 20 [json_name = "amt_paid_msat"];
2179
-
2180
- enum InvoiceState {
2181
- OPEN = 0;
2182
- SETTLED = 1;
2183
- CANCELED = 2;
2184
- ACCEPTED = 3;
2185
- }
2186
-
2187
- /**
2188
- The state the invoice is in.
2189
- */
2190
- InvoiceState state = 21 [json_name = "state"];
2191
-
2192
- /// List of HTLCs paying to this invoice [EXPERIMENTAL].
2193
- repeated InvoiceHTLC htlcs = 22 [json_name = "htlcs"];
2194
- }
2195
-
2196
- enum InvoiceHTLCState {
2197
- ACCEPTED = 0;
2198
- SETTLED = 1;
2199
- CANCELED = 2;
2200
- }
2201
-
2202
- /// Details of an HTLC that paid to an invoice
2203
- message InvoiceHTLC {
2204
- /// Short channel id over which the htlc was received.
2205
- uint64 chan_id = 1 [json_name = "chan_id"];
2206
-
2207
- /// Index identifying the htlc on the channel.
2208
- uint64 htlc_index = 2 [json_name = "htlc_index"];
2209
-
2210
- /// The amount of the htlc in msat.
2211
- uint64 amt_msat = 3 [json_name = "amt_msat"];
2212
-
2213
- /// Block height at which this htlc was accepted.
2214
- int32 accept_height = 4 [json_name = "accept_height"];
2215
-
2216
- /// Time at which this htlc was accepted.
2217
- int64 accept_time = 5 [json_name = "accept_time"];
2218
-
2219
- /// Time at which this htlc was settled or canceled.
2220
- int64 resolve_time = 6 [json_name = "resolve_time"];
2221
-
2222
- /// Block height at which this htlc expires.
2223
- int32 expiry_height = 7 [json_name = "expiry_height"];
2224
-
2225
- /// Current state the htlc is in.
2226
- InvoiceHTLCState state = 8 [json_name = "state"];
2227
- }
2228
-
2229
- message AddInvoiceResponse {
2230
- bytes r_hash = 1 [json_name = "r_hash"];
2231
-
2232
- /**
2233
- A bare-bones invoice for a payment within the Lightning Network. With the
2234
- details of the invoice, the sender has all the data necessary to send a
2235
- payment to the recipient.
2236
- */
2237
- string payment_request = 2 [json_name = "payment_request"];
2238
-
2239
- /**
2240
- The "add" index of this invoice. Each newly created invoice will increment
2241
- this index making it monotonically increasing. Callers to the
2242
- SubscribeInvoices call can use this to instantly get notified of all added
2243
- invoices with an add_index greater than this one.
2244
- */
2245
- uint64 add_index = 16 [json_name = "add_index"];
2246
- }
2247
- message PaymentHash {
2248
- /**
2249
- The hex-encoded payment hash of the invoice to be looked up. The passed
2250
- payment hash must be exactly 32 bytes, otherwise an error is returned.
2251
- */
2252
- string r_hash_str = 1 [json_name = "r_hash_str"];
2253
-
2254
- /// The payment hash of the invoice to be looked up.
2255
- bytes r_hash = 2 [json_name = "r_hash"];
2256
- }
2257
-
2258
- message ListInvoiceRequest {
2259
- /// If set, only unsettled invoices will be returned in the response.
2260
- bool pending_only = 1 [json_name = "pending_only"];
2261
-
2262
- /**
2263
- The index of an invoice that will be used as either the start or end of a
2264
- query to determine which invoices should be returned in the response.
2265
- */
2266
- uint64 index_offset = 4 [json_name = "index_offset"];
2267
-
2268
- /// The max number of invoices to return in the response to this query.
2269
- uint64 num_max_invoices = 5 [json_name = "num_max_invoices"];
2270
-
2271
- /**
2272
- If set, the invoices returned will result from seeking backwards from the
2273
- specified index offset. This can be used to paginate backwards.
2274
- */
2275
- bool reversed = 6 [json_name = "reversed"];
2276
- }
2277
- message ListInvoiceResponse {
2278
- /**
2279
- A list of invoices from the time slice of the time series specified in the
2280
- request.
2281
- */
2282
- repeated Invoice invoices = 1 [json_name = "invoices"];
2283
-
2284
- /**
2285
- The index of the last item in the set of returned invoices. This can be used
2286
- to seek further, pagination style.
2287
- */
2288
- uint64 last_index_offset = 2 [json_name = "last_index_offset"];
2289
-
2290
- /**
2291
- The index of the last item in the set of returned invoices. This can be used
2292
- to seek backwards, pagination style.
2293
- */
2294
- uint64 first_index_offset = 3 [json_name = "first_index_offset"];
2295
- }
2296
-
2297
- message InvoiceSubscription {
2298
- /**
2299
- If specified (non-zero), then we'll first start by sending out
2300
- notifications for all added indexes with an add_index greater than this
2301
- value. This allows callers to catch up on any events they missed while they
2302
- weren't connected to the streaming RPC.
2303
- */
2304
- uint64 add_index = 1 [json_name = "add_index"];
2305
-
2306
- /**
2307
- If specified (non-zero), then we'll first start by sending out
2308
- notifications for all settled indexes with an settle_index greater than
2309
- this value. This allows callers to catch up on any events they missed while
2310
- they weren't connected to the streaming RPC.
2311
- */
2312
- uint64 settle_index = 2 [json_name = "settle_index"];
2313
- }
2314
-
2315
-
2316
- message Payment {
2317
- /// The payment hash
2318
- string payment_hash = 1 [json_name = "payment_hash"];
2319
-
2320
- /// Deprecated, use value_sat or value_msat.
2321
- int64 value = 2 [json_name = "value", deprecated = true];
2322
-
2323
- /// The date of this payment
2324
- int64 creation_date = 3 [json_name = "creation_date"];
2325
-
2326
- /// The path this payment took
2327
- repeated string path = 4 [ json_name = "path" ];
2328
-
2329
- /// Deprecated, use fee_sat or fee_msat.
2330
- int64 fee = 5 [json_name = "fee", deprecated = true];
2331
-
2332
- /// The payment preimage
2333
- string payment_preimage = 6 [json_name = "payment_preimage"];
2334
-
2335
- /// The value of the payment in satoshis
2336
- int64 value_sat = 7 [json_name = "value_sat"];
2337
-
2338
- /// The value of the payment in milli-satoshis
2339
- int64 value_msat = 8 [json_name = "value_msat"];
2340
-
2341
- /// The optional payment request being fulfilled.
2342
- string payment_request = 9 [json_name = "payment_request"];
2343
-
2344
- enum PaymentStatus {
2345
- UNKNOWN = 0;
2346
- IN_FLIGHT = 1;
2347
- SUCCEEDED = 2;
2348
- FAILED = 3;
2349
- }
2350
-
2351
- // The status of the payment.
2352
- PaymentStatus status = 10 [json_name = "status"];
2353
-
2354
- /// The fee paid for this payment in satoshis
2355
- int64 fee_sat = 11 [json_name = "fee_sat"];
2356
-
2357
- /// The fee paid for this payment in milli-satoshis
2358
- int64 fee_msat = 12 [json_name = "fee_msat"];
2359
- }
2360
-
2361
- message ListPaymentsRequest {
2362
- /**
2363
- If true, then return payments that have not yet fully completed. This means
2364
- that pending payments, as well as failed payments will show up if this
2365
- field is set to True.
2366
- */
2367
- bool include_incomplete = 1;
2368
- }
2369
-
2370
- message ListPaymentsResponse {
2371
- /// The list of payments
2372
- repeated Payment payments = 1 [json_name = "payments"];
2373
- }
2374
-
2375
- message DeleteAllPaymentsRequest {
2376
- }
2377
-
2378
- message DeleteAllPaymentsResponse {
2379
- }
2380
-
2381
- message AbandonChannelRequest {
2382
- ChannelPoint channel_point = 1;
2383
- }
2384
-
2385
- message AbandonChannelResponse {
2386
- }
2387
-
2388
-
2389
- message DebugLevelRequest {
2390
- bool show = 1;
2391
- string level_spec = 2;
2392
- }
2393
- message DebugLevelResponse {
2394
- string sub_systems = 1 [json_name = "sub_systems"];
2395
- }
2396
-
2397
- message PayReqString {
2398
- /// The payment request string to be decoded
2399
- string pay_req = 1;
2400
- }
2401
- message PayReq {
2402
- string destination = 1 [json_name = "destination"];
2403
- string payment_hash = 2 [json_name = "payment_hash"];
2404
- int64 num_satoshis = 3 [json_name = "num_satoshis"];
2405
- int64 timestamp = 4 [json_name = "timestamp"];
2406
- int64 expiry = 5 [json_name = "expiry"];
2407
- string description = 6 [json_name = "description"];
2408
- string description_hash = 7 [json_name = "description_hash"];
2409
- string fallback_addr = 8 [json_name = "fallback_addr"];
2410
- int64 cltv_expiry = 9 [json_name = "cltv_expiry"];
2411
- repeated RouteHint route_hints = 10 [json_name = "route_hints"];
2412
- }
2413
-
2414
- message FeeReportRequest {}
2415
- message ChannelFeeReport {
2416
- /// The channel that this fee report belongs to.
2417
- string chan_point = 1 [json_name = "channel_point"];
2418
-
2419
- /// The base fee charged regardless of the number of milli-satoshis sent.
2420
- int64 base_fee_msat = 2 [json_name = "base_fee_msat"];
2421
-
2422
- /// The amount charged per milli-satoshis transferred expressed in millionths of a satoshi.
2423
- int64 fee_per_mil = 3 [json_name = "fee_per_mil"];
2424
-
2425
- /// The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million.
2426
- double fee_rate = 4 [json_name = "fee_rate"];
2427
- }
2428
- message FeeReportResponse {
2429
- /// An array of channel fee reports which describes the current fee schedule for each channel.
2430
- repeated ChannelFeeReport channel_fees = 1 [json_name = "channel_fees"];
2431
-
2432
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs.
2433
- uint64 day_fee_sum = 2 [json_name = "day_fee_sum"];
2434
-
2435
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week.
2436
- uint64 week_fee_sum = 3 [json_name = "week_fee_sum"];
2437
-
2438
- /// The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month.
2439
- uint64 month_fee_sum = 4 [json_name = "month_fee_sum"];
2440
- }
2441
-
2442
- message PolicyUpdateRequest {
2443
- oneof scope {
2444
- /// If set, then this update applies to all currently active channels.
2445
- bool global = 1 [json_name = "global"] ;
2446
-
2447
- /// If set, this update will target a specific channel.
2448
- ChannelPoint chan_point = 2 [json_name = "chan_point"];
2449
- }
2450
-
2451
- /// The base fee charged regardless of the number of milli-satoshis sent.
2452
- int64 base_fee_msat = 3 [json_name = "base_fee_msat"];
2453
-
2454
- /// The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6.
2455
- double fee_rate = 4 [json_name = "fee_rate"];
2456
-
2457
- /// The required timelock delta for HTLCs forwarded over the channel.
2458
- uint32 time_lock_delta = 5 [json_name = "time_lock_delta"];
2459
-
2460
- /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum HTLC will be unchanged.
2461
- uint64 max_htlc_msat = 6 [json_name = "max_htlc_msat"];
2462
- }
2463
- message PolicyUpdateResponse {
2464
- }
2465
-
2466
- message ForwardingHistoryRequest {
2467
- /// Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset.
2468
- uint64 start_time = 1 [json_name = "start_time"];
2469
-
2470
- /// End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination.
2471
- uint64 end_time = 2 [json_name = "end_time"];
2472
-
2473
- /// Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series.
2474
- uint32 index_offset = 3 [json_name = "index_offset"];
2475
-
2476
- /// The max number of events to return in the response to this query.
2477
- uint32 num_max_events = 4 [json_name = "num_max_events"];
2478
- }
2479
- message ForwardingEvent {
2480
- /// Timestamp is the time (unix epoch offset) that this circuit was completed.
2481
- uint64 timestamp = 1 [json_name = "timestamp"];
2482
-
2483
- /// The incoming channel ID that carried the HTLC that created the circuit.
2484
- uint64 chan_id_in = 2 [json_name = "chan_id_in"];
2485
-
2486
- /// The outgoing channel ID that carried the preimage that completed the circuit.
2487
- uint64 chan_id_out = 4 [json_name = "chan_id_out"];
2488
-
2489
- /// The total amount (in satoshis) of the incoming HTLC that created half the circuit.
2490
- uint64 amt_in = 5 [json_name = "amt_in"];
2491
-
2492
- /// The total amount (in satoshis) of the outgoing HTLC that created the second half of the circuit.
2493
- uint64 amt_out = 6 [json_name = "amt_out"];
2494
-
2495
- /// The total fee (in satoshis) that this payment circuit carried.
2496
- uint64 fee = 7 [json_name = "fee"];
2497
-
2498
- /// The total fee (in milli-satoshis) that this payment circuit carried.
2499
- uint64 fee_msat = 8 [json_name = "fee_msat"];
2500
-
2501
- // TODO(roasbeef): add settlement latency?
2502
- // * use FPE on the chan id?
2503
- // * also list failures?
2504
- }
2505
- message ForwardingHistoryResponse {
2506
- /// A list of forwarding events from the time slice of the time series specified in the request.
2507
- repeated ForwardingEvent forwarding_events = 1 [json_name = "forwarding_events"];
2508
-
2509
- /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
2510
- uint32 last_offset_index = 2 [json_name = "last_offset_index"];
2511
- }
2512
-
2513
- message ExportChannelBackupRequest {
2514
- /// The target channel point to obtain a back up for.
2515
- ChannelPoint chan_point = 1;
2516
- }
2517
-
2518
- message ChannelBackup {
2519
- /**
2520
- Identifies the channel that this backup belongs to.
2521
- */
2522
- ChannelPoint chan_point = 1 [ json_name = "chan_point" ];
2523
-
2524
- /**
2525
- Is an encrypted single-chan backup. this can be passed to
2526
- RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in
2527
- order to trigger the recovery protocol.
2528
- */
2529
- bytes chan_backup = 2 [ json_name = "chan_backup" ];
2530
- }
2531
-
2532
- message MultiChanBackup {
2533
- /**
2534
- Is the set of all channels that are included in this multi-channel backup.
2535
- */
2536
- repeated ChannelPoint chan_points = 1 [ json_name = "chan_points" ];
2537
-
2538
- /**
2539
- A single encrypted blob containing all the static channel backups of the
2540
- channel listed above. This can be stored as a single file or blob, and
2541
- safely be replaced with any prior/future versions.
2542
- */
2543
- bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
2544
- }
2545
-
2546
- message ChanBackupExportRequest {}
2547
- message ChanBackupSnapshot {
2548
- /**
2549
- The set of new channels that have been added since the last channel backup
2550
- snapshot was requested.
2551
- */
2552
- ChannelBackups single_chan_backups = 1 [ json_name = "single_chan_backups" ];
2553
-
2554
- /**
2555
- A multi-channel backup that covers all open channels currently known to
2556
- lnd.
2557
- */
2558
- MultiChanBackup multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
2559
- }
2560
-
2561
- message ChannelBackups {
2562
- /**
2563
- A set of single-chan static channel backups.
2564
- */
2565
- repeated ChannelBackup chan_backups = 1 [ json_name = "chan_backups" ];
2566
- }
2567
-
2568
- message RestoreChanBackupRequest {
2569
- oneof backup {
2570
- ChannelBackups chan_backups = 1 [ json_name = "chan_backups" ];
2571
-
2572
- bytes multi_chan_backup = 2 [ json_name = "multi_chan_backup" ];
2573
- }
2574
- }
2575
- message RestoreBackupResponse {}
2576
-
2577
- message ChannelBackupSubscription {}
2578
-
2579
- message VerifyChanBackupResponse {
2580
- }