nano_rpc 0.1.0 → 0.2.0

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: da3e826d03d97a0b481735d2c930a9f2dfd098167ae263c6a91b2b7da55dd607
4
- data.tar.gz: a22e93555b44d86f5b53cb07ca13d6bc16a38f6f1d9025051655604d146b16a3
3
+ metadata.gz: 5505de736e20d672bed90df3856fef48148882a3726f27bb10fa03eb2db5e4b0
4
+ data.tar.gz: 20a28a63f524ecc1af9a2a94f91b724b5996b767ba35202a7416841ffd98aac8
5
5
  SHA512:
6
- metadata.gz: 4ebe96119c1db5db4e4ac8d1a75a0dab74717d0fa718062fda33651820113b2021d5da2994fa7508cd67281c19e673d1b26229504720cef3fc77b46905686302
7
- data.tar.gz: 461f6bdd4eb3db88ca94c2781519616e58bb412e44ab407f6abc76a381b4faa55f0741e054f7604829b3958753f7592e5d2d6f82dc6c716854bf5355dc8a864e
6
+ metadata.gz: 61056e815bf6a31ccb9dbacc4581b4fd99ee9769fba6251c5f84da884f1bb9d430604a09fb053b4a21613e9b318b81f40c9950f1fc718d5bd4ff2656cf60f703
7
+ data.tar.gz: 03e4d60c84c306ebe878c527d00a3084b083de0e788795995dc0f0d2459f6a48b6e6c49f7a0e4474baaa2f81f9d727bbf9cad9ac0c170b3a03ef004e933d1cf8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nano RPC
2
2
 
