lnd-client 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +15 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +62 -0
  6. data/LICENSE +21 -0
  7. data/README.md +107 -0
  8. data/Rakefile +10 -0
  9. data/components/grpc/autopilotrpc/autopilot_pb.rb +48 -0
  10. data/components/grpc/autopilotrpc/autopilot_services_pb.rb +40 -0
  11. data/components/grpc/chainrpc/chainkit_pb.rb +36 -0
  12. data/components/grpc/chainrpc/chainkit_services_pb.rb +34 -0
  13. data/components/grpc/chainrpc/chainnotifier_pb.rb +69 -0
  14. data/components/grpc/chainrpc/chainnotifier_services_pb.rb +53 -0
  15. data/components/grpc/devrpc/dev_pb.rb +17 -0
  16. data/components/grpc/devrpc/dev_services_pb.rb +25 -0
  17. data/components/grpc/invoicesrpc/invoices_pb.rb +66 -0
  18. data/components/grpc/invoicesrpc/invoices_services_pb.rb +45 -0
  19. data/components/grpc/lightning_pb.rb +1621 -0
  20. data/components/grpc/lightning_services_pb.rb +441 -0
  21. data/components/grpc/lnclipb/lncli_pb.rb +19 -0
  22. data/components/grpc/neutrinorpc/neutrino_pb.rb +106 -0
  23. data/components/grpc/neutrinorpc/neutrino_services_pb.rb +51 -0
  24. data/components/grpc/peersrpc/peers_pb.rb +48 -0
  25. data/components/grpc/peersrpc/peers_services_pb.rb +27 -0
  26. data/components/grpc/routerrpc/router_pb.rb +299 -0
  27. data/components/grpc/routerrpc/router_services_pb.rb +115 -0
  28. data/components/grpc/signrpc/signer_pb.rb +172 -0
  29. data/components/grpc/signrpc/signer_services_pb.rb +134 -0
  30. data/components/grpc/stateservice_pb.rb +35 -0
  31. data/components/grpc/stateservice_services_pb.rb +46 -0
  32. data/components/grpc/verrpc/verrpc_pb.rb +27 -0
  33. data/components/grpc/verrpc/verrpc_services_pb.rb +27 -0
  34. data/components/grpc/walletrpc/walletkit_pb.rb +328 -0
  35. data/components/grpc/walletrpc/walletkit_services_pb.rb +230 -0
  36. data/components/grpc/walletunlocker_pb.rb +75 -0
  37. data/components/grpc/walletunlocker_services_pb.rb +72 -0
  38. data/components/grpc/watchtowerrpc/watchtower_pb.rb +21 -0
  39. data/components/grpc/watchtowerrpc/watchtower_services_pb.rb +28 -0
  40. data/components/grpc/wtclientrpc/wtclient_pb.rb +83 -0
  41. data/components/grpc/wtclientrpc/wtclient_services_pb.rb +43 -0
  42. data/components/grpc.rb +9 -0
  43. data/controllers/client.rb +31 -0
  44. data/controllers/config.rb +35 -0
  45. data/controllers/documentation.rb +45 -0
  46. data/controllers/grpc_generator.rb +80 -0
  47. data/controllers/service.rb +35 -0
  48. data/lnd-client.gemspec +35 -0
  49. data/logic/string.rb +11 -0
  50. data/ports/dsl/lnd-client.rb +14 -0
  51. data/static/spec.rb +13 -0
  52. metadata +110 -0
