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
@@ -2,19 +2,15 @@
2
2
  # Source: rpc.proto for package 'lnrpc'
3
3
 
4
4
  require 'grpc'
5
- require_relative 'rpc_pb'
5
+ require 'rpc_pb'
6
6
 
7
7
  module Lnrpc
8
- module WalletUnlocker
9
- # *
8
+ module Lightning
9
+ #
10
10
  # Comments in this file will be directly parsed into the API
11
11
  # Documentation as descriptions of the associated method, message, or field.
12
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.
13
+ # can be in either block or // comment format.
18
14
  #
19
15
  # An RPC method can be matched to an lncli command by placing a line in the
20
16
  # beginning of the description in exactly the following format:
@@ -27,175 +23,160 @@ module Lnrpc
27
23
  # this proto file can be found here:
28
24
  # https://github.com/lightninglabs/lightning-api
29
25
  #
30
- # The WalletUnlocker service is used to set up a wallet password for
31
- # lnd at first startup, and unlock a previously set up wallet.
32
- class Service
33
-
34
- include GRPC::GenericService
35
-
36
- self.marshal_class_method = :encode
37
- self.unmarshal_class_method = :decode
38
- self.service_name = 'lnrpc.WalletUnlocker'
39
-
40
- # *
41
- # GenSeed is the first method that should be used to instantiate a new lnd
42
- # instance. This method allows a caller to generate a new aezeed cipher seed
43
- # given an optional passphrase. If provided, the passphrase will be necessary
44
- # to decrypt the cipherseed to expose the internal wallet seed.
45
- #
46
- # Once the cipherseed is obtained and verified by the user, the InitWallet
47
- # method should be used to commit the newly generated seed, and create the
48
- # wallet.
49
- rpc :GenSeed, GenSeedRequest, GenSeedResponse
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
- rpc :InitWallet, InitWalletRequest, InitWalletResponse
64
- # * lncli: `unlock`
65
- # UnlockWallet is used at startup of lnd to provide a password to unlock
66
- # the wallet database.
67
- rpc :UnlockWallet, UnlockWalletRequest, UnlockWalletResponse
68
- # * lncli: `changepassword`
69
- # ChangePassword changes the password of the encrypted wallet. This will
70
- # automatically unlock the wallet database if successful.
71
- rpc :ChangePassword, ChangePasswordRequest, ChangePasswordResponse
72
- end
73
-
74
- Stub = Service.rpc_stub_class
75
- end
76
- module Lightning
26
+ # Lightning is the main RPC server of the daemon.
77
27
  class Service
78
28
 
79
- include GRPC::GenericService
29
+ include ::GRPC::GenericService
80
30
 
81
31
  self.marshal_class_method = :encode
82
32
  self.unmarshal_class_method = :decode
83
33
  self.service_name = 'lnrpc.Lightning'
84
34
 
85
- # * lncli: `walletbalance`
35
+ # lncli: `walletbalance`
86
36
  # WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
87
37
  # confirmed unspent outputs and all unconfirmed unspent outputs under control
88
38
  # of the wallet.
89
- rpc :WalletBalance, WalletBalanceRequest, WalletBalanceResponse
90
- # * lncli: `channelbalance`
91
- # ChannelBalance returns the total funds available across all open channels
92
- # in satoshis.
93
- rpc :ChannelBalance, ChannelBalanceRequest, ChannelBalanceResponse
94
- # * lncli: `listchaintxns`
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`
95
46
  # GetTransactions returns a list describing all the known transactions
96
47
  # relevant to the wallet.
97
- rpc :GetTransactions, GetTransactionsRequest, TransactionDetails
98
- # * lncli: `estimatefee`
48
+ rpc :GetTransactions, ::Lnrpc::GetTransactionsRequest, ::Lnrpc::TransactionDetails
49
+ # lncli: `estimatefee`
99
50
  # EstimateFee asks the chain backend to estimate the fee rate and total fees
100
51
  # for a transaction that pays to multiple specified outputs.
101
- rpc :EstimateFee, EstimateFeeRequest, EstimateFeeResponse
102
- # * lncli: `sendcoins`
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`
103
59
  # SendCoins executes a request to send coins to a particular address. Unlike