3
- An RPC wrapper for Nano (the digital currency) written in Ruby. It connects to an individual Nano node that you control. There's a client object you can use to make explicit RPC calls as well as proxy objects with logically grouped helper methods ([Wiki](https://github.com/jcraigk/ruby_nano_rpc/wiki/Proxy-Object-Reference)).
3
+ An RPC wrapper for Nano digitial currency nodes. Arbitrary RPC access is provided along with proxy objects that expose helper methods ([Wiki](https://github.com/jcraigk/ruby_nano_rpc/wiki/Proxy-Object-Reference)).
4
4
 
5
5
  To run a Nano node locally, see [Nano Docker Docs](https://github.com/clemahieu/raiblocks/wiki/Docker-node).
6
6
 
@@ -65,10 +65,10 @@ Response data are provided as [Hashie](https://github.com/intridea/hashie) objec
65
65
  Proxy objects are provided to ease interaction with the API by providing logically grouped helper methods. Here we do not strictly follow the grouping as expressed in the [Nano RPC Docs](https://github.com/clemahieu/raiblocks/wiki/RPC-protocol). Instead, the following objects are provided:
66
66
 
67
67
  ```ruby
68
- Nano::Account # { account: 'xrb_address12345' }
69
- Nano::Accounts # { accounts: %w[xrb_address12345 xrb_address67890] }
68
+ Nano::Account
69
+ Nano::Accounts
70
70
  Nano::Node
71
- Nano::Wallet # { wallet: 'F3093AB' }
71
+ Nano::Wallet
72
72
  ```
73
73
 
74
74
  `Account`, `Accounts`, and `Wallet` each require a single parameter to be passed during initialization. This parameter is persisted for subsequent calls. All RPC methods are provided directly as methods.
@@ -99,13 +99,6 @@ There are also helper methods for terser code:
99
99
  # 0
100
100
  ```
101
101
 
102
- You can ask an object what helper methods it provides using `helper_methods` (coming soon):
103
-
104
- ```ruby
105
- account.helper_methods
106
- # => [:balance, :pending_balance, ...]
107
- ```
108
-
109
102
  `Node` methods are provided at both the instance and class levels:
110
103
 
111
104
  ```ruby
@@ -113,17 +106,19 @@ You can ask an object what helper methods it provides using `helper_methods` (co
113
106
  # => {"rpc_version"=>1, "store_version"=>10, "node_vendor"=>"RaiBlocks 9.0"}
114
107
 
115
108
  node = Nano::Node.new
116
- version.rpc_version
109
+ node.version.rpc_version
117
110
  # => 1
118
111
  node.peers
119
- # => {"peers"=>{"[::ffff:2.80.5.202]:64317"=>"5", "[::ffff:2.249.74.58]:7075"=>"5", "[::ffff:5.9.31.82]:7077"=>"4", ... }
112
+ # => {"[::ffff:2.80.5.202]:64317"=>"5", "[::ffff:2.249.74.58]:7075"=>"5", "[::ffff:5.9.31.82]:7077"=>"4", ... }
120
113
  node.available_supply
121
114
  # => {"available"=>132596127030666124778600855847014518457}
115
+ node.available
116
+ # => 132596127030666124778600855847014518457
122
117
  node.block_count.unchecked
123
118
  # => 4868605
124
119
  ```
125
120
 
126
- To connect to a custom node, instantiate a client and pass it into the proxy object as `client`:
121
+ You can point each proxy object at its own node by passing a custom client in:
127
122
 
128
123
  ```ruby
129
124
  client = Nano::Client.new(host: 'mynanonode', port: 1234)
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  module Nano::AccountProxyHelper
3
+ include Nano::ApplicationHelper
4
+
3
5
  def balance
4
6
  account_balance.balance
5
7
  end
@@ -8,12 +10,10 @@ module Nano::AccountProxyHelper
8
10
  account_block_count.block_count
9
11
  end
10
12
 
11
- def create(wallet:, work:)
12
- account_create(wallet: wallet, work: work).account
13
- end
14
-
15
- def history(count:)
16
- account_history(count: count).history
13
+ def history(opts)
14
+ account_history(
15
+ count: opts_pluck(opts, :count)
16
+ ).history
17
17
  end
18
18
 
19
19
  def info
@@ -21,23 +21,22 @@ module Nano::AccountProxyHelper
21
21
  end
22
22
 
23
23
  def key
24
- account_key.key
25
- end
26
-
27
- def list
28
- account_list.accounts
29
- end
30
-
31
- def move(wallet:, source:, accounts:)
32
- account_move(wallet: wallet, source: source, accounts: accounts).moved == 1
24
+ account_key['key']
33
25
  end
34
26
 
35
- def wallet_work(wallet:)
36
- work_get(wallet: wallet).work
27
+ def move(from:, to:)
28
+ account_move(
29
+ wallet: to,
30
+ source: from,
31
+ accounts: [address]
32
+ ).moved == 1
37
33
  end
38
34
 
39
35
  def wallet_work_set(wallet:, work:)
40
- work_set(wallet: wallet, work: work).work[:success] == ''
36
+ work_set(
37
+ wallet: wallet,
38
+ work: work
39
+ ).success == ''
41
40
  end
42
41
 
43
42
  def pending_balance
@@ -45,13 +44,19 @@ module Nano::AccountProxyHelper
45
44
  end
46
45
  alias balance_pending pending_balance
47
46
 
48
- def pending_blocks(count:, threshold: nil, exists: nil)
49
- pending(count: count, threshold: threshold, exists: exists).locks
47
+ def pending_blocks(count:, threshold: nil, source: nil)
48
+ pending(
49
+ count: count,
50
+ threshold: threshold,
51
+ source: source
52
+ ).blocks
50
53
  end
51
54
  alias blocks_pending pending_blocks
52
55
 
53
- def remove(wallet:)
54
- account_remove(wallet: wallet).removed == 1
56
+ def remove(opts)
57
+ account_remove(
58
+ wallet: opts_pluck(opts, :wallet)
59
+ ).removed == 1
55
60
  end
56
61
 
57
62
  def representative
@@ -60,7 +65,8 @@ module Nano::AccountProxyHelper
60
65
 
61
66
  def representative_set(wallet:, representative:)
62
67
  account_representative_set(
63
- wallet: wallet, representative: representative
68
+ wallet: wallet,
69
+ representative: representative
64
70
  ).set == 1
65
71
  end
66
72
 
@@ -1,19 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
  module Nano::AccountsProxyHelper
3
3
  def balances
4
- accounts_balances.balances
4
+ accounts_balances
5
+ .balances
6
+ .each_with_object({}) do |(k, v), hash|
7
+ hash[k] = v['balance']
8
+ end
5
9
  end
6
10
 
7
- def create(wallet:, count:, work: nil)
8
- accounts_create(wallet: wallet, count: count, work: work).accounts
11
+ def pending_balances
12
+ accounts_balances
13
+ .balances
14
+ .each_with_object({}) do |(k, v), hash|
15
+ hash[k] = v['pending']
16
+ end
9
17
  end
18
+ alias balances_pending pending_balances
10
19
 
11
20
  def frontiers
12
21
  accounts_frontiers.frontiers
13
22
  end
14
23
 
24
+ def move(from:, to:)
25
+ account_move(wallet: to, source: from).moved == 1
26
+ end
27
+
15
28
  def pending(count:, threshold: nil, source: nil)
16
- accounts_pending(count: count, threshold: threshold, source: source).blocks
29
+ accounts_pending(
30
+ count: count, threshold: threshold, source: source
31
+ ).blocks
17
32
  end
18
33
  alias pending_blocks pending
19
34
 
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+ module Nano::ApplicationHelper
3
+ private
4
+
5
+ def opts_pluck(opts, key)
6
+ opts.is_a?(Hash) ? opts[key] : opts
7
+ end
8
+ end
@@ -1,42 +1,58 @@
1
1
  # frozen_string_literal: true
2
2
  module Nano::NodeProxyHelper
3
- def account_containing_block(hash)
4
- block_account(hash: hash).account
3
+ include Nano::ApplicationHelper
4
+
5
+ def account_containing_block(opts)
6
+ block_account(opts_hash(opts)).account
5
7
  end
6
8
 
7
9
  def available
8
10
  available_supply.available
9
11
  end
10
12
 
11
- def krai_from(amount:)
12
- krai_from_raw(amount: amount).amount
13
+ def create_wallet
14
+ Nano::Wallet.new(wallet_create.wallet)
15
+ end
16
+
17
+ def krai_from(opts)
18
+ krai_from_raw(opts_amount(opts)).amount
13
19
  end
14
20
 
15
- def krai_to(amount:)
16
- krai_to_raw(amount: amount).amount
21
+ def krai_to(opts)
22
+ krai_to_raw(opts_amount(opts)).amount
17
23
  end
18
24
 
19
- def mrai_from(amount:)
20
- mrai_from_raw(amount: amount).amount
25
+ def mrai_from(opts)
26
+ mrai_from_raw(opts_amount(opts)).amount
21
27
  end
22
28
 
23
- def mrai_to(amount:)
24
- mrai_to_raw(amount: amount).amount
29
+ def mrai_to(opts)
30
+ mrai_to_raw(opts_amount(opts)).amount
25
31
  end
26
32
 
27
- def pending_exists?(hash:)
28
- pending_exists(hash: hash).exists == 1
33
+ def pending_exists?(opts)
34
+ pending_exists(opts_hash(opts)).exists == 1
29
35
  end
30
36
 
31
- def rai_from(amount:)
32
- rai_from_raw(amount: amount).amount
37
+ def rai_from(opts)
38
+ rai_from_raw(opts_amount(opts)).amount
33
39
  end
34
40
 
35
- def rai_to(amount:)
36
- rai_to_raw(amount: amount).amount
41
+ def rai_to(opts)
42
+ rai_to_raw(opts_amount(opts)).amount
37
43
  end
38
44
 
39
45
  def work_valid?(work:, hash:)
40
46
  work_validate(work: work, hash: hash).valid == 1
41
47
  end
48
+
49
+ private
50
+
51
+ def opts_amount(opts)
52
+ { amount: opts_pluck(opts, :amount) }
53
+ end
54
+
55
+ def opts_hash(opts)
56
+ { hash: opts_pluck(opts, :hash) }
57
+ end
42
58
  end
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  module Nano::WalletProxyHelper
3
- def account_work(account:)
4
- work_get.work(account: account).work
3
+ include Nano::ApplicationHelper
4
+
5
+ def account_work(opts)
6
+ work_get(opts_account(opts)).work
5
7
  end
6
8
 
7
- def add(key:, work: nil)
9
+ def add_key(key:, work: true)
8
10
  wallet_add(key: key, work: work).account
9
11
  end
10
12
 
@@ -13,39 +15,53 @@ module Nano::WalletProxyHelper
13
15
  end
14
16
 
15
17
  def balances(threshold: nil)
16
- wallet_balances(threshold: threshold).balances
18
+ wallet_balances(threshold: threshold)
19
+ .balances
20
+ .each_with_object({}) do |(k, v), hash|
21
+ hash[k] = v['balance'].to_i
22
+ end
17
23
  end
18
24
 
19
25
  def begin_payment
20
26
  payment_begin.account
21
27
  end
22
28
 
23
- def change_password(new_password:)
24
- password_change(password: new_password).changed == 1
29
+ def change_password(opts)
30
+ password_change(
31
+ password: opts_pluck(opts, :new_password)
32
+ ).changed == 1
33
+ end
34
+
35
+ def change_seed(opts)
36
+ wallet_change_seed(
37
+ seed: opts_pluck(opts, :new_seed)
38
+ ).success == ''
25
39
  end
26
40
 
27
- def change_seed(new_seed:)
28
- wallet_change_seed(seed: new_seed)[:success] == ''
41
+ def contains?(opts)
42
+ wallet_contains(opts_account(opts)).exists == 1
29
43
  end
30
44
 
31
- def contains?(account:)
32
- wallet_contains(account: account).exists == 1
45
+ def create_account(work: true)
46
+ account_create(work: work).account
33
47
  end
34
48
 
35
- def create
36
- wallet_create.wallet
49
+ def create_accounts(count:, work: true)
50
+ accounts_create(count: count, work: work).accounts
37
51
  end
38
52
 
39
53
  def destroy
40
54
  wallet_destroy
41
55
  end
42
56
 
43
- def enter_password(password)
44
- password_enter(password: password).valid == 1
57
+ def enter_password(opts)
58
+ password_enter(
59
+ password: opts_pluck(opts, :password)
60
+ ).valid == 1
45
61
  end
46
62
 
47
63
  def export
48
- JSON[wallet_export.json]
64
+ Nano::Response.new(JSON[wallet_export.json])
49
65
  end
50
66
 
51
67
  def frontiers
@@ -60,46 +76,88 @@ module Nano::WalletProxyHelper
60
76
  wallet_locked.locked == 1
61
77
  end
62
78
 
63
- def password_valid?(password:)
64
- password_valid(password: password).valid == 1
79
+ def move_accounts(to:, accounts:)
80
+ account_move(
81
+ wallet: to,
82
+ source: seed,
83
+ accounts: accounts
84
+ ).moved == 1
85
+ end
86
+
87
+ def password_valid?(opts)
88
+ password_valid(
89
+ password: opts_pluck(opts, :password)
90
+ ).valid == 1
65
91
  end
66
92
 
67
93
  def pending_balance
68
94
  wallet_balance_total.pending
69
95
  end
96
+ alias balance_pending pending_balance
97
+
98
+ def pending_balances(threshold: nil)
99
+ wallet_balances(threshold: threshold)
100
+ .balances
101
+ .each_with_object({}) do |(k, v), hash|
102
+ hash[k] = v['pending'].to_i
103
+ end
104
+ end
105
+ alias balances_pending pending_balances
70
106
 
71
107
  def pending_blocks(count:, threshold: nil, source: nil)
72
- wallet_pending(count: count, threshold: threshold, source: source).blocks
108
+ wallet_pending(
109
+ count: count,
110
+ threshold: threshold,
111
+ source: source
112
+ ).blocks
73
113
  end
114
+ alias blocks_pending pending_blocks
74
115
 
75
116
  def receive_block(account:, block:)
76
- receive.block(account: account, block: block).block
117
+ receive(account: account, block: block).block
118
+ end
119
+
120
+ def remove_account(opts)
121
+ account_remove(opts_account(opts)).removed == 1
77
122
  end
78
123
 
79
124
  def representative
80
125
  wallet_representative.representative
81
126
  end
82
127
 
83
- def republish(count:)
84
- wallet_republish(count: count).blocks
128
+ def republish(opts)
129
+ wallet_republish(count: opts_pluck(opts, :count)).blocks
85
130
  end
86
131
 
87
132
  def account_work_set(account:, work:)
88
- work_set(account: account, work: work).work[:success] == ''
133
+ work_set(account: account, work: work).success == ''
89
134
  end
90
135
  alias set_account_work account_work_set
91
136
 
92
- def representative_set(representative:)
93
- wallet_representative_set(representative: representative).set == 1
137
+ def representative_set(opts)
138
+ wallet_representative_set(
139
+ representative: opts_pluck(opts, :representative)
140
+ ).set == 1
94
141
  end
95
142
  alias set_representative representative_set
96
143
 
97
- def send_tx(source:, destination:, amount:)
98
- rai_send(source: source, destination: destination, amount: amount).block
144
+ def send_nano(from:, to:, amount:, work: nil)
145
+ send_currency(
146
+ source: from,
147
+ destination: to,
148
+ amount: amount,
149
+ work: work
150
+ ).block
99
151
  end
100
- alias send_transaction send_tx
152
+ alias send_transaction send_nano
101
153
 
102
154
  def work
103
155
  wallet_work_get.works
104
156
  end
157
+
158
+ private
159
+
160
+ def opts_account(opts)
161
+ { account: opts_pluck(opts, :account) }
162
+ end
105
163
  end
@@ -12,7 +12,7 @@ class Nano::Account
12
12
  end
13
13
 
14
14
  @address = address
15
- @client = opts[:client] || Nano.client
15
+ super(opts)
16
16
  end
17
17
 
18
18
  proxy_params account: :address
@@ -22,7 +22,6 @@ class Nano::Account
22
22
  proxy_method :account_info
23
23
  proxy_method :account_create, required: %i[wallet], optional: %i[work]
24
24
  proxy_method :account_history, required: %i[count]
25
- proxy_method :account_list
26
25
  proxy_method :account_move, required: %i[wallet source accounts]
27
26
  proxy_method :account_key
28
27
  proxy_method :account_remove, required: %i[wallet]
@@ -5,18 +5,19 @@ class Nano::Accounts
5
5
 
6
6
  attr_accessor :addresses
7
7
 
8
- def initialize(addresses = nil, client = nil)
8
+ def initialize(addresses = nil, opts = {})
9
9
  unless addresses.is_a?(Array)
10
10
  raise Nano::MissingParameters,
11
11
  'Missing argument: addresses (str[])'
12
12
  end
13
13
 
14
14
  @addresses = addresses
15
- @client = client || Nano.client
15
+ super(opts)
16
16
  end
17
17
 
18
18
  proxy_params accounts: :addresses
19
19
 
20
+ proxy_method :account_move, required: %i[wallet source]
20
21
  proxy_method :accounts_balances
21
22
  proxy_method :accounts_create, required: %i[wallet count], optional: %i[work]
22
23
  proxy_method :accounts_frontiers
@@ -46,6 +46,7 @@ class Nano::Node
46
46
  proxy_method :unchecked_get, required: %i[hash]
47
47
  proxy_method :unchecked_keys, required: %i[key count]
48
48
  proxy_method :version
49
+ proxy_method :wallet_create
49
50
  proxy_method :work_cancel, required: %i[hash]
50
51
  proxy_method :work_generate, required: %i[hash]
51
52
  proxy_method :work_peer_add, required: %i[address port]
@@ -5,25 +5,29 @@ class Nano::Wallet
5
5
 
6
6
  attr_accessor :seed
7
7
 
8
- def initialize(wallet_seed = nil, opts = {})
9
- unless wallet_seed.is_a?(String)
8
+ def initialize(seed = nil, opts = {})
9
+ unless seed.is_a?(String)
10
10
  raise Nano::MissingParameters,
11
11
  'Missing argument: address (str)'
12
12
  end
13
13
 
14
- @seed = wallet_seed
15
- @client = opts[:client] || Nano.client
14
+ @seed = seed
15
+ super(opts)
16
16
  end
17
17
 
18
18
  proxy_params wallet: :seed
19
19
 
20
+ proxy_method :account_create, optional: %i[work]
21
+ proxy_method :accounts_create, required: %i[count], optional: %i[work]
22
+ proxy_method :account_list
23
+ proxy_method :account_remove, required: %i[account]
20
24
  proxy_method :password_change, required: %i[password]
21
25
  proxy_method :password_enter, required: %i[password]
22
26
  proxy_method :password_valid
23
27
  proxy_method :payment_begin
24
28
  proxy_method :payment_init
25
29
  proxy_method :payment_end, required: %i[account]
26
- proxy_method :receive, required: %i[account block]
30
+ proxy_method :receive, required: %i[account block], optional: %i[work]
27
31
  proxy_method :send, required: %i[wallet source destination amount]
28
32
  proxy_method :search_pending
29
33
  proxy_method :wallet_add, required: %i[key], optional: %i[work]
@@ -31,7 +35,6 @@ class Nano::Wallet
31
35
  proxy_method :wallet_balances, optional: %i[threshold]
32
36
  proxy_method :wallet_change_seed, required: %i[seed]
33
37
  proxy_method :wallet_contains, required: %i[account]
34
- proxy_method :wallet_create
35
38
  proxy_method :wallet_destroy
36
39
  proxy_method :wallet_export
37
40
  proxy_method :wallet_frontiers
data/lib/nano/proxy.rb CHANGED
@@ -30,23 +30,25 @@ module Nano::Proxy
30
30
  end
31
31
 
32
32
  def define_proxy_method(m, singleton = false)
33
- send(
34
- singleton ? :define_singleton_method : :define_method,
35
- method_alias(m)
36
- ) do |opts = {}|
33
+ send(method_style(singleton), method_alias(m)) do |opts = {}|
37
34
  params = Nano::ProxyContext.new(
38
35
  singleton ? self : self.class, m, opts
39
36
  ).populate_params(singleton ? nil : base_params)
40
- data = Nano.client.call(m, params)
37
+ data = (singleton ? Nano.client : @client).call(m, params)
38
+ # If single-key response matches method name, expose nested data
41
39
  data.is_a?(Hash) && data.keys.map(&:to_s) == [m.to_s] ? data[m] : data
42
40
  end
43
41
  end
44
42
 
45
43
  private
46
44
 
45
+ def method_style(singleton)
46
+ singleton ? :define_singleton_method : :define_method
47
+ end
48
+
47
49
  # Nano `send` action is also the method caller in Ruby ;)
48
50
  def method_alias(m)
49
- m == :send ? :tx_send : m
51
+ m == :send ? :send_currency : m
50
52
  end
51
53
 
52
54
  def method_missing(m, *args, &_block)
@@ -62,11 +64,6 @@ module Nano::Proxy
62
64
  def valid_method?(m)
63
65
  proxy_param_def.nil? && methods.include?(m)
64
66
  end
65
-
66
- def proxy_context(m)
67
- @proxy_context ||= {}
68
- @proxy_context[m] ||= Nano::ProxyContext.new(self, m)
69
- end
70
67
  end
71
68
 
72
69
  def proxy_methods
@@ -8,10 +8,6 @@ class Nano::ProxyContext
8
8
  @opts = opts
9
9
  end
10
10
 
11
- def valid_proxy_method?
12
- rpc_action?
13
- end
14
-
15
11
  def populate_params(params)
16
12
  opts = validate_opts!
17
13
  opts.merge!(params) if params
@@ -69,12 +65,4 @@ class Nano::ProxyContext
69
65
  def base_param_keys
70
66
  @param_def.is_a?(Hash) ? @param_def.keys : []
71
67
  end
72
-
73
- def method_expansion
74
- "#{action_prefix}#{@m}"
75
- end
76
-
77
- def action_prefix
78
- @klass.name.split('::').last.downcase + '_'
79
- end
80
68
  end
data/lib/nano/response.rb CHANGED
@@ -18,8 +18,14 @@ class Nano::Response < Hash
18
18
  end
19
19
 
20
20
  def to_f_or_i_or_s(v)
21
+ return if v.nil?
22
+ return v.to_i if big_integer?(v)
21
23
  (float = Float(v)) && (float % 1.0).zero? ? float.to_i : float
22
- rescue ArgumentError, TypeErrror
24
+ rescue ArgumentError, TypeError
23
25
  v
24
26
  end
27
+
28
+ def big_integer?(v)
29
+ v.respond_to?(:to_i) && v.to_i > 1_000_000_000_000_000
30
+ end
25
31
  end
data/lib/nano/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Nano
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
data/lib/nano_rpc.rb CHANGED
@@ -5,6 +5,7 @@ require 'nano/errors'
5
5
  require 'nano/proxy'
6
6
  require 'nano/proxy_context'
7
7
  require 'nano/response'
8
+ require 'nano/helpers/application_helper'
8
9
  require 'nano/helpers/account_proxy_helper'
9
10
  require 'nano/helpers/accounts_proxy_helper'
10
11
  require 'nano/helpers/node_proxy_helper'
data/nano_rpc.gemspec CHANGED
@@ -10,10 +10,9 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['jcraigk@gmail.com']
11
11
 
12
12
  spec.summary = 'RPC wrapper for Nano digital nodes written in Ruby'
13
- spec.description = 'An RPC wrapper for Nano nodes written in Ruby.' \
14
- 'It connects to an individual node that you control. ' \
15
- 'A client object provides arbitrary RPC access and ' \
16
- 'proxy objects provide logically grouped helper methods.'
13
+ spec.description = 'An RPC wrapper for Nano digitial currency nodes. ' \
14
+ 'Arbitrary RPC access is provided along with proxy ' \
15
+ 'objects that expose helper methods.'
17
16
  spec.homepage = 'https://github.com/jcraigk/ruby_nano_rpc'
18
17
  spec.license = 'MIT'
19
18
 
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.1.0
4
+ version: 0.2.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-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,9 +134,8 @@ dependencies:
134
134
  - - ">="
135
135
  - !ruby/object:Gem::Version
136
136
  version: 2.0.2
137
- description: An RPC wrapper for Nano nodes written in Ruby.It connects to an individual
138
- node that you control. A client object provides arbitrary RPC access and proxy objects
139
- provide logically grouped helper methods.
137
+ description: An RPC wrapper for Nano digitial currency nodes. Arbitrary RPC access
138
+ is provided along with proxy objects that expose helper methods.
140
139
  email:
141
140
  - jcraigk@gmail.com
142
141
  executables: []
@@ -156,6 +155,7 @@ files:
156
155
  - lib/nano/errors.rb
157
156
  - lib/nano/helpers/account_proxy_helper.rb
158
157
  - lib/nano/helpers/accounts_proxy_helper.rb
158
+ - lib/nano/helpers/application_helper.rb
159
159
  - lib/nano/helpers/node_proxy_helper.rb
160
160
  - lib/nano/helpers/wallet_proxy_helper.rb
161
161
  - lib/nano/proxies/account.rb