nano_rpc 0.15.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/nano_rpc/helpers/node_helper.rb +2 -2
- data/lib/nano_rpc/helpers/wallet_helper.rb +1 -1
- data/lib/nano_rpc/node.rb +1 -1
- data/lib/nano_rpc/proxies/wallet.rb +6 -11
- data/lib/nano_rpc/proxy.rb +0 -5
- data/lib/nano_rpc/version.rb +1 -1
- data/nano_rpc.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00840f9e543bcf5bf0aa1d1e80eab75f8eca85d57f563433e0e1953b7c2e21bd'
|
4
|
+
data.tar.gz: 1755874a4ad420ab7cb18ddd9fe75a6f64332a194b91694a2a91ed0ca7852ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d4d582586ce0edcac28a3f8225cca86ac121aaddd46a9f8fc568caee3e45a2ce4b14a2846f977a9ac33d7732c454d3f66df3272f1fdabe69fe17fa3a77ff328
|
7
|
+
data.tar.gz: 72a84f3052b62754cbede4be1cca2e82f708c0ed9eac085dbba8a53f1dee86f69ac46d26c62bc02cc5f2ad836e2f27169526816e17f6efcda69f929cffec47fd
|
data/README.md
CHANGED
@@ -41,12 +41,12 @@ Proxy objects are provided to ease interaction with the API by providing logical
|
|
41
41
|
* [NanoRpc::Node](https://github.com/jcraigk/ruby_nano_rpc/wiki/NanoRpc::Node)
|
42
42
|
* [NanoRpc::Wallet](https://github.com/jcraigk/ruby_nano_rpc/wiki/NanoRpc::Wallet)
|
43
43
|
|
44
|
-
`Account`, `Accounts`, and `Wallet` each require a single parameter to be passed during initialization (`address`, `addresses`, and `
|
44
|
+
`Account`, `Accounts`, and `Wallet` each require a single parameter to be passed during initialization (`address`, `addresses`, and `id`, respectively). This parameter is persisted for subsequent calls. All RPC methods are provided directly as methods.
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
account = NanoRpc.node.account('xrb_1234') # Account address required
|
48
48
|
accounts = NanoRpc.node.accounts(%w[xrb_1234 xrb_456]) # Array of account addresses required
|
49
|
-
wallet = NanoRpc.node.wallet('3AF91AE') # Wallet
|
49
|
+
wallet = NanoRpc.node.wallet('3AF91AE') # Wallet id required
|
50
50
|
```
|
51
51
|
|
52
52
|
You can call standard RPC methods on each object:
|
@@ -87,7 +87,7 @@ module NanoRpc::WalletHelper
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def move_accounts(to:, accounts:)
|
90
|
-
account_move(wallet: to, source:
|
90
|
+
account_move(wallet: to, source: id, accounts: accounts).moved == 1
|
91
91
|
end
|
92
92
|
|
93
93
|
def password_valid?(password:)
|
data/lib/nano_rpc/node.rb
CHANGED
@@ -3,24 +3,19 @@ class NanoRpc::Wallet
|
|
3
3
|
include NanoRpc::Proxy
|
4
4
|
include NanoRpc::WalletHelper
|
5
5
|
|
6
|
-
attr_reader :
|
6
|
+
attr_reader :id
|
7
7
|
|
8
|
-
def initialize(
|
9
|
-
unless
|
8
|
+
def initialize(id = nil, opts = {})
|
9
|
+
unless id.is_a?(String)
|
10
10
|
raise NanoRpc::MissingParameters,
|
11
|
-
'Missing argument:
|
11
|
+
'Missing argument: id (str)'
|
12
12
|
end
|
13
13
|
|
14
|
-
@
|
14
|
+
@id = id
|
15
15
|
super(opts)
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
def inspect
|
20
|
-
"#{inspect_prefix}, @node=#{@node.inspect}>"
|
21
|
-
end
|
22
|
-
|
23
|
-
proxy_params wallet: :seed
|
18
|
+
proxy_params wallet: :id
|
24
19
|
|
25
20
|
proxy_method :account_create, optional: %i[work]
|
26
21
|
proxy_method :accounts_create, required: %i[count], optional: %i[work]
|
data/lib/nano_rpc/proxy.rb
CHANGED
@@ -45,14 +45,9 @@ module NanoRpc::Proxy
|
|
45
45
|
|
46
46
|
def execute_call
|
47
47
|
result = node.call(@meth, @call_args)
|
48
|
-
handle_special_methods
|
49
48
|
expose_nested_data(result)
|
50
49
|
end
|
51
50
|
|
52
|
-
def handle_special_methods
|
53
|
-
@seed = @call_args[:seed] if @meth == :wallet_change_seed
|
54
|
-
end
|
55
|
-
|
56
51
|
def base_params
|
57
52
|
@base_params ||= begin
|
58
53
|
return if self.class.proxy_param_def.nil?
|
data/lib/nano_rpc/version.rb
CHANGED
data/nano_rpc.gemspec
CHANGED
@@ -23,12 +23,12 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = %w[lib]
|
25
25
|
|
26
|
-
spec.add_development_dependency 'bundler', '~> 1.16.
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.16.3'
|
27
27
|
spec.add_development_dependency 'codecov', '~> 0.1.10'
|
28
28
|
spec.add_development_dependency 'pry', '~> 0.11.3'
|
29
29
|
spec.add_development_dependency 'rake', '~> 12.3.1'
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.7.0'
|
31
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
31
|
+
spec.add_development_dependency 'rubocop', '~> 0.58.2'
|
32
32
|
spec.add_development_dependency 'simplecov', '~> 0.16.1'
|
33
33
|
|
34
34
|
spec.add_runtime_dependency 'hashie', '~> 3.5', '>= 3.5.7'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nano_rpc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Craig-Kuhn (JCK)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.16.
|
19
|
+
version: 1.16.3
|
20
20
|
type: :development
|
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.16.
|
26
|
+
version: 1.16.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: codecov
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.58.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.58.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: simplecov
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.7.
|
204
|
+
rubygems_version: 2.7.7
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: RPC wrapper for Nano digital nodes written in Ruby
|