104
60
  # SendMany, this RPC call only allows creating a single output at a time. If
105
61
  # neither target_conf, or sat_per_byte are set, then the internal wallet will
106
62
  # consult its fee model to determine a fee for the default confirmation
107
63
  # target.
108
- rpc :SendCoins, SendCoinsRequest, SendCoinsResponse
109
- # * lncli: `listunspent`
64
+ rpc :SendCoins, ::Lnrpc::SendCoinsRequest, ::Lnrpc::SendCoinsResponse
65
+ # lncli: `listunspent`
66
+ # Deprecated, use walletrpc.ListUnspent instead.
67
+ #
110
68
  # ListUnspent returns a list of all utxos spendable by the wallet with a
111
69
  # number of confirmations between the specified minimum and maximum.
112
- rpc :ListUnspent, ListUnspentRequest, ListUnspentResponse
113
- # *
70
+ rpc :ListUnspent, ::Lnrpc::ListUnspentRequest, ::Lnrpc::ListUnspentResponse
71
+ #
114
72
  # SubscribeTransactions creates a uni-directional stream from the server to
115
73
  # the client in which any newly discovered transactions relevant to the
116
74
  # wallet are sent over.
117
- rpc :SubscribeTransactions, GetTransactionsRequest, stream(Transaction)
118
- # * lncli: `sendmany`
75
+ rpc :SubscribeTransactions, ::Lnrpc::GetTransactionsRequest, stream(::Lnrpc::Transaction)
76
+ # lncli: `sendmany`
119
77
  # SendMany handles a request for a transaction that creates multiple specified
120
78
  # outputs in parallel. If neither target_conf, or sat_per_byte are set, then
121
79
  # the internal wallet will consult its fee model to determine a fee for the
122
80
  # default confirmation target.
123
- rpc :SendMany, SendManyRequest, SendManyResponse
124
- # * lncli: `newaddress`
81
+ rpc :SendMany, ::Lnrpc::SendManyRequest, ::Lnrpc::SendManyResponse
82
+ # lncli: `newaddress`
125
83
  # NewAddress creates a new address under control of the local wallet.
126
- rpc :NewAddress, NewAddressRequest, NewAddressResponse
127
- # * lncli: `signmessage`
84
+ rpc :NewAddress, ::Lnrpc::NewAddressRequest, ::Lnrpc::NewAddressResponse
85
+ # lncli: `signmessage`
128
86
  # SignMessage signs a message with this node's private key. The returned
129
87
  # signature string is `zbase32` encoded and pubkey recoverable, meaning that
130
88
  # only the message digest and signature are needed for verification.
131
- rpc :SignMessage, SignMessageRequest, SignMessageResponse
132
- # * lncli: `verifymessage`
89
+ rpc :SignMessage, ::Lnrpc::SignMessageRequest, ::Lnrpc::SignMessageResponse
90
+ # lncli: `verifymessage`
133
91
  # VerifyMessage verifies a signature over a msg. The signature must be
134
92
  # zbase32 encoded and signed by an active node in the resident node's
135
93
  # channel database. In addition to returning the validity of the signature,
136
94
  # VerifyMessage also returns the recovered pubkey from the signature.
137
- rpc :VerifyMessage, VerifyMessageRequest, VerifyMessageResponse
138
- # * lncli: `connect`
95
+ rpc :VerifyMessage, ::Lnrpc::VerifyMessageRequest, ::Lnrpc::VerifyMessageResponse
96
+ # lncli: `connect`
139
97
  # ConnectPeer attempts to establish a connection to a remote peer. This is at
140
98
  # the networking level, and is used for communication between nodes. This is
141
99
  # distinct from establishing a channel with a peer.
142
- rpc :ConnectPeer, ConnectPeerRequest, ConnectPeerResponse
143
- # * lncli: `disconnect`
100
+ rpc :ConnectPeer, ::Lnrpc::ConnectPeerRequest, ::Lnrpc::ConnectPeerResponse
101
+ # lncli: `disconnect`
144
102
  # DisconnectPeer attempts to disconnect one peer from another identified by a
145
103
  # given pubKey. In the case that we currently have a pending or active channel
