lnd-client 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f29d96dd5176f16348a0afda7aa1346ccbae85948638f1ff9a680d9de08bcc9
4
- data.tar.gz: 2f0aebd1189138547a346c4c8852d3e2e82126a40011e9e8a77fe5945d4c2349
3
+ metadata.gz: 68daf7177bbbbbc21fe8e5c3b19230777b5d5904364ebc44211953e6fd5f36ed
4
+ data.tar.gz: e811786dd412c270cb931bd78ee30fa558bbeff87d779e53c2d4d0f6d7f8aec5
5
5
  SHA512:
6
- metadata.gz: a2e2c86109d21347a18fd7cb21a83c42a2c1983eaa0165353d75413cbfa5a1cdd6e5ab7ad364b490aefddadd82a1fc336dafe8bd855c18a0c886023ffed3d247
7
- data.tar.gz: 367e1ab6ddc5857e409387402b775288a1dcfaa47c8c0bbe715f794d297a7ed9cd22cd05e313f388a7a3d302c79b70d31afded2b80c1d8410669bde8c40617b7
6
+ metadata.gz: 3073a130f52bb94942379231f236fc79dc99f459891b696095c2928806611ef0b87e0c980fd9d39e60642ebf2a8a7847d1ee899336dd00a7d46a06ec376822a8
7
+ data.tar.gz: b63090fa41a852873e74695916614a065bb6bf824322ecd5233c93379b39b4dc2c86b3f575bb549a18869906b063569a440591070ffb128963c20f4fdc8a2fa2
data/Gemfile CHANGED
@@ -1,16 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ruby '3.2.0'
4
-
5
3
  source 'https://rubygems.org'
6
4
 
7
- gem 'grpc', '~> 1.50'
5
+ gemspec
8
6
 
9
7
  group :test, :development do
10
- gem 'grpc-tools', '~> 1.50'
11
8
  gem 'pry-byebug', '~> 3.10', '>= 3.10.1'
12
- gem 'rainbow', '~> 3.1', '>= 3.1.1'
13
- gem 'rake', '~> 13.0', '>= 13.0.6'
14
- gem 'rubocop', '~> 1.43'
9
+ gem 'rubocop', '~> 1.44', '>= 1.44.1'
15
10
  gem 'rubocop-rake', '~> 0.6.0'
16
11
  end
data/Gemfile.lock CHANGED
@@ -1,3 +1,9 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lnd-client (0.0.4)
5
+ grpc (~> 1.51)
6
+
1
7
  GEM
2
8
  remote: https://rubygems.org/
3
9
  specs:
@@ -7,10 +13,9 @@ GEM
7
13
  google-protobuf (3.21.12)
8
14
  googleapis-common-protos-types (1.5.0)
9
15
  google-protobuf (~> 3.14)
10
- grpc (1.50.0)
16
+ grpc (1.51.0)
11
17
  google-protobuf (~> 3.21)
12
18
  googleapis-common-protos-types (~> 1.0)
13
- grpc-tools (1.50.0)
14
19
  json (2.6.3)
15
20
  method_source (1.0.0)
16
21
  parallel (1.22.1)
@@ -23,10 +28,9 @@ GEM
23
28
  byebug (~> 11.0)
24
29
  pry (>= 0.13, < 0.15)
25
30
  rainbow (3.1.1)
26
- rake (13.0.6)
27
31
  regexp_parser (2.6.2)
28
32
  rexml (3.2.5)
29
- rubocop (1.43.0)
33
+ rubocop (1.44.1)
30
34
  json (~> 2.3)
31
35
  parallel (~> 1.10)
32
36
  parser (>= 3.2.0.0)
@@ -47,16 +51,10 @@ PLATFORMS
47
51
  x86_64-linux
48
52
 
49
53
  DEPENDENCIES
50
- grpc (~> 1.50)
51
- grpc-tools (~> 1.50)
54
+ lnd-client!
52
55
  pry-byebug (~> 3.10, >= 3.10.1)
