lnrpc 0.8.0.beta → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile.lock +3 -3
  4. data/README.md +28 -16
  5. data/examples.rb +6 -11
  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 +229 -0
  15. data/lib/grpc_services/routerrpc/router_services_pb.rb +86 -0
  16. data/lib/grpc_services/rpc_pb.rb +1265 -0
  17. data/lib/{lnrpc → grpc_services}/rpc_services_pb.rb +115 -119
  18. data/lib/grpc_services/signrpc/signer_pb.rb +83 -0
  19. data/lib/grpc_services/signrpc/signer_services_pb.rb +68 -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 +149 -0
  23. data/lib/grpc_services/walletrpc/walletkit_services_pb.rb +115 -0
  24. data/lib/grpc_services/walletunlocker_pb.rb +51 -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 +75 -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 +60 -45
  32. data/lib/lnrpc/grpc_wrapper.rb +43 -0
  33. data/lib/lnrpc/version.rb +1 -1
  34. data/lnrpc.gemspec +4 -2
  35. metadata +35 -11
  36. data/lib/lnrpc/rpc.proto +0 -2580
  37. data/lib/lnrpc/rpc_pb.rb +0 -938
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b19fa063d9eb1bfcd10174d0408d7128b35e94f7777dbfb7d44a8dcfe551096
4
- data.tar.gz: 04bd4cc2efe2679fd052e337ba46ad0dbe71e287437c32f32cd766663ca62416
3
+ metadata.gz: 076e28dc0a94e3142ceb908180dea59365aa5dc1caee369499fdcaaeda2b6ece
4
+ data.tar.gz: a58e71947369db675771cec91858159a5b0fbc481cec1f1a167c425a25e7076f
5
5
  SHA512:
6
- metadata.gz: 8418c5730ba78e9cd0a8436af0b1c0cdaa36c9d5d50b63ed7c915978c80e5fa1c533d1ad1bca8b0418a272c7fb213d3bb71dada0a53a74e0fbd72c0faf0654ad
7
- data.tar.gz: 4c893a07fdd3dc2ac13aa4b31c1d7866e7cdfd81f52818fb5b7ab9f651ef15dbc1ee241c8df422460e68f8658fd3c22aa099a560ef98007352ff63ff92e74b5f
6
+ metadata.gz: ee72084b683e9970e70bb45d1f4a62d71077f7fd6d64e2204d9af1ba83558380fdbbe358ae8424c2e61e1ddbecbb3124d2904b1fba1b6fc8b3bb9326aa625538
7
+ data.tar.gz: fd0ae3ca2488ada61c8020f9f2c246a0da05b22f6fe5c52e3cb755b479cd77b0a3afcbdf499d5851c05b9ce1449cca7f591bda998f552817c0eb759290def573
data/.gitignore CHANGED
@@ -11,3 +11,5 @@
11
11
  .rspec_status
12
12
 
13
13
  .ruby-version
14
+
15
+ *.gem
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lnrpc (0.8.0.beta)
4
+ lnrpc (0.10.0)
5
5
  google-protobuf (>= 3.7)
6
6
  grpc (>= 1.19.0)
7
7
 
@@ -15,7 +15,7 @@ GEM
15
15
  grpc (1.24.0)
16
16
  google-protobuf (~> 3.8)
17
17
  googleapis-common-protos-types (~> 1.0)
18
- rake (10.5.0)
18
+ rake (13.0.1)
19
19
  rspec (3.9.0)
20
20
  rspec-core (~> 3.9.0)
21
21
  rspec-expectations (~> 3.9.0)
@@ -36,7 +36,7 @@ PLATFORMS
36
36
  DEPENDENCIES
37
37
  bundler (~> 1.17)
38
38
  lnrpc!
39
- rake (~> 10.0)
39
+ rake (~> 13.0)
40
40
  rspec (~> 3.0)
41
41
 
42
42
  BUNDLED WITH