146
104
  # with the target peer, then this action will be not be allowed.
147
- rpc :DisconnectPeer, DisconnectPeerRequest, DisconnectPeerResponse
148
- # * lncli: `listpeers`
105
+ rpc :DisconnectPeer, ::Lnrpc::DisconnectPeerRequest, ::Lnrpc::DisconnectPeerResponse
106
+ # lncli: `listpeers`
149
107
  # ListPeers returns a verbose listing of all currently active peers.
150
- rpc :ListPeers, ListPeersRequest, ListPeersResponse
151
- # * lncli: `getinfo`
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`
152
115
  # GetInfo returns general information concerning the lightning node including
153
116
  # it's identity pubkey, alias, the chains it is connected to, and information
154
117
  # concerning the number of open+pending channels.
155
- rpc :GetInfo, GetInfoRequest, GetInfoResponse
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
156
124
  # TODO(roasbeef): merge with below with bool?
157
125
  #
158
- # * lncli: `pendingchannels`
126
+ # lncli: `pendingchannels`
159
127
  # PendingChannels returns a list of all the channels that are currently
160
128
  # considered "pending". A channel is pending if it has finished the funding
161
129
  # workflow and is waiting for confirmations for the funding txn, or is in the
162
130
  # process of closure, either initiated cooperatively or non-cooperatively.
163
- rpc :PendingChannels, PendingChannelsRequest, PendingChannelsResponse
164
- # * lncli: `listchannels`
131
+ rpc :PendingChannels, ::Lnrpc::PendingChannelsRequest, ::Lnrpc::PendingChannelsResponse
132
+ # lncli: `listchannels`
165
133
  # ListChannels returns a description of all the open channels that this node
166
134
  # is a participant in.
167
- rpc :ListChannels, ListChannelsRequest, ListChannelsResponse
168
- # *
135
+ rpc :ListChannels, ::Lnrpc::ListChannelsRequest, ::Lnrpc::ListChannelsResponse
136
+ #
169
137
  # SubscribeChannelEvents creates a uni-directional stream from the server to
170
138
  # the client in which any updates relevant to the state of the channels are
171
139
  # sent over. Events include new active channels, inactive channels, and closed
172
140
  # channels.
173
- rpc :SubscribeChannelEvents, ChannelEventSubscription, stream(ChannelEventUpdate)
174
- # * lncli: `closedchannels`
141
+ rpc :SubscribeChannelEvents, ::Lnrpc::ChannelEventSubscription, stream(::Lnrpc::ChannelEventUpdate)
142
+ # lncli: `closedchannels`
175
143
  # ClosedChannels returns a description of all the closed channels that
176
144
  # this node was a participant in.
177
- rpc :ClosedChannels, ClosedChannelsRequest, ClosedChannelsResponse
178
- # *
145
+ rpc :ClosedChannels, ::Lnrpc::ClosedChannelsRequest, ::Lnrpc::ClosedChannelsResponse
146
+ #
179
147
  # OpenChannelSync is a synchronous version of the OpenChannel RPC call. This
180
148
  # call is meant to be consumed by clients to the REST proxy. As with all
181
149
  # other sync calls, all byte slices are intended to be populated as hex
182
150
  # encoded strings.
183
- rpc :OpenChannelSync, OpenChannelRequest, ChannelPoint
184
- # * lncli: `openchannel`
151
+ rpc :OpenChannelSync, ::Lnrpc::OpenChannelRequest, ::Lnrpc::ChannelPoint
152
+ # lncli: `openchannel`
185
153
  # OpenChannel attempts to open a singly funded channel specified in the
186
154
  # request to a remote peer. Users are able to specify a target number of
187
155
  # blocks that the funding transaction should be confirmed in, or a manual fee
188
156
  # rate to us for the funding transaction. If neither are specified, then a
189
- # lax block confirmation target is used.
190
- rpc :OpenChannel, OpenChannelRequest, stream(OpenStatusUpdate)
191
- # *
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
+ #
163
+ # FundingStateStep is an advanced funding related call that allows the caller
164
+ # to either execute some preparatory steps for a funding workflow, or
165
+ # manually progress a funding workflow. The primary way a funding flow is
166
+ # identified is via its pending channel ID. As an example, this method can be
167
+ # used to specify that we're expecting a funding flow for a particular
168
+ # pending channel ID, for which we need to use specific parameters.
169
+ # Alternatively, this can be used to interactively drive PSBT signing for
170
+ # funding for partially complete funding transactions.
171
+ rpc :FundingStateStep, ::Lnrpc::FundingTransitionMsg, ::Lnrpc::FundingStateStepResp
172
+ #
192
173
  # ChannelAcceptor dispatches a bi-directional streaming RPC in which
193
174
  # OpenChannel requests are sent to the client and the client responds with
194
175
  # a boolean that tells LND whether or not to accept the channel. This allows
195
176
  # node operators to specify their own criteria for accepting inbound channels
196
177
  # through a single persistent connection.
197
- rpc :ChannelAcceptor, stream(ChannelAcceptResponse), stream(ChannelAcceptRequest)
198
- # * lncli: `closechannel`
178
+ rpc :ChannelAcceptor, stream(::Lnrpc::ChannelAcceptResponse), stream(::Lnrpc::ChannelAcceptRequest)
179
+ # lncli: `closechannel`
199
180
  # CloseChannel attempts to close an active channel identified by its channel
200
181
  # outpoint (ChannelPoint). The actions of this method can additionally be
201
182
  # augmented to attempt a force close after a timeout period in the case of an
@@ -203,41 +184,45 @@ module Lnrpc
203
184
  # then the user can specify either a target number of blocks until the
204
185
  # closure transaction is confirmed, or a manual fee rate. If neither are
205
186
  # specified, then a default lax, block confirmation target is used.
206
- rpc :CloseChannel, CloseChannelRequest, stream(CloseStatusUpdate)
207
- # * lncli: `abandonchannel`
187
+ rpc :CloseChannel, ::Lnrpc::CloseChannelRequest, stream(::Lnrpc::CloseStatusUpdate)
188
+ # lncli: `abandonchannel`
208
189
  # AbandonChannel removes all channel state from the database except for a
209
190
  # close summary. This method can be used to get rid of permanently unusable
210
- # channels due to bugs fixed in newer versions of lnd. Only available
211
- # when in debug builds of lnd.
212
- rpc :AbandonChannel, AbandonChannelRequest, AbandonChannelResponse
213
- # * lncli: `sendpayment`
214
- # SendPayment dispatches a bi-directional streaming RPC for sending payments
215
- # through the Lightning Network. A single RPC invocation creates a persistent
216
- # bi-directional stream allowing clients to rapidly send payments through the
217
- # Lightning Network with a single persistent connection.
218
- rpc :SendPayment, stream(SendRequest), stream(SendResponse)
219
- # *
191
+ # channels due to bugs fixed in newer versions of lnd. This method can also be
192
+ # used to remove externally funded channels where the funding transaction was
193
+ # never broadcast. Only available for non-externally funded channels in dev
194
+ # build.
195
+ rpc :AbandonChannel, ::Lnrpc::AbandonChannelRequest, ::Lnrpc::AbandonChannelResponse
196
+ # lncli: `sendpayment`
197
+ # Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a
198
+ # bi-directional streaming RPC for sending payments through the Lightning
199
+ # Network. A single RPC invocation creates a persistent bi-directional
200
+ # stream allowing clients to rapidly send payments through the Lightning
201
+ # Network with a single persistent connection.
202
+ rpc :SendPayment, stream(::Lnrpc::SendRequest), stream(::Lnrpc::SendResponse)
203
+ #
220
204
  # SendPaymentSync is the synchronous non-streaming version of SendPayment.
221
205
  # This RPC is intended to be consumed by clients of the REST proxy.
222
206
  # Additionally, this RPC expects the destination's public key and the payment
223
207
  # hash (if any) to be encoded as hex strings.
224
- rpc :SendPaymentSync, SendRequest, SendResponse
225
- # * lncli: `sendtoroute`
226
- # SendToRoute is a bi-directional streaming RPC for sending payment through
227
- # the Lightning Network. This method differs from SendPayment in that it
228
- # allows users to specify a full route manually. This can be used for things
229
- # like rebalancing, and atomic swaps.
230
- rpc :SendToRoute, stream(SendToRouteRequest), stream(SendResponse)
231
- # *
208
+ rpc :SendPaymentSync, ::Lnrpc::SendRequest, ::Lnrpc::SendResponse
209
+ # lncli: `sendtoroute`
210
+ # Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional
211
+ # streaming RPC for sending payment through the Lightning Network. This
212
+ # method differs from SendPayment in that it allows users to specify a full
213
+ # route manually. This can be used for things like rebalancing, and atomic
214
+ # swaps.
215
+ rpc :SendToRoute, stream(::Lnrpc::SendToRouteRequest), stream(::Lnrpc::SendResponse)
216
+ #
232
217
  # SendToRouteSync is a synchronous version of SendToRoute. It Will block
233
218
  # until the payment either fails or succeeds.
234
- rpc :SendToRouteSync, SendToRouteRequest, SendResponse
235
- # * lncli: `addinvoice`
219
+ rpc :SendToRouteSync, ::Lnrpc::SendToRouteRequest, ::Lnrpc::SendResponse
220
+ # lncli: `addinvoice`
236
221
  # AddInvoice attempts to add a new invoice to the invoice database. Any
237
222
  # duplicated invoices are rejected, therefore all invoices *must* have a
238
223
  # unique payment preimage.
239
- rpc :AddInvoice, Invoice, AddInvoiceResponse
240
- # * lncli: `listinvoices`
224
+ rpc :AddInvoice, ::Lnrpc::Invoice, ::Lnrpc::AddInvoiceResponse
225
+ # lncli: `listinvoices`
241
226
  # ListInvoices returns a list of all the invoices currently stored within the
242
227
  # database. Any active debug invoices are ignored. It has full support for
243
228
  # paginated responses, allowing users to query for specific invoices through
@@ -245,90 +230,99 @@ module Lnrpc
245
230
  # last_index_offset fields included in the response as the index_offset of the
246
231
  # next request. By default, the first 100 invoices created will be returned.
247
232
  # Backwards pagination is also supported through the Reversed flag.
248
- rpc :ListInvoices, ListInvoiceRequest, ListInvoiceResponse
249
- # * lncli: `lookupinvoice`
233
+ rpc :ListInvoices, ::Lnrpc::ListInvoiceRequest, ::Lnrpc::ListInvoiceResponse
234
+ # lncli: `lookupinvoice`
250
235
  # LookupInvoice attempts to look up an invoice according to its payment hash.
251
236
  # The passed payment hash *must* be exactly 32 bytes, if not, an error is
252
237
  # returned.
253
- rpc :LookupInvoice, PaymentHash, Invoice
254
- # *
238
+ rpc :LookupInvoice, ::Lnrpc::PaymentHash, ::Lnrpc::Invoice
239
+ #
255
240
  # SubscribeInvoices returns a uni-directional stream (server -> client) for
256
241
  # notifying the client of newly added/settled invoices. The caller can
257
242
  # optionally specify the add_index and/or the settle_index. If the add_index
258
243
  # is specified, then we'll first start by sending add invoice events for all
259
- # invoices with an add_index greater than the specified value. If the
244
+ # invoices with an add_index greater than the specified value. If the
260
245
  # settle_index is specified, the next, we'll send out all settle events for
261
- # invoices with a settle_index greater than the specified value. One or both
246
+ # invoices with a settle_index greater than the specified value. One or both
262
247
  # of these fields can be set. If no fields are set, then we'll only send out
263
248
  # the latest add/settle events.
264
- rpc :SubscribeInvoices, InvoiceSubscription, stream(Invoice)
265
- # * lncli: `decodepayreq`
249
+ rpc :SubscribeInvoices, ::Lnrpc::InvoiceSubscription, stream(::Lnrpc::Invoice)
250
+ # lncli: `decodepayreq`
266
251
  # DecodePayReq takes an encoded payment request string and attempts to decode
267
252
  # it, returning a full description of the conditions encoded within the
268
253
  # payment request.
269
- rpc :DecodePayReq, PayReqString, PayReq
270
- # * lncli: `listpayments`
254
+ rpc :DecodePayReq, ::Lnrpc::PayReqString, ::Lnrpc::PayReq
255
+ # lncli: `listpayments`
271
256
  # ListPayments returns a list of all outgoing payments.
272
- rpc :ListPayments, ListPaymentsRequest, ListPaymentsResponse
273
- # *
257
+ rpc :ListPayments, ::Lnrpc::ListPaymentsRequest, ::Lnrpc::ListPaymentsResponse
258
+ #
274
259
  # DeleteAllPayments deletes all outgoing payments from DB.
275
- rpc :DeleteAllPayments, DeleteAllPaymentsRequest, DeleteAllPaymentsResponse
276
- # * lncli: `describegraph`
260
+ rpc :DeleteAllPayments, ::Lnrpc::DeleteAllPaymentsRequest, ::Lnrpc::DeleteAllPaymentsResponse
261
+ # lncli: `describegraph`
277
262
  # DescribeGraph returns a description of the latest graph state from the
278
263
  # point of view of the node. The graph information is partitioned into two
279
264
  # components: all the nodes/vertexes, and all the edges that connect the
280
- # vertexes themselves. As this is a directed graph, the edges also contain
265
+ # vertexes themselves. As this is a directed graph, the edges also contain
281
266
  # the node directional specific routing policy which includes: the time lock
282
267
  # delta, fee information, etc.
283
- rpc :DescribeGraph, ChannelGraphRequest, ChannelGraph
284
- # * lncli: `getchaninfo`
268
+ rpc :DescribeGraph, ::Lnrpc::ChannelGraphRequest, ::Lnrpc::ChannelGraph
269
+ # lncli: `getnodemetrics`
270
+ # GetNodeMetrics returns node metrics calculated from the graph. Currently
271
+ # the only supported metric is betweenness centrality of individual nodes.
272
+ rpc :GetNodeMetrics, ::Lnrpc::NodeMetricsRequest, ::Lnrpc::NodeMetricsResponse
273
+ # lncli: `getchaninfo`
285
274
  # GetChanInfo returns the latest authenticated network announcement for the
286
275
  # given channel identified by its channel ID: an 8-byte integer which
287
276
  # uniquely identifies the location of transaction's funding output within the
288
277
  # blockchain.
289
- rpc :GetChanInfo, ChanInfoRequest, ChannelEdge
290
- # * lncli: `getnodeinfo`
278
+ rpc :GetChanInfo, ::Lnrpc::ChanInfoRequest, ::Lnrpc::ChannelEdge
279
+ # lncli: `getnodeinfo`
291
280
  # GetNodeInfo returns the latest advertised, aggregated, and authenticated
292
281
  # channel information for the specified node identified by its public key.
293
- rpc :GetNodeInfo, NodeInfoRequest, NodeInfo
294
- # * lncli: `queryroutes`
282
+ rpc :GetNodeInfo, ::Lnrpc::NodeInfoRequest, ::Lnrpc::NodeInfo
283
+ # lncli: `queryroutes`
295
284
  # QueryRoutes attempts to query the daemon's Channel Router for a possible
296
285
  # route to a target destination capable of carrying a specific amount of
297
286
  # satoshis. The returned route contains the full details required to craft and
298
287
  # send an HTLC, also including the necessary information that should be
299
288
  # present within the Sphinx packet encapsulated within the HTLC.
300
- rpc :QueryRoutes, QueryRoutesRequest, QueryRoutesResponse
301
- # * lncli: `getnetworkinfo`
289
+ #
290
+ # When using REST, the `dest_custom_records` map type can be set by appending
291
+ # `&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
292
+ # to the URL. Unfortunately this map type doesn't appear in the REST API
293
+ # documentation because of a bug in the grpc-gateway library.
294
+ rpc :QueryRoutes, ::Lnrpc::QueryRoutesRequest, ::Lnrpc::QueryRoutesResponse
295
+ # lncli: `getnetworkinfo`
302
296
  # GetNetworkInfo returns some basic stats about the known channel graph from