@@ -0,0 +1,441 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: lightning.proto for package 'lnrpc'
3
+
4
+ require 'grpc'
5
+ require_relative 'lightning_pb'
6
+
7
+ module Lnrpc
8
+ module Lightning
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
+ # An RPC method can be matched to an lncli command by placing a line in the
16
+ # beginning of the description in exactly the following format:
17
+ # lncli: `methodname`
18
+ #
19
+ # Failure to specify the exact name of the command will cause documentation
20
+ # generation to fail.
21
+ #
22
+ # More information on how exactly the gRPC documentation is generated from
23
+ # this proto file can be found here:
24
+ # https://github.com/lightninglabs/lightning-api
25
+ #
26
+ # Lightning is the main RPC server of the daemon.
27
+ class Service
28
+
29
+ include ::GRPC::GenericService
30
+
31
+ self.marshal_class_method = :encode
32
+ self.unmarshal_class_method = :decode
33
+ self.service_name = 'lnrpc.Lightning'
34
+
35
+ # lncli: `walletbalance`
36
+ # WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
37
+ # confirmed unspent outputs and all unconfirmed unspent outputs under control
38
+ # of the wallet.
39
+ rpc :WalletBalance, ::Lnrpc::WalletBalanceRequest, ::Lnrpc::WalletBalanceResponse
40
+ # lncli: `channelbalance`
41
+ # ChannelBalance returns a report on the total funds across all open channels,
42
+ # categorized in local/remote, pending local/remote and unsettled local/remote
43
+ # balances.
44
+ rpc :ChannelBalance, ::Lnrpc::ChannelBalanceRequest, ::Lnrpc::ChannelBalanceResponse
45
+ # lncli: `listchaintxns`
46
+ # GetTransactions returns a list describing all the known transactions
47
+ # relevant to the wallet.
48
+ rpc :GetTransactions, ::Lnrpc::GetTransactionsRequest, ::Lnrpc::TransactionDetails
49
+ # lncli: `estimatefee`
50
+ # EstimateFee asks the chain backend to estimate the fee rate and total fees
51
+ # for a transaction that pays to multiple specified outputs.
52
+ #
53
+ # When using REST, the `AddrToAmount` map type can be set by appending
54
+ # `&AddrToAmount[<address>]=<amount_to_send>` to the URL. Unfortunately this
55
+ # map type doesn't appear in the REST API documentation because of a bug in
56
+ # the grpc-gateway library.
57
+ rpc :EstimateFee, ::Lnrpc::EstimateFeeRequest, ::Lnrpc::EstimateFeeResponse
58
+ # lncli: `sendcoins`
59
+ # SendCoins executes a request to send coins to a particular address. Unlike
60
+ # SendMany, this RPC call only allows creating a single output at a time. If
61
+ # neither target_conf, or sat_per_vbyte are set, then the internal wallet will
62
+ # consult its fee model to determine a fee for the default confirmation
63
+ # target.
64
+ rpc :SendCoins, ::Lnrpc::SendCoinsRequest, ::Lnrpc::SendCoinsResponse
65
+ # lncli: `listunspent`
66
+ # Deprecated, use walletrpc.ListUnspent instead.
67
+ #
68
+ # ListUnspent returns a list of all utxos spendable by the wallet with a
69
+ # number of confirmations between the specified minimum and maximum.
70
+ rpc :ListUnspent, ::Lnrpc::ListUnspentRequest, ::Lnrpc::ListUnspentResponse
71
+ #
72
+ # SubscribeTransactions creates a uni-directional stream from the server to
73
+ # the client in which any newly discovered transactions relevant to the
74
+ # wallet are sent over.
75
+ rpc :SubscribeTransactions, ::Lnrpc::GetTransactionsRequest, stream(::Lnrpc::Transaction)
76
+ # lncli: `sendmany`
77
+ # SendMany handles a request for a transaction that creates multiple specified
78
+ # outputs in parallel. If neither target_conf, or sat_per_vbyte are set, then
79
+ # the internal wallet will consult its fee model to determine a fee for the
80
+ # default confirmation target.
81
+ rpc :SendMany, ::Lnrpc::SendManyRequest, ::Lnrpc::SendManyResponse
82
+ # lncli: `newaddress`
83
+ # NewAddress creates a new address under control of the local wallet.
84
+ rpc :NewAddress, ::Lnrpc::NewAddressRequest, ::Lnrpc::NewAddressResponse
85
+ # lncli: `signmessage`
86
+ # SignMessage signs a message with this node's private key. The returned
87
+ # signature string is `zbase32` encoded and pubkey recoverable, meaning that
88
+ # only the message digest and signature are needed for verification.
89
+ rpc :SignMessage, ::Lnrpc::SignMessageRequest, ::Lnrpc::SignMessageResponse
90
+ # lncli: `verifymessage`
91
+ # VerifyMessage verifies a signature over a msg. The signature must be
92
+ # zbase32 encoded and signed by an active node in the resident node's
93
+ # channel database. In addition to returning the validity of the signature,
94
+ # VerifyMessage also returns the recovered pubkey from the signature.
95
+ rpc :VerifyMessage, ::Lnrpc::VerifyMessageRequest, ::Lnrpc::VerifyMessageResponse
96
+ # lncli: `connect`
97
+ # ConnectPeer attempts to establish a connection to a remote peer. This is at
98
+ # the networking level, and is used for communication between nodes. This is
99
+ # distinct from establishing a channel with a peer.
100
+ rpc :ConnectPeer, ::Lnrpc::ConnectPeerRequest, ::Lnrpc::ConnectPeerResponse
101
+ # lncli: `disconnect`
102
+ # DisconnectPeer attempts to disconnect one peer from another identified by a
103
+ # given pubKey. In the case that we currently have a pending or active channel
104
+ # with the target peer, then this action will be not be allowed.
105
+ rpc :DisconnectPeer, ::Lnrpc::DisconnectPeerRequest, ::Lnrpc::DisconnectPeerResponse
106
+ # lncli: `listpeers`
107
+ # ListPeers returns a verbose listing of all currently active peers.
108
+ rpc :ListPeers, ::Lnrpc::ListPeersRequest, ::Lnrpc::ListPeersResponse
109
+ #
110
+ # SubscribePeerEvents creates a uni-directional stream from the server to
111
+ # the client in which any events relevant to the state of peers are sent
112
+ # over. Events include peers going online and offline.
113
+ rpc :SubscribePeerEvents, ::Lnrpc::PeerEventSubscription, stream(::Lnrpc::PeerEvent)
114
+ # lncli: `getinfo`
115
+ # GetInfo returns general information concerning the lightning node including
116
+ # it's identity pubkey, alias, the chains it is connected to, and information
117
+ # concerning the number of open+pending channels.
118
+ rpc :GetInfo, ::Lnrpc::GetInfoRequest, ::Lnrpc::GetInfoResponse
119
+ # * lncli: `getrecoveryinfo`
120
+ # GetRecoveryInfo returns information concerning the recovery mode including
121
+ # whether it's in a recovery mode, whether the recovery is finished, and the
122
+ # progress made so far.
123
+ rpc :GetRecoveryInfo, ::Lnrpc::GetRecoveryInfoRequest, ::Lnrpc::GetRecoveryInfoResponse
124
+ # TODO(roasbeef): merge with below with bool?
125
+ #
126
+ # lncli: `pendingchannels`
127
+ # PendingChannels returns a list of all the channels that are currently
128
+ # considered "pending". A channel is pending if it has finished the funding
129
+ # workflow and is waiting for confirmations for the funding txn, or is in the
130
+ # process of closure, either initiated cooperatively or non-cooperatively.
131
+ rpc :PendingChannels, ::Lnrpc::PendingChannelsRequest, ::Lnrpc::PendingChannelsResponse
132
+ # lncli: `listchannels`
133
+ # ListChannels returns a description of all the open channels that this node
134
+ # is a participant in.
135
+ rpc :ListChannels, ::Lnrpc::ListChannelsRequest, ::Lnrpc::ListChannelsResponse
136
+ #
137
+ # SubscribeChannelEvents creates a uni-directional stream from the server to
138
+ # the client in which any updates relevant to the state of the channels are
139
+ # sent over. Events include new active channels, inactive channels, and closed
140
+ # channels.
141
+ rpc :SubscribeChannelEvents, ::Lnrpc::ChannelEventSubscription, stream(::Lnrpc::ChannelEventUpdate)
142
+ # lncli: `closedchannels`
143
+ # ClosedChannels returns a description of all the closed channels that
144
+ # this node was a participant in.
145
+ rpc :ClosedChannels, ::Lnrpc::ClosedChannelsRequest, ::Lnrpc::ClosedChannelsResponse
146
+ #
147
+ # OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
148
+ # call is meant to be consumed by clients to the REST proxy. As with all
149
+ # other sync calls, all byte slices are intended to be populated as hex
150
+ # encoded strings.
151
+ rpc :OpenChannelSync, ::Lnrpc::OpenChannelRequest, ::Lnrpc::ChannelPoint
152
+ # lncli: `openchannel`
153
+ # OpenChannel attempts to open a singly funded channel specified in the
154
+ # request to a remote peer. Users are able to specify a target number of
155
+ # blocks that the funding transaction should be confirmed in, or a manual fee
156
+ # rate to us for the funding transaction. If neither are specified, then a
157
+ # lax block confirmation target is used. Each OpenStatusUpdate will return
158
+ # the pending channel ID of the in-progress channel. Depending on the
159
+ # arguments specified in the OpenChannelRequest, this pending channel ID can
160
+ # then be used to manually progress the channel funding flow.
161
+ rpc :OpenChannel, ::Lnrpc::OpenChannelRequest, stream(::Lnrpc::OpenStatusUpdate)
162
+ # lncli: `batchopenchannel`
163
+ # BatchOpenChannel attempts to open multiple single-funded channels in a
164
+ # single transaction in an atomic way. This means either all channel open
165
+ # requests succeed at once or all attempts are aborted if any of them fail.
166
+ # This is the safer variant of using PSBTs to manually fund a batch of
167
+ # channels through the OpenChannel RPC.
168
+ rpc :BatchOpenChannel, ::Lnrpc::BatchOpenChannelRequest, ::Lnrpc::BatchOpenChannelResponse
169
+ #
170
+ # FundingStateStep is an advanced funding related call that allows the caller
171
+ # to either execute some preparatory steps for a funding workflow, or
172
+ # manually progress a funding workflow. The primary way a funding flow is
173
+ # identified is via its pending channel ID. As an example, this method can be
174
+ # used to specify that we're expecting a funding flow for a particular
175
+ # pending channel ID, for which we need to use specific parameters.
176
+ # Alternatively, this can be used to interactively drive PSBT signing for
177
+ # funding for partially complete funding transactions.
178
+ rpc :FundingStateStep, ::Lnrpc::FundingTransitionMsg, ::Lnrpc::FundingStateStepResp
179
+ #
180
+ # ChannelAcceptor dispatches a bi-directional streaming RPC in which
181
+ # OpenChannel requests are sent to the client and the client responds with
182
+ # a boolean that tells LND whether or not to accept the channel. This allows
183
+ # node operators to specify their own criteria for accepting inbound channels
184
+ # through a single persistent connection.
185
+ rpc :ChannelAcceptor, stream(::Lnrpc::ChannelAcceptResponse), stream(::Lnrpc::ChannelAcceptRequest)
186
+ # lncli: `closechannel`
187
+ # CloseChannel attempts to close an active channel identified by its channel
188
+ # outpoint (ChannelPoint). The actions of this method can additionally be
189
+ # augmented to attempt a force close after a timeout period in the case of an
190
+ # inactive peer. If a non-force close (cooperative closure) is requested,
191
+ # then the user can specify either a target number of blocks until the
192
+ # closure transaction is confirmed, or a manual fee rate. If neither are
193
+ # specified, then a default lax, block confirmation target is used.
194
+ rpc :CloseChannel, ::Lnrpc::CloseChannelRequest, stream(::Lnrpc::CloseStatusUpdate)
195
+ # lncli: `abandonchannel`
196
+ # AbandonChannel removes all channel state from the database except for a
197
+ # close summary. This method can be used to get rid of permanently unusable
198
+ # channels due to bugs fixed in newer versions of lnd. This method can also be
199
+ # used to remove externally funded channels where the funding transaction was
200
+ # never broadcast. Only available for non-externally funded channels in dev
201
+ # build.
202
+ rpc :AbandonChannel, ::Lnrpc::AbandonChannelRequest, ::Lnrpc::AbandonChannelResponse
203
+ # lncli: `sendpayment`
204
+ # Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a
205
+ # bi-directional streaming RPC for sending payments through the Lightning
206
+ # Network. A single RPC invocation creates a persistent bi-directional
207
+ # stream allowing clients to rapidly send payments through the Lightning
208
+ # Network with a single persistent connection.
209
+ rpc :SendPayment, stream(::Lnrpc::SendRequest), stream(::Lnrpc::SendResponse)
210
+ #
211
+ # SendPaymentSync is the synchronous non-streaming version of SendPayment.
212
+ # This RPC is intended to be consumed by clients of the REST proxy.
213
+ # Additionally, this RPC expects the destination's public key and the payment
214
+ # hash (if any) to be encoded as hex strings.
215
+ rpc :SendPaymentSync, ::Lnrpc::SendRequest, ::Lnrpc::SendResponse
216
+ # lncli: `sendtoroute`
217
+ # Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional
218
+ # streaming RPC for sending payment through the Lightning Network. This
219
+ # method differs from SendPayment in that it allows users to specify a full
220
+ # route manually. This can be used for things like rebalancing, and atomic
221
+ # swaps.
222
+ rpc :SendToRoute, stream(::Lnrpc::SendToRouteRequest), stream(::Lnrpc::SendResponse)
223
+ #
224
+ # SendToRouteSync is a synchronous version of SendToRoute. It Will block
225
+ # until the payment either fails or succeeds.
226
+ rpc :SendToRouteSync, ::Lnrpc::SendToRouteRequest, ::Lnrpc::SendResponse
227
+ # lncli: `addinvoice`
228
+ # AddInvoice attempts to add a new invoice to the invoice database. Any
229
+ # duplicated invoices are rejected, therefore all invoices *must* have a
230
+ # unique payment preimage.
231
+ rpc :AddInvoice, ::Lnrpc::Invoice, ::Lnrpc::AddInvoiceResponse
232
+ # lncli: `listinvoices`
233
+ # ListInvoices returns a list of all the invoices currently stored within the
234
+ # database. Any active debug invoices are ignored. It has full support for
235
+ # paginated responses, allowing users to query for specific invoices through
236
+ # their add_index. This can be done by using either the first_index_offset or
237
+ # last_index_offset fields included in the response as the index_offset of the
238
+ # next request. By default, the first 100 invoices created will be returned.
239
+ # Backwards pagination is also supported through the Reversed flag.
240
+ rpc :ListInvoices, ::Lnrpc::ListInvoiceRequest, ::Lnrpc::ListInvoiceResponse
241
+ # lncli: `lookupinvoice`
242
+ # LookupInvoice attempts to look up an invoice according to its payment hash.
243
+ # The passed payment hash *must* be exactly 32 bytes, if not, an error is
244
+ # returned.
245
+ rpc :LookupInvoice, ::Lnrpc::PaymentHash, ::Lnrpc::Invoice
246
+ #
247
+ # SubscribeInvoices returns a uni-directional stream (server -> client) for
248
+ # notifying the client of newly added/settled invoices. The caller can
249
+ # optionally specify the add_index and/or the settle_index. If the add_index
250
+ # is specified, then we'll first start by sending add invoice events for all
251
+ # invoices with an add_index greater than the specified value. If the
252
+ # settle_index is specified, the next, we'll send out all settle events for
253
+ # invoices with a settle_index greater than the specified value. One or both
254
+ # of these fields can be set. If no fields are set, then we'll only send out
255
+ # the latest add/settle events.
256
+ rpc :SubscribeInvoices, ::Lnrpc::InvoiceSubscription, stream(::Lnrpc::Invoice)
257
+ # lncli: `decodepayreq`
258
+ # DecodePayReq takes an encoded payment request string and attempts to decode
259
+ # it, returning a full description of the conditions encoded within the
260
+ # payment request.
261
+ rpc :DecodePayReq, ::Lnrpc::PayReqString, ::Lnrpc::PayReq
262
+ # lncli: `listpayments`
263
+ # ListPayments returns a list of all outgoing payments.
264
+ rpc :ListPayments, ::Lnrpc::ListPaymentsRequest, ::Lnrpc::ListPaymentsResponse
265
+ #
266
+ # DeletePayment deletes an outgoing payment from DB. Note that it will not
267
+ # attempt to delete an In-Flight payment, since that would be unsafe.
268
+ rpc :DeletePayment, ::Lnrpc::DeletePaymentRequest, ::Lnrpc::DeletePaymentResponse
269
+ #
270
+ # DeleteAllPayments deletes all outgoing payments from DB. Note that it will
271
+ # not attempt to delete In-Flight payments, since that would be unsafe.
272
+ rpc :DeleteAllPayments, ::Lnrpc::DeleteAllPaymentsRequest, ::Lnrpc::DeleteAllPaymentsResponse
273
+ # lncli: `describegraph`
274
+ # DescribeGraph returns a description of the latest graph state from the
275
+ # point of view of the node. The graph information is partitioned into two
276
+ # components: all the nodes/vertexes, and all the edges that connect the
277
+ # vertexes themselves. As this is a directed graph, the edges also contain
278
+ # the node directional specific routing policy which includes: the time lock
279
+ # delta, fee information, etc.
280
+ rpc :DescribeGraph, ::Lnrpc::ChannelGraphRequest, ::Lnrpc::ChannelGraph
281
+ # lncli: `getnodemetrics`
282
+ # GetNodeMetrics returns node metrics calculated from the graph. Currently
283
+ # the only supported metric is betweenness centrality of individual nodes.
284
+ rpc :GetNodeMetrics, ::Lnrpc::NodeMetricsRequest, ::Lnrpc::NodeMetricsResponse
285
+ # lncli: `getchaninfo`
286
+ # GetChanInfo returns the latest authenticated network announcement for the
287
+ # given channel identified by its channel ID: an 8-byte integer which
288
+ # uniquely identifies the location of transaction's funding output within the
289
+ # blockchain.
290
+ rpc :GetChanInfo, ::Lnrpc::ChanInfoRequest, ::Lnrpc::ChannelEdge
291
+ # lncli: `getnodeinfo`
292
+ # GetNodeInfo returns the latest advertised, aggregated, and authenticated
293
+ # channel information for the specified node identified by its public key.
294
+ rpc :GetNodeInfo, ::Lnrpc::NodeInfoRequest, ::Lnrpc::NodeInfo
295
+ # lncli: `queryroutes`
296
+ # QueryRoutes attempts to query the daemon's Channel Router for a possible
297
+ # route to a target destination capable of carrying a specific amount of
298
+ # satoshis. The returned route contains the full details required to craft and
299
+ # send an HTLC, also including the necessary information that should be
300
+ # present within the Sphinx packet encapsulated within the HTLC.
301
+ #
302
+ # When using REST, the `dest_custom_records` map type can be set by appending
303
+ # `&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
304
+ # to the URL. Unfortunately this map type doesn't appear in the REST API
305
+ # documentation because of a bug in the grpc-gateway library.
306
+ rpc :QueryRoutes, ::Lnrpc::QueryRoutesRequest, ::Lnrpc::QueryRoutesResponse
307
+ # lncli: `getnetworkinfo`
308
+ # GetNetworkInfo returns some basic stats about the known channel graph from
309
+ # the point of view of the node.
310
+ rpc :GetNetworkInfo, ::Lnrpc::NetworkInfoRequest, ::Lnrpc::NetworkInfo
311
+ # lncli: `stop`
312
+ # StopDaemon will send a shutdown request to the interrupt handler, triggering
313
+ # a graceful shutdown of the daemon.
314
+ rpc :StopDaemon, ::Lnrpc::StopRequest, ::Lnrpc::StopResponse
315
+ #
316
+ # SubscribeChannelGraph launches a streaming RPC that allows the caller to
317
+ # receive notifications upon any changes to the channel graph topology from
318
+ # the point of view of the responding node. Events notified include: new
319
+ # nodes coming online, nodes updating their authenticated attributes, new
320
+ # channels being advertised, updates in the routing policy for a directional
321
+ # channel edge, and when channels are closed on-chain.
322
+ rpc :SubscribeChannelGraph, ::Lnrpc::GraphTopologySubscription, stream(::Lnrpc::GraphTopologyUpdate)
323
+ # lncli: `debuglevel`
324
+ # DebugLevel allows a caller to programmatically set the logging verbosity of
325
+ # lnd. The logging can be targeted according to a coarse daemon-wide logging
326
+ # level, or in a granular fashion to specify the logging for a target
327
+ # sub-system.
328
+ rpc :DebugLevel, ::Lnrpc::DebugLevelRequest, ::Lnrpc::DebugLevelResponse
329
+ # lncli: `feereport`
330
+ # FeeReport allows the caller to obtain a report detailing the current fee
331
+ # schedule enforced by the node globally for each channel.
332
+ rpc :FeeReport, ::Lnrpc::FeeReportRequest, ::Lnrpc::FeeReportResponse
333
+ # lncli: `updatechanpolicy`
334
+ # UpdateChannelPolicy allows the caller to update the fee schedule and
335
+ # channel policies for all channels globally, or a particular channel.
336
+ rpc :UpdateChannelPolicy, ::Lnrpc::PolicyUpdateRequest, ::Lnrpc::PolicyUpdateResponse
337
+ # lncli: `fwdinghistory`
338
+ # ForwardingHistory allows the caller to query the htlcswitch for a record of
339
+ # all HTLCs forwarded within the target time range, and integer offset
340
+ # within that time range, for a maximum number of events. If no maximum number
341
+ # of events is specified, up to 100 events will be returned. If no time-range
342
+ # is specified, then events will be returned in the order that they occured.
343
+ #
344
+ # A list of forwarding events are returned. The size of each forwarding event
345
+ # is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
346
+ # As a result each message can only contain 50k entries. Each response has
347
+ # the index offset of the last entry. The index offset can be provided to the
348
+ # request to allow the caller to skip a series of records.
349
+ rpc :ForwardingHistory, ::Lnrpc::ForwardingHistoryRequest, ::Lnrpc::ForwardingHistoryResponse
350
+ # lncli: `exportchanbackup`
351
+ # ExportChannelBackup attempts to return an encrypted static channel backup
352
+ # for the target channel identified by it channel point. The backup is
353
+ # encrypted with a key generated from the aezeed seed of the user. The
354
+ # returned backup can either be restored using the RestoreChannelBackup
355
+ # method once lnd is running, or via the InitWallet and UnlockWallet methods
356
+ # from the WalletUnlocker service.
357
+ rpc :ExportChannelBackup, ::Lnrpc::ExportChannelBackupRequest, ::Lnrpc::ChannelBackup
358
+ #
359
+ # ExportAllChannelBackups returns static channel backups for all existing
360
+ # channels known to lnd. A set of regular singular static channel backups for
361
+ # each channel are returned. Additionally, a multi-channel backup is returned
362
+ # as well, which contains a single encrypted blob containing the backups of
363
+ # each channel.
364
+ rpc :ExportAllChannelBackups, ::Lnrpc::ChanBackupExportRequest, ::Lnrpc::ChanBackupSnapshot
365
+ #
366
+ # VerifyChanBackup allows a caller to verify the integrity of a channel backup
367
+ # snapshot. This method will accept either a packed Single or a packed Multi.
368
+ # Specifying both will result in an error.
369
+ rpc :VerifyChanBackup, ::Lnrpc::ChanBackupSnapshot, ::Lnrpc::VerifyChanBackupResponse
370
+ # lncli: `restorechanbackup`
371
+ # RestoreChannelBackups accepts a set of singular channel backups, or a
372
+ # single encrypted multi-chan backup and attempts to recover any funds
373
+ # remaining within the channel. If we are able to unpack the backup, then the
374
+ # new channel will be shown under listchannels, as well as pending channels.
375
+ rpc :RestoreChannelBackups, ::Lnrpc::RestoreChanBackupRequest, ::Lnrpc::RestoreBackupResponse
376
+ #
377
+ # SubscribeChannelBackups allows a client to sub-subscribe to the most up to
378
+ # date information concerning the state of all channel backups. Each time a
379
+ # new channel is added, we return the new set of channels, along with a
380
+ # multi-chan backup containing the backup info for all channels. Each time a
381
+ # channel is closed, we send a new update, which contains new new chan back
382
+ # ups, but the updated set of encrypted multi-chan backups with the closed
383
+ # channel(s) removed.
384
+ rpc :SubscribeChannelBackups, ::Lnrpc::ChannelBackupSubscription, stream(::Lnrpc::ChanBackupSnapshot)
385
+ # lncli: `bakemacaroon`
386
+ # BakeMacaroon allows the creation of a new macaroon with custom read and
387
+ # write permissions. No first-party caveats are added since this can be done
388
+ # offline.
389
+ rpc :BakeMacaroon, ::Lnrpc::BakeMacaroonRequest, ::Lnrpc::BakeMacaroonResponse
390
+ # lncli: `listmacaroonids`
391
+ # ListMacaroonIDs returns all root key IDs that are in use.
392
+ rpc :ListMacaroonIDs, ::Lnrpc::ListMacaroonIDsRequest, ::Lnrpc::ListMacaroonIDsResponse
393
+ # lncli: `deletemacaroonid`
394
+ # DeleteMacaroonID deletes the specified macaroon ID and invalidates all
395
+ # macaroons derived from that ID.
396
+ rpc :DeleteMacaroonID, ::Lnrpc::DeleteMacaroonIDRequest, ::Lnrpc::DeleteMacaroonIDResponse
397
+ # lncli: `listpermissions`
398
+ # ListPermissions lists all RPC method URIs and their required macaroon
399
+ # permissions to access them.
400
+ rpc :ListPermissions, ::Lnrpc::ListPermissionsRequest, ::Lnrpc::ListPermissionsResponse
401
+ #
402
+ # CheckMacaroonPermissions checks whether a request follows the constraints
403
+ # imposed on the macaroon and that the macaroon is authorized to follow the
404
+ # provided permissions.
405
+ rpc :CheckMacaroonPermissions, ::Lnrpc::CheckMacPermRequest, ::Lnrpc::CheckMacPermResponse
406
+ #
407
+ # RegisterRPCMiddleware adds a new gRPC middleware to the interceptor chain. A
408
+ # gRPC middleware is software component external to lnd that aims to add
409
+ # additional business logic to lnd by observing/intercepting/validating
410
+ # incoming gRPC client requests and (if needed) replacing/overwriting outgoing
411
+ # messages before they're sent to the client. When registering the middleware
412
+ # must identify itself and indicate what custom macaroon caveats it wants to
413
+ # be responsible for. Only requests that contain a macaroon with that specific
414
+ # custom caveat are then sent to the middleware for inspection. The other
415
+ # option is to register for the read-only mode in which all requests/responses
416
+ # are forwarded for interception to the middleware but the middleware is not
417
+ # allowed to modify any responses. As a security measure, _no_ middleware can
418
+ # modify responses for requests made with _unencumbered_ macaroons!
419
+ rpc :RegisterRPCMiddleware, stream(::Lnrpc::RPCMiddlewareResponse), stream(::Lnrpc::RPCMiddlewareRequest)
420
+ # lncli: `sendcustom`
421
+ # SendCustomMessage sends a custom peer message.
422
+ rpc :SendCustomMessage, ::Lnrpc::SendCustomMessageRequest, ::Lnrpc::SendCustomMessageResponse
423
+ # lncli: `subscribecustom`
424
+ # SubscribeCustomMessages subscribes to a stream of incoming custom peer
425
+ # messages.
426
+ #
427
+ # To include messages with type outside of the custom range (>= 32768) lnd
428
+ # needs to be compiled with the `dev` build tag, and the message type to
429
+ # override should be specified in lnd's experimental protocol configuration.
430
+ rpc :SubscribeCustomMessages, ::Lnrpc::SubscribeCustomMessagesRequest, stream(::Lnrpc::CustomMessage)
431
+ # lncli: `listaliases`
432
+ # ListAliases returns the set of all aliases that have ever existed with
433
+ # their confirmed SCID (if it exists) and/or the base SCID (in the case of
434
+ # zero conf).
435
+ rpc :ListAliases, ::Lnrpc::ListAliasesRequest, ::Lnrpc::ListAliasesResponse
436
+ rpc :LookupHtlc, ::Lnrpc::LookupHtlcRequest, ::Lnrpc::LookupHtlcResponse
437
+ end
438
+
439
+ Stub = Service.rpc_stub_class
440
+ end
441
+ end
@@ -0,0 +1,19 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: lnclipb/lncli.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require_relative 'verrpc/verrpc_pb'
7
+
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("lnclipb/lncli.proto", :syntax => :proto3) do
10
+ add_message "lnclipb.VersionResponse" do
11
+ optional :lncli, :message, 1, "verrpc.Version"
12
+ optional :lnd, :message, 2, "verrpc.Version"
13
+ end
14
+ end
15
+ end
16
+
17
+ module Lnclipb
18
+ VersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnclipb.VersionResponse").msgclass
19
+ end
@@ -0,0 +1,106 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: neutrinorpc/neutrino.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("neutrinorpc/neutrino.proto", :syntax => :proto3) do
8
+ add_message "neutrinorpc.StatusRequest" do
9
+ end
10
+ add_message "neutrinorpc.StatusResponse" do
11
+ optional :active, :bool, 1
12
+ optional :synced, :bool, 2
13
+ optional :block_height, :int32, 3
14
+ optional :block_hash, :string, 4
15
+ repeated :peers, :string, 5
16
+ end
17
+ add_message "neutrinorpc.AddPeerRequest" do
18
+ optional :peer_addrs, :string, 1
19
+ end
20
+ add_message "neutrinorpc.AddPeerResponse" do
21
+ end
22
+ add_message "neutrinorpc.DisconnectPeerRequest" do
23
+ optional :peer_addrs, :string, 1
24
+ end
25
+ add_message "neutrinorpc.DisconnectPeerResponse" do
26
+ end
27
+ add_message "neutrinorpc.IsBannedRequest" do
28
+ optional :peer_addrs, :string, 1
29
+ end
30
+ add_message "neutrinorpc.IsBannedResponse" do
31
+ optional :banned, :bool, 1
32
+ end
33
+ add_message "neutrinorpc.GetBlockHeaderRequest" do
34
+ optional :hash, :string, 1
35
+ end
36
+ add_message "neutrinorpc.GetBlockHeaderResponse" do
37
+ optional :hash, :string, 1
38
+ optional :confirmations, :int64, 2
39
+ optional :stripped_size, :int64, 3
40
+ optional :size, :int64, 4
41
+ optional :weight, :int64, 5
42
+ optional :height, :int32, 6
43
+ optional :version, :int32, 7
44
+ optional :version_hex, :string, 8
45
+ optional :merkleroot, :string, 9
46
+ optional :time, :int64, 10
47
+ optional :nonce, :uint32, 11
48
+ optional :bits, :string, 12
49
+ optional :ntx, :int32, 13
50
+ optional :previous_block_hash, :string, 14
51
+ optional :raw_hex, :bytes, 15
52
+ end
53
+ add_message "neutrinorpc.GetBlockRequest" do
54
+ optional :hash, :string, 1
55
+ end
56
+ add_message "neutrinorpc.GetBlockResponse" do
57
+ optional :hash, :string, 1
58
+ optional :confirmations, :int64, 2
59
+ optional :stripped_size, :int64, 3
60
+ optional :size, :int64, 4
61
+ optional :weight, :int64, 5
62
+ optional :height, :int32, 6
63
+ optional :version, :int32, 7
64
+ optional :version_hex, :string, 8
65
+ optional :merkleroot, :string, 9
66
+ repeated :tx, :string, 10
67
+ optional :time, :int64, 11
68
+ optional :nonce, :uint32, 12
69
+ optional :bits, :string, 13
70
+ optional :ntx, :int32, 14
71
+ optional :previous_block_hash, :string, 15
72
+ optional :raw_hex, :bytes, 16
73
+ end
74
+ add_message "neutrinorpc.GetCFilterRequest" do
75
+ optional :hash, :string, 1
76
+ end
77
+ add_message "neutrinorpc.GetCFilterResponse" do
78
+ optional :filter, :bytes, 1
79
+ end
80
+ add_message "neutrinorpc.GetBlockHashRequest" do
81
+ optional :height, :int32, 1
82
+ end
83
+ add_message "neutrinorpc.GetBlockHashResponse" do
84
+ optional :hash, :string, 1
85
+ end
86
+ end
87
+ end
88
+
89
+ module Neutrinorpc
90
+ StatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.StatusRequest").msgclass
91
+ StatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.StatusResponse").msgclass
92
+ AddPeerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.AddPeerRequest").msgclass
93
+ AddPeerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.AddPeerResponse").msgclass
94
+ DisconnectPeerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.DisconnectPeerRequest").msgclass
95
+ DisconnectPeerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.DisconnectPeerResponse").msgclass
96
+ IsBannedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.IsBannedRequest").msgclass
97
+ IsBannedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.IsBannedResponse").msgclass
98
+ GetBlockHeaderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockHeaderRequest").msgclass
99
+ GetBlockHeaderResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockHeaderResponse").msgclass
100
+ GetBlockRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockRequest").msgclass
101
+ GetBlockResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockResponse").msgclass
102
+ GetCFilterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetCFilterRequest").msgclass
103
+ GetCFilterResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetCFilterResponse").msgclass
104
+ GetBlockHashRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockHashRequest").msgclass
105
+ GetBlockHashResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("neutrinorpc.GetBlockHashResponse").msgclass
106
+ end
@@ -0,0 +1,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: neutrinorpc/neutrino.proto for package 'neutrinorpc'
3
+
4
+ require 'grpc'
5
+ require_relative 'neutrinorpc/neutrino_pb'
6
+
7
+ module Neutrinorpc
8
+ module NeutrinoKit
9
+ # NeutrinoKit is a service that can be used to get information about the
10
+ # current state of the neutrino instance, fetch blocks and add/remove peers.
11
+ class Service
12
+
13
+ include ::GRPC::GenericService
14
+
15
+ self.marshal_class_method = :encode
16
+ self.unmarshal_class_method = :decode
17
+ self.service_name = 'neutrinorpc.NeutrinoKit'
18
+
19
+ #
20
+ # Status returns the status of the light client neutrino instance,
21
+ # along with height and hash of the best block, and a list of connected
22
+ # peers.
23
+ rpc :Status, ::Neutrinorpc::StatusRequest, ::Neutrinorpc::StatusResponse
24
+ #
25
+ # AddPeer adds a new peer that has already been connected to the server.
26
+ rpc :AddPeer, ::Neutrinorpc::AddPeerRequest, ::Neutrinorpc::AddPeerResponse
27
+ #
28
+ # DisconnectPeer disconnects a peer by target address. Both outbound and
29
+ # inbound nodes will be searched for the target node. An error message will
30
+ # be returned if the peer was not found.
31
+ rpc :DisconnectPeer, ::Neutrinorpc::DisconnectPeerRequest, ::Neutrinorpc::DisconnectPeerResponse
32
+ #
33
+ # IsBanned returns true if the peer is banned, otherwise false.
34
+ rpc :IsBanned, ::Neutrinorpc::IsBannedRequest, ::Neutrinorpc::IsBannedResponse
35
+ #
36
+ # GetBlockHeader returns a block header with a particular block hash.
37
+ rpc :GetBlockHeader, ::Neutrinorpc::GetBlockHeaderRequest, ::Neutrinorpc::GetBlockHeaderResponse
38
+ #
39
+ # GetBlock returns a block with a particular block hash.
40
+ rpc :GetBlock, ::Neutrinorpc::GetBlockRequest, ::Neutrinorpc::GetBlockResponse
41
+ #
42
+ # GetCFilter returns a compact filter from a block.
43
+ rpc :GetCFilter, ::Neutrinorpc::GetCFilterRequest, ::Neutrinorpc::GetCFilterResponse
44
+ #
45
+ # GetBlockHash returns the header hash of a block at a given height.
46
+ rpc :GetBlockHash, ::Neutrinorpc::GetBlockHashRequest, ::Neutrinorpc::GetBlockHashResponse
47
+ end
48
+
49
+ Stub = Service.rpc_stub_class
50
+ end
51
+ end
@@ -0,0 +1,48 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: peersrpc/peers.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require_relative 'lightning_pb'
7
+
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_file("peersrpc/peers.proto", :syntax => :proto3) do
10
+ add_message "peersrpc.UpdateAddressAction" do
11
+ optional :action, :enum, 1, "peersrpc.UpdateAction"
12
+ optional :address, :string, 2
13
+ end
14
+ add_message "peersrpc.UpdateFeatureAction" do
15
+ optional :action, :enum, 1, "peersrpc.UpdateAction"
16
+ optional :feature_bit, :enum, 2, "lnrpc.FeatureBit"
17
+ end
18
+ add_message "peersrpc.NodeAnnouncementUpdateRequest" do
19
+ repeated :feature_updates, :message, 1, "peersrpc.UpdateFeatureAction"
20
+ optional :color, :string, 2
21
+ optional :alias, :string, 3
22
+ repeated :address_updates, :message, 4, "peersrpc.UpdateAddressAction"
23
+ end
24
+ add_message "peersrpc.NodeAnnouncementUpdateResponse" do
25
+ repeated :ops, :message, 1, "lnrpc.Op"
26
+ end
27
+ add_enum "peersrpc.UpdateAction" do
28
+ value :ADD, 0
29
+ value :REMOVE, 1
30
+ end
31
+ add_enum "peersrpc.FeatureSet" do
32
+ value :SET_INIT, 0
33
+ value :SET_LEGACY_GLOBAL, 1
34
+ value :SET_NODE_ANN, 2
35
+ value :SET_INVOICE, 3
36
+ value :SET_INVOICE_AMP, 4
37
+ end
38
+ end
39
+ end
40
+
41
+ module Peersrpc
42
+ UpdateAddressAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.UpdateAddressAction").msgclass
43
+ UpdateFeatureAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.UpdateFeatureAction").msgclass
44
+ NodeAnnouncementUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.NodeAnnouncementUpdateRequest").msgclass
45
+ NodeAnnouncementUpdateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.NodeAnnouncementUpdateResponse").msgclass
46
+ UpdateAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.UpdateAction").enummodule
47
+ FeatureSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("peersrpc.FeatureSet").enummodule
48
+ end