53
- rainbow (~> 3.1, >= 3.1.1)
54
- rake (~> 13.0, >= 13.0.6)
55
- rubocop (~> 1.43)
56
+ rubocop (~> 1.44, >= 1.44.1)
56
57
  rubocop-rake (~> 0.6.0)
57
58
 
58
- RUBY VERSION
59
- ruby 3.2.0p0
60
-
61
59
  BUNDLED WITH
62
60
  2.4.4
data/README.md CHANGED
@@ -2,7 +2,10 @@
2
2
 
3
3
  > ⚠️ Warning: Early-stage, breaking changes are expected.
4
4
 
5
+ This is a low-level client library. For a better experience, you may want to check out the [Lighstorm](https://github.com/icebaker/lighstorm) abstraction.
6
+
5
7
  - [Usage](#usage)
8
+ - [Channel Arguments](#channel-arguments)
6
9
  - [Documentation](#documentation)
7
10
  - [Development](#development)
8
11
  - [Upgrading gRPC Proto Files](#upgrading-grpc-proto-files)
@@ -13,13 +16,13 @@
13
16
  Add to your `Gemfile`:
14
17
 
15
18
  ```ruby
16
- gem 'lnd-client', '~> 0.0.2'
19
+ gem 'lnd-client', '~> 0.0.4'
17
20
  ```
18
21
 
19
22
  ```ruby
20
23
  require 'lnd-client'
21
24
 
22
- puts LNDClient.version # => 0.0.2
25
+ puts LNDClient.version # => 0.0.4
23
26
 
24
27
  client = LNDClient.new(
25
28
  certificate_path: '/lnd/tls.cert',
@@ -50,12 +53,35 @@ client.router.subscribe_htlc_events do |data|
50
53
  end
51
54
  ```
52
55
 
56
+ ### Channel Arguments
57
+
58
+ ```ruby
59
+ require 'lnd-client'
60
+
61
+ puts LNDClient.version # => 0.0.4
62
+
63
+ client = LNDClient.new(
64
+ certificate_path: '/lnd/tls.cert',
65
+ macaroon_path: '/lnd/data/chain/bitcoin/mainnet/admin.macaroon',
66
+ socket_address: '127.0.0.1:10009'
67
+ )
68
+
69
+ client.lightning(
70
+ channel_args: { 'grpc.max_receive_message_length' => 1024 * 1024 * 50 }
71
+ )
72
+
73
+ graph = client.lightning.describe_graph
74
+
75
+ graph.nodes # => [...]
76
+ graph.edges # => [...]
77
+ ```
78
+
53
79
  ### Documentation
54
80
 
55
81
  ```ruby
56
82
  require 'lnd-client'
57
83
 
58
- puts LNDClient.version # => 0.0.2
84
+ puts LNDClient.version # => 0.0.4
59
85
 
60
86
  client = LNDClient.new(
61
87
  certificate_path: '/lnd/tls.cert',
@@ -63,7 +89,7 @@ client = LNDClient.new(
63
89
  socket_address: '127.0.0.1:10009'
64
90
  )
65
91
 
66
- client.doc.services # => ['lightning']
92
+ client.doc.services # => ['lightning', 'router']
67
93
 
68
94
  client.lightning.doc.available_methods # =>
69
95
  # ['abandon_channel',
@@ -122,5 +148,5 @@ gem build lnd-client.gemspec
122
148
 
123
149
  gem signin
124
150
 
125
- em push lnd-client-0.0.2.gem
151
+ gem push lnd-client-0.0.4.gem
126
152
  ```
data/Rakefile CHANGED
@@ -5,6 +5,6 @@ require_relative './controllers/grpc_generator'
5
5
  namespace :grpc do
6
6
  desc 'Upgrade lnd Protocol Buffers for gGRPC'
7
7
  task :upgrade do
8
- GrpcGeneratorController.upgrade!
8
+ LNDClientInternal::GrpcGeneratorController.upgrade!
9
9
  end
10
10
  end
data/components/grpc.rb CHANGED
@@ -3,9 +3,11 @@
3
3
  require_relative './grpc/lightning_services_pb'
4
4
  require_relative './grpc/routerrpc/router_services_pb'
5
5
 
6
- module GRPC
7
- SERVICES = {
8
- lightning: Lnrpc::Lightning,
9
- router: Routerrpc::Router
10
- }.freeze
6
+ module LNDClientInternal
7
+ module GRPC
8
+ SERVICES = {
9
+ lightning: Lnrpc::Lightning,
10
+ router: Routerrpc::Router
11
+ }.freeze
12
+ end
11
13
  end
@@ -4,28 +4,34 @@ require_relative '../components/grpc'
4
4
  require_relative 'config'
5
5
  require_relative 'service'
6
6
 
7
- class ClientController
8
- attr_reader :config, :doc
7
+ module LNDClientInternal
8
+ class ClientController
9
+ attr_reader :config, :doc
9
10
 
10
- def initialize(options)
11
- @config = ConfigController.new(self, options)
12
- @services = {}
11
+ def initialize(options)
12
+ @config = LNDClientInternal::ConfigController.new(self, options)
13
+ @services = {}
13
14
 
14
- doc = Struct.new(:services)
15
- @doc = doc.new(GRPC::SERVICES.keys.map(&:to_s))
16
- end
15
+ doc = Struct.new(:services)
16
+ @doc = doc.new(LNDClientInternal::GRPC::SERVICES.keys.map(&:to_s))
17
+ end
17
18
 
18
- def respond_to_missing?(method_name, include_private = false)
19
- service_key = method_name.to_sym
19
+ def respond_to_missing?(method_name, include_private = false)
20
+ service_key = method_name.to_sym
20
21
 
21
- GRPC::SERVICES.include?(service_key) || super
22
- end
22
+ LNDClientInternal::GRPC::SERVICES.include?(service_key) || super
23
+ end
23
24
 
24
- def method_missing(method_name, *_args)
25
- service_key = method_name.to_sym
25
+ def method_missing(method_name, *args)
26
+ service_key = method_name.to_sym
26
27
 
27
- raise ArgumentError, "Method `#{method_name}` doesn't exist." unless GRPC::SERVICES.include?(service_key)
28
+ unless LNDClientInternal::GRPC::SERVICES.include?(service_key)
29
+ raise ArgumentError, "Method `#{method_name}` doesn't exist."
30
+ end
28
31
 
29
- @services[service_key] ||= ServiceController.new(self, GRPC::SERVICES[service_key])
32
+ @services[service_key] ||= LNDClientInternal::ServiceController.new(
33
+ self, LNDClientInternal::GRPC::SERVICES[service_key], *args
34
+ )
35
+ end
30
36
  end
31
37
  end
@@ -2,34 +2,36 @@
2
2
 
3
3
  require 'grpc'
4
4
 
5
- class ConfigController
6
- attr_reader :socket_address, :credentials, :certificate, :macaroon
5
+ module LNDClientInternal
6
+ class ConfigController
7
+ attr_reader :socket_address, :credentials, :certificate, :macaroon
7
8
 
8
- def initialize(client, options)
9
- @client = client
9
+ def initialize(client, options)
10
+ @client = client
10
11
 
11
- @certificate_path = options[:certificate_path]
12
- @certificate = options[:certificate]
12
+ @certificate_path = options[:certificate_path]
13
+ @certificate = options[:certificate]
13
14
 
14
- @macaroon_path = options[:macaroon_path]
15
- @macaroon = options[:macaroon]
15
+ @macaroon_path = options[:macaroon_path]
16
+ @macaroon = options[:macaroon]
16
17
 
17
- @socket_address = options[:socket_address] || '127.0.0.1:10009'
18
+ @socket_address = options[:socket_address] || '127.0.0.1:10009'
18
19
 
19
- setup_certificate!
20
- setup_macaroon!
21
- end
20
+ setup_certificate!
21
+ setup_macaroon!
22
+ end
22
23
 
23
- def setup_certificate!
24
- raise 'conflicting options for certificate' if @certificate && @certificate_path
24
+ def setup_certificate!
25
+ raise 'conflicting options for certificate' if @certificate && @certificate_path
25
26
 
26
- @certificate = File.read(@certificate_path) if @certificate_path
27
- @credentials = GRPC::Core::ChannelCredentials.new(@certificate)
28
- end
27
+ @certificate = File.read(@certificate_path) if @certificate_path
28
+ @credentials = ::GRPC::Core::ChannelCredentials.new(@certificate)
29
+ end
29
30
 
30
- def setup_macaroon!
31
- raise 'conflicting options for macaroon' if @macaroon && @macaroon_path
31
+ def setup_macaroon!
32
+ raise 'conflicting options for macaroon' if @macaroon && @macaroon_path
32
33
 
33
- @macaroon = File.read(@macaroon_path).unpack('H*') if @macaroon_path
34
+ @macaroon = File.read(@macaroon_path).unpack('H*') if @macaroon_path
35
+ end
34
36
  end
35
37
  end
@@ -2,44 +2,46 @@
2
2
 
3
3
  require_relative '../logic/string'
4
4
 
5
- class DocumentationController
6
- attr_reader :available_methods
5
+ module LNDClientInternal
6
+ class DocumentationController
7
+ attr_reader :available_methods
7
8
 
8
- def initialize(service)
9
- @service = service
10
- @descriptions = {}
11
- @grpc = {}
9
+ def initialize(service)
10
+ @service = service
11
+ @descriptions = {}
12
+ @grpc = {}
12
13
 
13
- build!
14
- end
14
+ build!
15
+ end
15
16
 
16
- def build!
17
- @available_methods = @service.service.rpc_descs.values.map do |desc|
18
- method_name = StringLogic.underscore(desc.name.to_s)
17
+ def build!
18
+ @available_methods = @service.service.rpc_descs.values.map do |desc|
19
+ method_name = LNDClientInternal::StringLogic.underscore(desc.name.to_s)
19
20
 
20
- build_description!(method_name, desc)
21
+ build_description!(method_name, desc)
21
22
 
22
- @grpc[method_name] = desc
23
+ @grpc[method_name] = desc
23
24
 
24
- method_name
25
- end.sort
26
- end
25
+ method_name
26
+ end.sort
27
+ end
27
28
 
28
- def build_description!(method_name, desc)
29
- input = desc.input.new.to_h if desc.input.respond_to?(:new)
30
- output = desc.output.new.to_h if desc.output.respond_to?(:new)
29
+ def build_description!(method_name, desc)
30
+ input = desc.input.new.to_h if desc.input.respond_to?(:new)
31
+ output = desc.output.new.to_h if desc.output.respond_to?(:new)
31
32
 
32
- @descriptions[method_name] = { method: method_name }
33
+ @descriptions[method_name] = { method: method_name }
33
34
 
34
- @descriptions[method_name][:input] = input if input
35
- @descriptions[method_name][:output] = output if output
36
- end
35
+ @descriptions[method_name][:input] = input if input
36
+ @descriptions[method_name][:output] = output if output
37
+ end
37
38
 
38
- def describe(method_name)
39
- @descriptions[method_name.to_s]
40
- end
39
+ def describe(method_name)
40
+ @descriptions[method_name.to_s]
41
+ end
41
42
 
42
- def grpc(method_name)
43
- @grpc[method_name.to_s]
43
+ def grpc(method_name)
44
+ @grpc[method_name.to_s]
45
+ end
44
46
  end
45
47
  end
@@ -3,78 +3,80 @@
3
3
  require 'fileutils'
4
4
  require 'rainbow'
5
5
 
6
- module GrpcGeneratorController
7
- REQUIRE_REGEX = /^require\s+['"].*_pb['"]/
6
+ module LNDClientInternal
7
+ module GrpcGeneratorController
8
+ REQUIRE_REGEX = /^require\s+['"].*_pb['"]/
8
9
 
9
- def self.upgrade!
10
- cleanup!
10
+ def self.upgrade!
11
+ cleanup!
11
12
 
12
- download!
13
+ download!
13
14
 
14
- Dir['temp/grpc-upgrade/lnd/lnrpc/**/*.proto'].each do |proto_file|
15
- next if proto_file =~ /googleapis/
15
+ Dir['temp/grpc-upgrade/lnd/lnrpc/**/*.proto'].each do |proto_file|
16
+ next if proto_file =~ /googleapis/
16
17
 
17
- run!(generate_command(proto_file.sub('temp/grpc-upgrade/lnd/lnrpc/', '')), print_output: true)
18
- end
18
+ run!(generate_command(proto_file.sub('temp/grpc-upgrade/lnd/lnrpc/', '')), print_output: true)
19
+ end
19
20
 
20
- fix_requires!
21
+ fix_requires!
21
22
 
22
- remove_references!
23
+ remove_references!
23
24
 
24
- puts "\nDone!"
25
- end
25
+ puts "\nDone!"
26
+ end
26
27
 
27
- def self.remove_references!
28
- run!('rm -rf temp/grpc-upgrade', print_output: false)
29
- end
28
+ def self.remove_references!
29
+ run!('rm -rf temp/grpc-upgrade', print_output: false)
30
+ end
30
31
 
31
- def self.cleanup!
32
- run!('rm -rf components/grpc', print_output: false)
33
- run!('rm -rf temp/grpc-upgrade', print_output: false)
32
+ def self.cleanup!
33
+ run!('rm -rf components/grpc', print_output: false)
34
+ run!('rm -rf temp/grpc-upgrade', print_output: false)
34
35
 
35
- FileUtils.mkdir_p('components/grpc')
36
- FileUtils.mkdir_p('temp/grpc-upgrade')
37
- end
36
+ FileUtils.mkdir_p('components/grpc')
37
+ FileUtils.mkdir_p('temp/grpc-upgrade')
38
+ end
38
39
 
39
- def self.download!
40
- run!('git clone https://github.com/lightningnetwork/lnd.git temp/grpc-upgrade/lnd', print_output: false)
41
- run!('git clone https://github.com/googleapis/googleapis.git temp/grpc-upgrade/lnd/lnrpc/googleapis',
42
- print_output: false)
43
- end
40
+ def self.download!
41
+ run!('git clone https://github.com/lightningnetwork/lnd.git temp/grpc-upgrade/lnd', print_output: false)
42
+ run!('git clone https://github.com/googleapis/googleapis.git temp/grpc-upgrade/lnd/lnrpc/googleapis',
43
+ print_output: false)
44
+ end
44
45
 
45
- def self.generate_command(proto_file)
46
- [
47
- 'cd temp/grpc-upgrade/lnd/lnrpc/; grpc_tools_ruby_protoc',
48
- '--proto_path googleapis:.',
49
- '--ruby_out=../../../../components/grpc/',
50
- '--grpc_out=../../../../components/grpc/',
51
- proto_file
52
- ].join(' ')
53
- end
46
+ def self.generate_command(proto_file)
47
+ [
48
+ 'cd temp/grpc-upgrade/lnd/lnrpc/; grpc_tools_ruby_protoc',
49
+ '--proto_path googleapis:.',
50
+ '--ruby_out=../../../../components/grpc/',
51
+ '--grpc_out=../../../../components/grpc/',
52
+ proto_file
53
+ ].join(' ')
54
+ end
54
55
 
55
- def self.fix_requires!
56
- 5.times do
57
- Dir['components/grpc/**/*.rb'].each do |file|
58
- content = File.read(file)
59
- next unless content =~ REQUIRE_REGEX
56
+ def self.fix_requires!
57
+ 5.times do
58
+ Dir['components/grpc/**/*.rb'].each do |file|
59
+ content = File.read(file)
60
+ next unless content =~ REQUIRE_REGEX
60
61
 
61
- apply!(file, content)
62
+ apply!(file, content)
63
+ end
62
64
  end
63
65
  end
64
- end
65
66
 
66
- def self.apply!(file, content)
67
- old_code = content[REQUIRE_REGEX]
68
- new_code = content[REQUIRE_REGEX].sub('require', 'require_relative')
67
+ def self.apply!(file, content)
68
+ old_code = content[REQUIRE_REGEX]
69
+ new_code = content[REQUIRE_REGEX].sub('require', 'require_relative')
69
70
 
70
- puts "\n#{Rainbow('>').yellow} #{file}"
71
- puts " #{Rainbow(old_code).red} -> #{Rainbow(new_code).green}"
72
- File.write(file, content.gsub(old_code, new_code))
73
- end
71
+ puts "\n#{Rainbow('>').yellow} #{file}"
72
+ puts " #{Rainbow(old_code).red} -> #{Rainbow(new_code).green}"
73
+ File.write(file, content.gsub(old_code, new_code))
74
+ end
74
75
 
75
- def self.run!(command, print_output: false)
76
- puts "\n#{Rainbow('>').yellow} #{command}"
77
- output = `#{command}`
78
- puts output if print_output
76
+ def self.run!(command, print_output: false)
77
+ puts "\n#{Rainbow('>').yellow} #{command}"
78
+ output = `#{command}`
79
+ puts output if print_output
80
+ end
79
81
  end
80
82
  end
@@ -2,35 +2,41 @@
2
2
 
3
3
  require_relative './documentation'
4
4
 
5
- class ServiceController
6
- attr_reader :doc, :service
7
-
8
- def initialize(client, rpc)
9
- @client = client
10
- @rpc = rpc
11
- @service = rpc.const_get(:Service)
12
- @stub = rpc.const_get(:Stub).new(client.config.socket_address, client.config.credentials)
13
- @doc = DocumentationController.new(self)
14
- end
15
-
16
- def call!(method_key, desc, *args, &block)
17
- @stub.method(method_key).call(
18
- desc.input.new(*args),
19
- { metadata: { macaroon: @client.config.macaroon } },
20
- &block
21
- )
22
- end
23
-
24
- def respond_to_missing?(method_name, include_private = false)
25
- desc = @doc.grpc(method_name)
26
- (desc && @stub.respond_to?(method_name)) || super
27
- end
28
-
29
- def method_missing(method_name, *args, &block)
30
- desc = @doc.grpc(method_name)
31
-
32
- raise ArgumentError, "Method `#{method_name}` doesn't exist." unless desc && @stub.respond_to?(method_name)
33
-
34
- call!(method_name, desc, *args, &block)
5
+ module LNDClientInternal
6
+ class ServiceController
7
+ attr_reader :doc, :service
8
+
9
+ def initialize(client, rpc, params = {})
10
+ @client = client
11
+ @rpc = rpc
12
+ @service = rpc.const_get(:Service)
13
+ @stub = rpc.const_get(:Stub).new(
14
+ client.config.socket_address,
15
+ client.config.credentials,
16
+ **params
17
+ )
18
+ @doc = LNDClientInternal::DocumentationController.new(self)
19
+ end
20
+
21
+ def call!(method_key, desc, *args, &block)
22
+ @stub.method(method_key).call(
23
+ desc.input.new(*args),
24
+ { metadata: { macaroon: @client.config.macaroon } },
25
+ &block
26
+ )
27
+ end
28
+
29
+ def respond_to_missing?(method_name, include_private = false)
30
+ desc = @doc.grpc(method_name)
31
+ (desc && @stub.respond_to?(method_name)) || super
32
+ end
33
+
34
+ def method_missing(method_name, *args, &block)
35
+ desc = @doc.grpc(method_name)
36
+
37
+ raise ArgumentError, "Method `#{method_name}` doesn't exist." unless desc && @stub.respond_to?(method_name)
38
+
39
+ call!(method_name, desc, *args, &block)
40
+ end
35
41
  end
36
42
  end
data/lnd-client.gemspec CHANGED
@@ -3,23 +3,23 @@
3
3
  require_relative 'static/spec'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = Static::SPEC[:name]
7
- spec.version = Static::SPEC[:version]
8
- spec.authors = [Static::SPEC[:author]]
6
+ spec.name = LNDClientInternal::Static::SPEC[:name]
7
+ spec.version = LNDClientInternal::Static::SPEC[:version]
8
+ spec.authors = [LNDClientInternal::Static::SPEC[:author]]
9
9
 
10
- spec.summary = Static::SPEC[:summary]
11
- spec.description = Static::SPEC[:description]
10
+ spec.summary = LNDClientInternal::Static::SPEC[:summary]
11
+ spec.description = LNDClientInternal::Static::SPEC[:description]
12
12
 
13
- spec.homepage = Static::SPEC[:github]
13
+ spec.homepage = LNDClientInternal::Static::SPEC[:github]
14
14
 
15
- spec.license = Static::SPEC[:license]
15
+ spec.license = LNDClientInternal::Static::SPEC[:license]
16
16
 
17
17
  spec.required_ruby_version = Gem::Requirement.new('>= 3.0.0')
18
18
 
19
19
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
20
20
 
21
21
  spec.metadata['homepage_uri'] = spec.homepage
22
- spec.metadata['source_code_uri'] = Static::SPEC[:github]
22
+ spec.metadata['source_code_uri'] = LNDClientInternal::Static::SPEC[:github]
23
23
 
24
24
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
25
  `git ls-files -z`.split("\x0").reject do |f|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
 
30
30
  spec.require_paths = ['ports/dsl']
31
31
 
32
- spec.add_dependency 'grpc', '~> 1.50'
32
+ spec.add_dependency 'grpc', '~> 1.51'
33
33
 
34
34
  spec.metadata['rubygems_mfa_required'] = 'true'
35
35
  end
data/logic/string.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module StringLogic
4
- def self.underscore(string)
5
- string.gsub(/::/, '/')
6
- .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
7
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
8
- .tr('-', '_')
9
- .downcase
3
+ module LNDClientInternal
4
+ module StringLogic
5
+ def self.underscore(string)
6
+ string.gsub(/::/, '/')
7
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
8
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
9
+ .tr('-', '_')
10
+ .downcase
11
+ end
10
12
  end
11
13
  end
@@ -5,10 +5,10 @@ require_relative '../../static/spec'
5
5
 
6
6
  module LNDClient
7
7
  def self.new(params)
8
- ClientController.new(params)
8
+ LNDClientInternal::ClientController.new(params)
9
9
  end
10
10
 
11
11
  def self.version
12
- Static::SPEC[:version]
12
+ LNDClientInternal::Static::SPEC[:version]
13
13
  end
14
14
  end
data/static/spec.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Static
4
- SPEC = {
5
- name: 'lnd-client',
6
- version: '0.0.2',
7
- author: 'icebaker',
8
- summary: 'Ruby Lightning Network Daemon (lnd) Client',
9
- description: 'Ruby Lightning Network Daemon (lnd) Client',
10
- github: 'https://github.com/icebaker/lnd-client',
11
- license: 'MIT'
12
- }.freeze
3
+ module LNDClientInternal
4
+ module Static
5
+ SPEC = {
6
+ name: 'lnd-client',
7
+ version: '0.0.4',
8
+ author: 'icebaker',
9
+ summary: 'Ruby Lightning Network Daemon (lnd) Client',
10
+ description: 'Ruby Lightning Network Daemon (lnd) Client',
11
+ github: 'https://github.com/icebaker/lnd-client',
12
+ license: 'MIT'
13
+ }.freeze
14
+ end
13
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lnd-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - icebaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.50'
19
+ version: '1.51'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.50'
26
+ version: '1.51'
27
27
  description: Ruby Lightning Network Daemon (lnd) Client
28
28
  email:
29
29
  executables: []