303
297
  # the point of view of the node.
304
- rpc :GetNetworkInfo, NetworkInfoRequest, NetworkInfo
305
- # * lncli: `stop`
298
+ rpc :GetNetworkInfo, ::Lnrpc::NetworkInfoRequest, ::Lnrpc::NetworkInfo
299
+ # lncli: `stop`
306
300
  # StopDaemon will send a shutdown request to the interrupt handler, triggering
307
301
  # a graceful shutdown of the daemon.
308
- rpc :StopDaemon, StopRequest, StopResponse
309
- # *
302
+ rpc :StopDaemon, ::Lnrpc::StopRequest, ::Lnrpc::StopResponse
303
+ #
310
304
  # SubscribeChannelGraph launches a streaming RPC that allows the caller to
311
305
  # receive notifications upon any changes to the channel graph topology from
312
306
  # the point of view of the responding node. Events notified include: new
313
307
  # nodes coming online, nodes updating their authenticated attributes, new
314
308
  # channels being advertised, updates in the routing policy for a directional
315
309
  # channel edge, and when channels are closed on-chain.
316
- rpc :SubscribeChannelGraph, GraphTopologySubscription, stream(GraphTopologyUpdate)
317
- # * lncli: `debuglevel`
310
+ rpc :SubscribeChannelGraph, ::Lnrpc::GraphTopologySubscription, stream(::Lnrpc::GraphTopologyUpdate)
311
+ # lncli: `debuglevel`
318
312
  # DebugLevel allows a caller to programmatically set the logging verbosity of