data/README.md CHANGED
@@ -3,13 +3,15 @@
3
3
 
4
4
  a [gRPC](https://grpc.io/) client for [LND, the Lightning Network Daemon](https://github.com/lightningnetwork/lnd/) packed as ruby gem.
5
5
 
6
-
7
6
  ## Installation
8
7
 
8
+ Note: there is still an GRPC/protobuf [issue with Ruby 2.7](https://github.com/protocolbuffers/protobuf/issues/7070).
9
+ So lnrpc requires Ruby < 2.7.
10
+
9
11
  Add this line to your application's Gemfile:
10
12
 
11
13
  ```ruby
12
- gem 'lnrpc', '~> 0.7.0'
14
+ gem 'lnrpc', '~> 0.10.0'
13
15
  ```
14
16
  lnrpc follows the lnd versioning, thus it is recommended to specify the exact version you need for your lnd node as dependency (see [#Versioning](#Versioning)).
15
17
 
@@ -30,10 +32,12 @@ This gem makes the gRPC client classes created from the [LND service defintions]
30
32
  ```ruby
31
33
  require "lnrpc"
32
34
 
33
- # the gRPC client is available under the Lnrpc namespace, e.g.
35
+ # With the changes in LND v.10.0 this load the `Lnrpc` and `Routerrpc` namespace
34
36
 
35
37
  Lnrpc::Lightning::Stub
38
+ Routerrpc:::Routerrpc::Stub
36
39
  Lnrpc::GetInfoRequest
40
+ ...
37
41
  ```
38
42
 
39
43
  Learn more about [gRPC](https://grpc.io/) on [gRPC.io](https://grpc.io/).
@@ -55,17 +59,26 @@ client = Lnrpc::Lightning::Stub.new("localhost:10009", GRPC::Core::ChannelCreden
55
59
  request = Lnrpc::GetInfoRequest.new
56
60
  response = client.get_info(request, { metadata: { macaroon: macaroon } }) #=> Lnrpc::GetInfoResponse
57
61
  puts response.alias
62
+
63
+ router = Routerprc::Router::Stub.new("localhost:10009", GRPC::Core::ChannelCredentials.new(self.credentials))
64
+ ...
65
+
58
66
  ```
59
67
 
60
68
  ### Client wrapper
61
69
 
70
+ NOTE: v10.0 has breaking changes!
71
+
62
72
  An optional client wrapper ([Lnrpc::Client](https://github.com/bumi/lnrpc/blob/master/lib/lnrpc/client.rb)) makes
63
73
  initializing the gRPC client easier and removes the need for some boilerplate code for calling RPC methods.
64
74
 
65
75
  #### Example
66
76
  ```ruby
67
77
  lnd = Lnrpc::Client.new({credentials_path: '/path/to.cert.cls', macaroon_path: '/path/to/admin.macaroon'})
68
- lnd.get_info
78
+ lnd.lightning # => Lnrpc::Lightning::Stub
79
+ lnd.router # => Lnrpc::Router::Stub
80
+
81
+ lnd.ligthning.get_info
69
82
  ```
70
83
 
71
84
  Also have a look at [examples.rb](https://github.com/bumi/lnrpc/blob/master/examples.rb)
@@ -96,7 +109,8 @@ lnd = Lnrpc::Client.new({
96
109
  })
97
110
 
98
111
  # the actual gRPC client is available through:
99
- lnd.grpc_client
112
+ lnd.lightning.grpc
113
+ lnd.router.grpc
100
114
  ```
101
115
 
102
116
  #### Calling RPC methods
@@ -108,19 +122,19 @@ If the first parameter is a hash or blank the corresponding gRPC request object
108
122
  Example:
109
123
 
110
124
  ```ruby
111
- client.get_info
125
+ client.lightning.get_info
112
126
  # is the same as:
113
- client.grpc_client.get_info(Lnrpc::GetInfoRequest.new)
127
+ client.lightning.grpc.get_info(Lnrpc::GetInfoRequest.new)
114
128
 
115
- client.list_channels(inactive_only: true)
129
+ client.lightning.list_channels(inactive_only: true)
116
130
  # is the same as:
117
131
  request = Lnrpc::ListChannelsRequest.new(inactive_only: true)
118
- client.grpc_client.list_channels(request)
132
+ client.lightning.grpc.list_channels(request)
119
133
 
120
- client.wallet_balance.total_balance
134
+ client.lightning.wallet_balance.total_balance
121
135
  # is the same as:
122
136
  request = Lnrpc::WalletBalanceRequest.new()
123
- client.grpc_client.wallet_balance(request).total_balance
137
+ client.lightning.grpc.wallet_balance(request).total_balance
124
138
  ```
125
139
 
126
140
  ## Using with BTC Pay Server
@@ -145,13 +159,11 @@ see [rubygems](https://rubygems.org/gems/lnrpc) for all available releases.
145
159
 
146
160
  ### Update service definitions
147
161
 
148
- 1. Generate `prc_pb.rb` and `rpc_services_pb.rb`
149
-
150
- $ grpc_tools_ruby_protoc -I/usr/local/include -I. -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --ruby_out=plugins=grpc,paths=source_relative:. --grpc_out=. rpc.proto
162
+ The script `generate-grpc-service-files.sh` can be used to generate the GRPC ruby files.
163
+ The files will be stored in `lib/grpc_services`
151
164
 
152
- 2. Copy `rpc.proto`, `rpc_pb.rb` and `rpc_services_pb.rb` to `lib`
165
+ $ ./generate-grpc-service-files.sh
153
166
 
154
- 3. Update `rpc_services_pb.rb` to use `require_relative` to load `rpc_pb`
155
167
 
156
168
  ## Other resources
157
169
 
@@ -1,24 +1,19 @@
1
1
  require "lnrpc"
2
2
 
3
- lnd = Lnrpc::Client.new({
4
- credentials_path: '/home/bumi/lightning/bullet-testnet/2019-02-27/tls.cert',
5
- macaroon_path: '/home/bumi/lightning/bullet-testnet/2019-02-27/admin.macaroon',
6
- address: '79.137.71.183:10009'
7
- }) # use defaults for credentials, macaraoon and address
3
+ lnd = Lnrpc::Client.new() # use defaults for credentials, macaraoon and address
8
4
 
9
- get_info_res = lnd.get_info
5
+ get_info_res = lnd.lightning.get_info
10
6
  puts get_info_res.alias
11
7
 
12
- puts lnd.wallet_balance.total_balance
8
+ puts lnd.lightning.wallet_balance.total_balance
13
9
 
14
- exit
15
10
  pay_request = "lntb50u1pw9mmndpp5nvnff958pxc9eqknwntyxapjw7l5grt5e2y70cmmnu0lljfa0sdqdpsgfkx7cmtwd68yetpd5s9xct5v4kxc6t5v5s8yatz0ysxwetdcqzysxqyz5vqjkhlyn40z76gyn7dx32p9j58dftve9xrlvnqqazht7w2fdauukhyhr9y4k3ngjn8s6srglj8swk7tm70ng54wdkq47ahytpwffvaeusp500csz"
16
11
  lnd.pay(pay_request) # or:
17
- lnd.send_payment_sync(payment_request: pay_request)
12
+ lnd.router.send_payment_v2(payment_request: pay_request)
18
13
 
19
- invoice_res = lnd.add_invoice(value: 1000, memo: 'I :heart: ruby')
14
+ invoice_res = lnd.lightning.add_invoice(value: 1000, memo: 'I :heart: ruby')
20
15
  puts invoice_res.payment_request
21
16
 
22
- lnd.subscribe_invoices(settle_index: 1).each do |invoice|
17
+ lnd.lightning.subscribe_invoices(settle_index: 1).each do |invoice|
23
18
  puts invoice.payment_request
24
19
  end
@@ -0,0 +1,30 @@
1
+ #!/bin/sh
2
+ set -o xtrace
3
+
4
+ FULL_PATH=$(realpath $0)
5
+ GEM_DIR=$(dirname $FULL_PATH)
6
+ LNRPC_TARGET_DIR="$GEM_DIR/lib/grpc_services"
7
+ CURRENT_DIR=$(pwd)
8
+ echo $CURRENT_DIR
9
+ cd $GOPATH/src/github.com/lightningnetwork/lnd/lnrpc
10
+
11
+ echo "Generating Ruby GRPC Service Files"
12
+
13
+ PROTOS="rpc.proto walletunlocker.proto **/*.proto"
14
+
15
+ # generate files for each proto
16
+ for file in $PROTOS; do
17
+ DIRECTORY=$(dirname "${file}")
18
+ echo "Generating protos from ${file}, into ${LNRPC_TARGET_DIR}/${DIRECTORY}"
19
+
20
+ # writes all ruby files in the ruby directory
21
+ grpc_tools_ruby_protoc -I/usr/local/include \
22
+ -I. \
23
+ -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
24
+ -I$GOPATH/src/github.com/lightningnetwork/lnd/lnrpc \
25
+ --ruby_out=plugins=grpc,paths=source_relative:${LNRPC_TARGET_DIR} \
26
+ --grpc_out=${LNRPC_TARGET_DIR} "${file}"
27
+
28
+ done
29
+
30
+ cd $CURRENT_DIR
@@ -0,0 +1,48 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: autopilotrpc/autopilot.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("autopilotrpc/autopilot.proto", :syntax => :proto3) do
8
+ add_message "autopilotrpc.StatusRequest" do
9
+ end
10
+ add_message "autopilotrpc.StatusResponse" do
11
+ optional :active, :bool, 1
12
+ end
13
+ add_message "autopilotrpc.ModifyStatusRequest" do
14
+ optional :enable, :bool, 1
15
+ end
16
+ add_message "autopilotrpc.ModifyStatusResponse" do
17
+ end
18
+ add_message "autopilotrpc.QueryScoresRequest" do
19
+ repeated :pubkeys, :string, 1
20
+ optional :ignore_local_state, :bool, 2
21
+ end
22
+ add_message "autopilotrpc.QueryScoresResponse" do
23
+ repeated :results, :message, 1, "autopilotrpc.QueryScoresResponse.HeuristicResult"
24
+ end
25
+ add_message "autopilotrpc.QueryScoresResponse.HeuristicResult" do
26
+ optional :heuristic, :string, 1
27
+ map :scores, :string, :double, 2
28
+ end
29
+ add_message "autopilotrpc.SetScoresRequest" do
30
+ optional :heuristic, :string, 1
31
+ map :scores, :string, :double, 2
32
+ end
33
+ add_message "autopilotrpc.SetScoresResponse" do
34
+ end
35
+ end
36
+ end
37
+
38
+ module Autopilotrpc
39
+ StatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusRequest").msgclass
40
+ StatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusResponse").msgclass
41
+ ModifyStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusRequest").msgclass
42
+ ModifyStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusResponse").msgclass
43
+ QueryScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresRequest").msgclass
44
+ QueryScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse").msgclass
45
+ QueryScoresResponse::HeuristicResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse.HeuristicResult").msgclass
46
+ SetScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresRequest").msgclass
47
+ SetScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresResponse").msgclass
48
+ end
@@ -0,0 +1,40 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: autopilotrpc/autopilot.proto for package 'autopilotrpc'
3
+
4
+ require 'grpc'
5
+ require 'autopilotrpc/autopilot_pb'
6
+
7
+ module Autopilotrpc
8
+ module Autopilot
9
+ # Autopilot is a service that can be used to get information about the current
10
+ # state of the daemon's autopilot agent, and also supply it with information
11
+ # that can be used when deciding where to open channels.
12
+ class Service
13
+
14
+ include GRPC::GenericService
15
+
16
+ self.marshal_class_method = :encode
17
+ self.unmarshal_class_method = :decode
18
+ self.service_name = 'autopilotrpc.Autopilot'
19
+
20
+ #
21
+ # Status returns whether the daemon's autopilot agent is active.
22
+ rpc :Status, StatusRequest, StatusResponse
23
+ #
24
+ # ModifyStatus is used to modify the status of the autopilot agent, like
25
+ # enabling or disabling it.
26
+ rpc :ModifyStatus, ModifyStatusRequest, ModifyStatusResponse
27
+ #
28
+ # QueryScores queries all available autopilot heuristics, in addition to any
29
+ # active combination of these heruristics, for the scores they would give to
30
+ # the given nodes.
31
+ rpc :QueryScores, QueryScoresRequest, QueryScoresResponse
32
+ #
33
+ # SetScores attempts to set the scores used by the running autopilot agent,
34
+ # if the external scoring heuristic is enabled.
35
+ rpc :SetScores, SetScoresRequest, SetScoresResponse
36
+ end
37
+
38
+ Stub = Service.rpc_stub_class
39
+ end
40
+ end
@@ -0,0 +1,67 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: chainrpc/chainnotifier.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("chainrpc/chainnotifier.proto", :syntax => :proto3) do
8
+ add_message "chainrpc.ConfRequest" do
9
+ optional :txid, :bytes, 1
10
+ optional :script, :bytes, 2
11
+ optional :num_confs, :uint32, 3
12
+ optional :height_hint, :uint32, 4
13
+ end
14
+ add_message "chainrpc.ConfDetails" do
15
+ optional :raw_tx, :bytes, 1
16
+ optional :block_hash, :bytes, 2
17
+ optional :block_height, :uint32, 3
18
+ optional :tx_index, :uint32, 4
19
+ end
20
+ add_message "chainrpc.Reorg" do
21
+ end
22
+ add_message "chainrpc.ConfEvent" do
23
+ oneof :event do
24
+ optional :conf, :message, 1, "chainrpc.ConfDetails"
25
+ optional :reorg, :message, 2, "chainrpc.Reorg"
26
+ end
27
+ end
28
+ add_message "chainrpc.Outpoint" do
29
+ optional :hash, :bytes, 1
30
+ optional :index, :uint32, 2
31
+ end
32
+ add_message "chainrpc.SpendRequest" do
33
+ optional :outpoint, :message, 1, "chainrpc.Outpoint"
34
+ optional :script, :bytes, 2
35
+ optional :height_hint, :uint32, 3
36
+ end
37
+ add_message "chainrpc.SpendDetails" do
38
+ optional :spending_outpoint, :message, 1, "chainrpc.Outpoint"
39
+ optional :raw_spending_tx, :bytes, 2
40
+ optional :spending_tx_hash, :bytes, 3
41
+ optional :spending_input_index, :uint32, 4
42
+ optional :spending_height, :uint32, 5
43
+ end
44
+ add_message "chainrpc.SpendEvent" do
45
+ oneof :event do
46
+ optional :spend, :message, 1, "chainrpc.SpendDetails"
47
+ optional :reorg, :message, 2, "chainrpc.Reorg"
48
+ end
49
+ end
50
+ add_message "chainrpc.BlockEpoch" do
51
+ optional :hash, :bytes, 1
52
+ optional :height, :uint32, 2
53
+ end
54
+ end
55
+ end
56
+
57
+ module Chainrpc
58
+ ConfRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfRequest").msgclass
59
+ ConfDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfDetails").msgclass
60
+ Reorg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Reorg").msgclass
61
+ ConfEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfEvent").msgclass
62
+ Outpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Outpoint").msgclass
63
+ SpendRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendRequest").msgclass
64
+ SpendDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendDetails").msgclass
65
+ SpendEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendEvent").msgclass
66
+ BlockEpoch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.BlockEpoch").msgclass
67
+ end
@@ -0,0 +1,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: chainrpc/chainnotifier.proto for package 'chainrpc'
3
+
4
+ require 'grpc'
5
+ require 'chainrpc/chainnotifier_pb'
6
+
7
+ module Chainrpc
8
+ module ChainNotifier
9
+ # ChainNotifier is a service that can be used to get information about the
10
+ # chain backend by registering notifiers for chain events.
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 = 'chainrpc.ChainNotifier'
18
+
19
+ #
20
+ # RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
21
+ # registers an intent for a client to be notified once a confirmation request
22
+ # has reached its required number of confirmations on-chain.
23
+ #
24
+ # A client can specify whether the confirmation request should be for a
25
+ # particular transaction by its hash or for an output script by specifying a
26
+ # zero hash.
27
+ rpc :RegisterConfirmationsNtfn, ConfRequest, stream(ConfEvent)
28
+ #
29
+ # RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
30
+ # intent for a client to be notification once a spend request has been spent
31
+ # by a transaction that has confirmed on-chain.
32
+ #
33
+ # A client can specify whether the spend request should be for a particular
34
+ # outpoint or for an output script by specifying a zero outpoint.
35
+ rpc :RegisterSpendNtfn, SpendRequest, stream(SpendEvent)
36
+ #
37
+ # RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
38
+ # registers an intent for a client to be notified of blocks in the chain. The
39
+ # stream will return a hash and height tuple of a block for each new/stale
40
+ # block in the chain. It is the client's responsibility to determine whether
41
+ # the tuple returned is for a new or stale block in the chain.
42
+ #
43
+ # A client can also request a historical backlog of blocks from a particular
44
+ # point. This allows clients to be idempotent by ensuring that they do not
45
+ # missing processing a single block within the chain.
46
+ rpc :RegisterBlockEpochNtfn, BlockEpoch, stream(BlockEpoch)
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: invoicesrpc/invoices.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'rpc_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_file("invoicesrpc/invoices.proto", :syntax => :proto3) do
9
+ add_message "invoicesrpc.CancelInvoiceMsg" do
10
+ optional :payment_hash, :bytes, 1
11
+ end
12
+ add_message "invoicesrpc.CancelInvoiceResp" do
13
+ end
14
+ add_message "invoicesrpc.AddHoldInvoiceRequest" do
15
+ optional :memo, :string, 1
16
+ optional :hash, :bytes, 2
17
+ optional :value, :int64, 3
18
+ optional :value_msat, :int64, 10
19
+ optional :description_hash, :bytes, 4
20
+ optional :expiry, :int64, 5
21
+ optional :fallback_addr, :string, 6
22
+ optional :cltv_expiry, :uint64, 7
23
+ repeated :route_hints, :message, 8, "lnrpc.RouteHint"
24
+ optional :private, :bool, 9
25
+ end
26
+ add_message "invoicesrpc.AddHoldInvoiceResp" do
27
+ optional :payment_request, :string, 1
28
+ end
29
+ add_message "invoicesrpc.SettleInvoiceMsg" do
30
+ optional :preimage, :bytes, 1
31
+ end
32
+ add_message "invoicesrpc.SettleInvoiceResp" do
33
+ end
34
+ add_message "invoicesrpc.SubscribeSingleInvoiceRequest" do
35
+ optional :r_hash, :bytes, 2
36
+ end
37
+ end
38
+ end
39
+
40
+ module Invoicesrpc
41
+ CancelInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceMsg").msgclass
42
+ CancelInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceResp").msgclass
43
+ AddHoldInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceRequest").msgclass
44
+ AddHoldInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceResp").msgclass
45
+ SettleInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceMsg").msgclass
46
+ SettleInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceResp").msgclass
47
+ SubscribeSingleInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SubscribeSingleInvoiceRequest").msgclass
48
+ end