lnd-client 0.0.6 → 0.0.8
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/controllers/connection.rb +17 -4
- data/static/spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bde884b1430f8dd73f527adf0f90578bf7151bf411b77e7b3ba952f937bf675
|
4
|
+
data.tar.gz: 805112d53eaee06c7dc868f40a8ab4287805555c57dc6419dc8398223dc6a555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '087f58186e24b63d1fdaa79efb7c367f85c0715b231c233a81a671186967996f97184f5f857a783e2508f19b307cf7fa804beef61e127c30de77437ad8f81d61'
|
7
|
+
data.tar.gz: 4cecdf60d139163bebed559e0dbf74a4695a6990ba5925096e17452c4984fbd9f4e7ab3e6dabe6126b40fde01f33a58ebf8235726b87f5b8843193770c9c8709
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -16,13 +16,13 @@ This is a low-level client library. For a better experience, you may want to che
|
|
16
16
|
Add to your `Gemfile`:
|
17
17
|
|
18
18
|
```ruby
|
19
|
-
gem 'lnd-client', '~> 0.0.
|
19
|
+
gem 'lnd-client', '~> 0.0.8'
|
20
20
|
```
|
21
21
|
|
22
22
|
```ruby
|
23
23
|
require 'lnd-client'
|
24
24
|
|
25
|
-
puts LNDClient.version # => 0.0.
|
25
|
+
puts LNDClient.version # => 0.0.8
|
26
26
|
|
27
27
|
client = LNDClient.new(
|
28
28
|
'lndconnect://127.0.0.1:10009?cert=MIICJz...JBEERQ&macaroon=AgEDbG...45ukJ4'
|
@@ -98,5 +98,5 @@ gem build lnd-client.gemspec
|
|
98
98
|
|
99
99
|
gem signin
|
100
100
|
|
101
|
-
gem push lnd-client-0.0.
|
101
|
+
gem push lnd-client-0.0.8.gem
|
102
102
|
```
|
data/controllers/connection.rb
CHANGED
@@ -11,12 +11,21 @@ require_relative '../models/errors'
|
|
11
11
|
module LNDClientInternal
|
12
12
|
class Connection
|
13
13
|
def self.validate_params!(connection)
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
if connection.key?(:address) && !connection[:address].nil? && connection.key?(:host) && connection[:host].nil?
|
15
|
+
raise LNDClient::Errors::TooManyArgumentsError
|
16
|
+
end
|
17
|
+
|
18
|
+
if connection.key?(:address) && !connection[:address].nil? && connection.key?(:port) && !connection[:port].nil?
|
19
|
+
raise LNDClient::Errors::TooManyArgumentsError
|
20
|
+
end
|
21
|
+
|
22
|
+
if connection.key?(:certificate_path) && !connection[:certificate_path].nil? && connection.key?(:certificate) && !connection[:certificate].nil?
|
23
|
+
raise LNDClient::Errors::TooManyArgumentsError
|
24
|
+
end
|
25
|
+
|
26
|
+
if connection.key?(:macaroon_path) && !connection[:macaroon_path].nil? && connection.key?(:macaroon) && !connection[:macaroon].nil?
|
17
27
|
raise LNDClient::Errors::TooManyArgumentsError
|
18
28
|
end
|
19
|
-
raise LNDClient::Errors::TooManyArgumentsError if connection.key?(:macaroon_path) && connection.key?(:macaroon)
|
20
29
|
end
|
21
30
|
|
22
31
|
def self.expand(*params, &vcr)
|
@@ -87,9 +96,13 @@ module LNDClientInternal
|
|
87
96
|
certificate = params['cert'].tr('-_', '+/')
|
88
97
|
macaroon = Base64.urlsafe_decode64(params['macaroon'])
|
89
98
|
|
99
|
+
padding_needed = 4 - (certificate.length % 4)
|
100
|
+
certificate += '=' * padding_needed
|
101
|
+
|
90
102
|
certificate = "-----BEGIN CERTIFICATE-----\n#{certificate.gsub(/(.{64})/, "\\1\n")}\n-----END CERTIFICATE-----\n"
|
91
103
|
|
92
104
|
{
|
105
|
+
connect: params.first,
|
93
106
|
host: host,
|
94
107
|
port: port,
|
95
108
|
certificate: certificate,
|
data/static/spec.rb
CHANGED
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.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- icebaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|