319
313
  # lnd. The logging can be targeted according to a coarse daemon-wide logging
320
314
  # level, or in a granular fashion to specify the logging for a target
321
315
  # sub-system.
322
- rpc :DebugLevel, DebugLevelRequest, DebugLevelResponse
323
- # * lncli: `feereport`
316
+ rpc :DebugLevel, ::Lnrpc::DebugLevelRequest, ::Lnrpc::DebugLevelResponse
317
+ # lncli: `feereport`
324
318
  # FeeReport allows the caller to obtain a report detailing the current fee
325
319
  # schedule enforced by the node globally for each channel.
326
- rpc :FeeReport, FeeReportRequest, FeeReportResponse
327
- # * lncli: `updatechanpolicy`
320
+ rpc :FeeReport, ::Lnrpc::FeeReportRequest, ::Lnrpc::FeeReportResponse
321
+ # lncli: `updatechanpolicy`
328
322
  # UpdateChannelPolicy allows the caller to update the fee schedule and
329
323
  # channel policies for all channels globally, or a particular channel.
330
- rpc :UpdateChannelPolicy, PolicyUpdateRequest, PolicyUpdateResponse
331
- # * lncli: `fwdinghistory`
324
+ rpc :UpdateChannelPolicy, ::Lnrpc::PolicyUpdateRequest, ::Lnrpc::PolicyUpdateResponse
325
+ # lncli: `fwdinghistory`
332
326
  # ForwardingHistory allows the caller to query the htlcswitch for a record of
333
327
  # all HTLCs forwarded within the target time range, and integer offset
334
328
  # within that time range. If no time-range is specified, then the first chunk
@@ -336,37 +330,37 @@ module Lnrpc
336
330
  #
337
331
  # A list of forwarding events are returned. The size of each forwarding event
338
332
  # is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB.
339
- # As a result each message can only contain 50k entries. Each response has
333
+ # As a result each message can only contain 50k entries. Each response has
340
334
  # the index offset of the last entry. The index offset can be provided to the
341
335
  # request to allow the caller to skip a series of records.
342
- rpc :ForwardingHistory, ForwardingHistoryRequest, ForwardingHistoryResponse
343
- # * lncli: `exportchanbackup`
336
+ rpc :ForwardingHistory, ::Lnrpc::ForwardingHistoryRequest, ::Lnrpc::ForwardingHistoryResponse
337
+ # lncli: `exportchanbackup`
344
338
  # ExportChannelBackup attempts to return an encrypted static channel backup
345
339
  # for the target channel identified by it channel point. The backup is
346
340
  # encrypted with a key generated from the aezeed seed of the user. The
347
341
  # returned backup can either be restored using the RestoreChannelBackup
348
342
  # method once lnd is running, or via the InitWallet and UnlockWallet methods
349
343
  # from the WalletUnlocker service.
350
- rpc :ExportChannelBackup, ExportChannelBackupRequest, ChannelBackup
351
- # *
344
+ rpc :ExportChannelBackup, ::Lnrpc::ExportChannelBackupRequest, ::Lnrpc::ChannelBackup
345
+ #
352
346
  # ExportAllChannelBackups returns static channel backups for all existing
353
347
  # channels known to lnd. A set of regular singular static channel backups for
354
348
  # each channel are returned. Additionally, a multi-channel backup is returned
355
349
  # as well, which contains a single encrypted blob containing the backups of
356
350
  # each channel.
357
- rpc :ExportAllChannelBackups, ChanBackupExportRequest, ChanBackupSnapshot
358
- # *
351
+ rpc :ExportAllChannelBackups, ::Lnrpc::ChanBackupExportRequest, ::Lnrpc::ChanBackupSnapshot
352
+ #
359
353
  # VerifyChanBackup allows a caller to verify the integrity of a channel backup
360
354
  # snapshot. This method will accept either a packed Single or a packed Multi.
361
355
  # Specifying both will result in an error.
362
- rpc :VerifyChanBackup, ChanBackupSnapshot, VerifyChanBackupResponse
363
- # * lncli: `restorechanbackup`
356
+ rpc :VerifyChanBackup, ::Lnrpc::ChanBackupSnapshot, ::Lnrpc::VerifyChanBackupResponse
357
+ # lncli: `restorechanbackup`
364
358
  # RestoreChannelBackups accepts a set of singular channel backups, or a
365
359
  # single encrypted multi-chan backup and attempts to recover any funds
366
360
  # remaining within the channel. If we are able to unpack the backup, then the
367
361
  # new channel will be shown under listchannels, as well as pending channels.
368
- rpc :RestoreChannelBackups, RestoreChanBackupRequest, RestoreBackupResponse
369
- # *
362
+ rpc :RestoreChannelBackups, ::Lnrpc::RestoreChanBackupRequest, ::Lnrpc::RestoreBackupResponse
363
+ #
370
364
  # SubscribeChannelBackups allows a client to sub-subscribe to the most up to
371
365
  # date information concerning the state of all channel backups. Each time a
372
366
  # new channel is added, we return the new set of channels, along with a
@@ -374,7 +368,23 @@ module Lnrpc
374
368
  # channel is closed, we send a new update, which contains new new chan back
375
369
  # ups, but the updated set of encrypted multi-chan backups with the closed
376
370
  # channel(s) removed.
377
- rpc :SubscribeChannelBackups, ChannelBackupSubscription, stream(ChanBackupSnapshot)
371
+ rpc :SubscribeChannelBackups, ::Lnrpc::ChannelBackupSubscription, stream(::Lnrpc::ChanBackupSnapshot)
372
+ # lncli: `bakemacaroon`
373
+ # BakeMacaroon allows the creation of a new macaroon with custom read and
374
+ # write permissions. No first-party caveats are added since this can be done
375
+ # offline.
376
+ rpc :BakeMacaroon, ::Lnrpc::BakeMacaroonRequest, ::Lnrpc::BakeMacaroonResponse
377
+ # lncli: `listmacaroonids`
378
+ # ListMacaroonIDs returns all root key IDs that are in use.
379
+ rpc :ListMacaroonIDs, ::Lnrpc::ListMacaroonIDsRequest, ::Lnrpc::ListMacaroonIDsResponse
380
+ # lncli: `deletemacaroonid`
381
+ # DeleteMacaroonID deletes the specified macaroon ID and invalidates all
382
+ # macaroons derived from that ID.
383
+ rpc :DeleteMacaroonID, ::Lnrpc::DeleteMacaroonIDRequest, ::Lnrpc::DeleteMacaroonIDResponse
384
+ # lncli: `listpermissions`
385
+ # ListPermissions lists all RPC method URIs and their required macaroon
386
+ # permissions to access them.
387
+ rpc :ListPermissions, ::Lnrpc::ListPermissionsRequest, ::Lnrpc::ListPermissionsResponse
378
388
  end
379
389
 
380
390
  Stub = Service.rpc_stub_class