lisk 0.5.0 → 0.6.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
- SHA1:
3
- metadata.gz: 8eafe7fb9b6dbf55042554ee4a579a0e0f5d418f
4
- data.tar.gz: e22f1dd7407b0d147c8fd9094a4b344894d43f28
2
+ SHA256:
3
+ metadata.gz: a37c06e83b5a76ef2f4986e3ff9b407a5392e437f53f3654723ef5dda30aecb7
4
+ data.tar.gz: 650407663c52d4dc9e6a18a917233dac7e575378082b1ce4d4769f78715e7cbf
5
5
  SHA512:
6
- metadata.gz: 0f361fd322d242a1c91dd3c7cf2befbd4ea04bc1f2a5240cce08a761c043ce79b86ab19c5bba7599e8710d969ae7d5b75ba0634d081daf961d4098424505ec3f
7
- data.tar.gz: 4ceb3c01274c177097f4a187747a8d55f51747a4831217870f09606948c147b9b9ca05408fffa6fa36495c473c9104bb280246cf5f75c18233ebac9db3b9f2ec
6
+ metadata.gz: 68995390562c4893ab5314f4d61eca68fdc0cc3855b13aa4d209d881a2c604fee663df5daf44750d68425689924e01a5ffb05394b048f77d20c8e13061b39f13
7
+ data.tar.gz: 0d9b6eaadcd3ad5c397bff2ea7317b739d3e54b72de175091d6f0c55fe201b9c8324c55fdffbfecad949f0fb279d119e602d022ae530c38a74dc16a3b0e880d8
data/CODE_OF_CONDUCT.md CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at 4fryn@users.noreply.github.com. All
58
+ reported by contacting the project team at github@4fry.net. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 4fryn
3
+ Copyright (c) 2017 4fryn Dings
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -10,8 +10,8 @@ This is very early work-in-progress. The idea is to publish this `gem` as soon a
10
10
 
11
11
  API Implemententation Status:
12
12
 
13
- - `Lisk::Legacy` 48/62 APIs for Lisk Core 0.8.0+ ([#4](https://github.com/4fryn/lisk.rb/issues/4))
14
- - `Lisk::Raw` 0/34 APIs for Lisk Core 1.0.0+ ([#1](https://github.com/4fryn/lisk.rb/issues/1))
13
+ - `Lisk::Legacy` 48/62 APIs for Lisk Core 0.8.0+ ([#4](https://github.com/lisk-builders/lisk.rb/issues/4))
14
+ - `Lisk::Raw` 0/34 APIs for Lisk Core 1.0.0+ ([#1](https://github.com/lisk-builders/lisk.rb/issues/1))
15
15
 
16
16
  ## Installation
17
17
 
@@ -55,7 +55,7 @@ if node.is_alive?
55
55
  end
56
56
  ```
57
57
 
58
- Get access to the Lisk-0.8.0 legacy API (see [#4](https://github.com/4fryn/lisk.rb/issues/4)).
58
+ Get access to the Lisk-0.8.0 legacy API (see [#4](https://github.com/lisk-builders/lisk.rb/issues/4)).
59
59
 
60
60
  ```ruby
61
61
  lisk = Lisk::API.new node
@@ -97,6 +97,10 @@ p "Lisk chain latest block: #{height}... total supply: #{supply}... block reward
97
97
 
98
98
  See `examples/*.rb` for more examples implementing the Lisk API.
99
99
 
100
+ ## API Documentation
101
+
102
+ Is available on Gh-Pages: https://lisk-builders.github.io/lisk.rb/ (work in progress [#2](https://github.com/lisk-builders/lisk.rb/issues/2)).
103
+
100
104
  ## Development
101
105
 
102
106
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -105,7 +109,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
105
109
 
106
110
  ## Contributing
107
111
 
108
- Bug reports and pull requests are welcome on GitHub at https://github.com/4fryn/lisk.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
112
+ Bug reports and pull requests are welcome on GitHub at https://github.com/lisk-builders/lisk.rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
109
113
 
110
114
  ## License
111
115
 
@@ -113,4 +117,4 @@ The gem is available as open source under the terms of the [MIT License](http://
113
117
 
114
118
  ## Code of Conduct
115
119
 
116
- Everyone interacting in the Lisk.rb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/4fryn/lisk.rb/blob/master/CODE_OF_CONDUCT.md).
120
+ Everyone interacting in the Lisk.rb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lisk-builders/lisk.rb/blob/master/CODE_OF_CONDUCT.md).
data/bin/debug CHANGED
@@ -5,8 +5,9 @@ echo $PWD
5
5
  gem uninstall lisk
6
6
  rm pkg/*.gem
7
7
  git add -A
8
+ bundle install
8
9
  bundle exec rake install
9
10
  ruby examples/status.rb
10
11
  #ruby examples/payout.rb
11
12
  #ruby examples/legacy_api.rb
12
- ruby examples/delegates.rb
13
+ #ruby examples/delegates.rb
@@ -115,7 +115,7 @@ _delegate_query = {
115
115
  :orderBy => "producedblocks:desc"
116
116
  }
117
117
 
118
- # Testing legacy API against https://github.com/4fryn/lisk.rb/issues/4
118
+ # Testing legacy API against https://github.com/lisk-builders/lisk.rb/issues/4
119
119
  account = legacy_api.accounts_open _secret
120
120
  p account
121
121
  balance = legacy_api.accounts_get_balance _address
data/examples/status.rb CHANGED
@@ -11,11 +11,11 @@ node = node.configure "127.0.0.1", 7000
11
11
  # Same as above, just in one line, let's stick to test network for now.
12
12
  node = Lisk::Client.new "127.0.0.1", 7000
13
13
 
14
- # Only proceed if the client is connected, active, and fully synchronized.
15
- if node.is_alive?
14
+ # Lisk tools wraps the raw API in meaningful methods.
15
+ api = Lisk::API.new node
16
16
 
17
- # Lisk tools wraps the raw API in meaningful methods.
18
- api = Lisk::API.new node
17
+ # Only proceed if the client is connected.
18
+ if node.is_alive? or api.is_syncing?
19
19
 
20
20
  # Lisk version API example.
21
21
  version = api.get_version
@@ -48,5 +48,5 @@ if node.is_alive?
48
48
  p "Lisk chain latest block: #{chain_height}... total supply: #{total_supply / 1e8}... block reward: #{block_reward / 1e8}"
49
49
 
50
50
  else
51
- p 'Lisk node disconnected, inactive, or not fully synchronized ...'
51
+ p 'Lisk node disconnected ...'
52
52
  end
data/lib/lisk/api.rb CHANGED
@@ -76,6 +76,22 @@ module Lisk
76
76
  end
77
77
  end
78
78
 
79
+ # Get the number of remaining local sync blocks.
80
+ def get_block id
81
+ block = self.blocks_get_by_id id
82
+ if block["success"]
83
+ return block["block"]
84
+ else
85
+ return nil
86
+ end
87
+ end
88
+
89
+ # Get block ping, returns true if block received in 120 seconds.
90
+ def get_block_health
91
+ healthy = self.loader_status_ping
92
+ return healthy["success"]
93
+ end
94
+
79
95
  # Get the global best block in the network.
80
96
  def get_chain_best_block
81
97
  blocks = self.blocks_get_height
@@ -147,9 +163,65 @@ module Lisk
147
163
  end
148
164
  end
149
165
 
166
+ # Get fees for sending transactions
167
+ def get_fee_send
168
+ fee = self.blocks_get_fees
169
+ if fee["success"]
170
+ return fee["fees"]["send"]
171
+ else
172
+ return nil
173
+ end
174
+ end
150
175
 
151
- #{}"fee"=>10000000
176
+ # Get fees for voting
177
+ def get_fee_vote
178
+ fee = self.blocks_get_fees
179
+ if fee["success"]
180
+ return fee["fees"]["vote"]
181
+ else
182
+ return nil
183
+ end
184
+ end
152
185
 
186
+ # Get fees for second signatures
187
+ def get_fee_secondsignature
188
+ fee = self.blocks_get_fees
189
+ if fee["success"]
190
+ return fee["fees"]["secondsignature"]
191
+ else
192
+ return nil
193
+ end
194
+ end
195
+
196
+ # Get fees for delegate registration
197
+ def get_fee_delegate
198
+ fee = self.blocks_get_fees
199
+ if fee["success"]
200
+ return fee["fees"]["delegate"]
201
+ else
202
+ return nil
203
+ end
204
+ end
205
+
206
+ # Get fees for multisignature registration
207
+ def get_fee_multisignature
208
+ fee = self.blocks_get_fees
209
+ if fee["success"]
210
+ return fee["fees"]["multisignature"]
211
+ else
212
+ return nil
213
+ end
214
+ end
215
+
216
+ # Get fees for dapps registration
217
+ def get_fee_dapp
218
+ fee = self.blocks_get_fees
219
+ if fee["success"]
220
+ return fee["fees"]["dapp"]
221
+ else
222
+ return nil
223
+ end
224
+ end
153
225
 
154
226
  # Get an array of all known peers.
155
227
  def get_peers
data/lib/lisk/legacy.rb CHANGED
@@ -345,9 +345,9 @@ module Lisk
345
345
  forgers = @client.query_get "delegates/getNextForgers", params
346
346
  end
347
347
 
348
- #############################################
349
- # https://github.com/4fryn/lisk.rb/issues/4 #
350
- #############################################
348
+ #####################################################
349
+ # https://github.com/lisk-builders/lisk.rb/issues/4 #
350
+ #####################################################
351
351
 
352
352
  # `PUT /dapps`
353
353
  def dapps_put
@@ -419,6 +419,8 @@ module Lisk
419
419
  todo "#{self}::#{__method__} UNIMPLEMENTED"
420
420
  end
421
421
 
422
+ #####################################################
423
+
422
424
  # Create a multi-signature account.
423
425
  # `PUT /multisignatures`
424
426
  def multisignatures_put secrets
data/lib/lisk/raw.rb CHANGED
@@ -17,9 +17,9 @@ module Lisk
17
17
  end
18
18
  end
19
19
 
20
- #############################################
21
- # https://github.com/4fryn/lisk.rb/issues/1 #
22
- #############################################
20
+ #####################################################
21
+ # https://github.com/lisk-builders/lisk.rb/issues/1 #
22
+ #####################################################
23
23
 
24
24
  # The "accounts" API
25
25
  def accounts
data/lib/lisk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lisk
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/lisk.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |lisk|
10
10
  lisk.email = ["ruby@4fry.net"]
11
11
 
12
12
  lisk.description = 'A Ruby wrapper for the Lisk blockchain platform API.'
13
- lisk.homepage = 'https://github.com/4fryn/lisk.rb'
13
+ lisk.homepage = 'https://github.com/lisk-builders/lisk.rb'
14
14
  lisk.summary = 'Lisk API Ruby wrapper.'
15
15
  lisk.license = "MIT"
16
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - 4fryn Dings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2018-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,7 @@ files:
97
97
  - lib/lisk/raw.rb
98
98
  - lib/lisk/version.rb
99
99
  - lisk.gemspec
100
- homepage: https://github.com/4fryn/lisk.rb
100
+ homepage: https://github.com/lisk-builders/lisk.rb
101
101
  licenses:
102
102
  - MIT
103
103
  metadata: {}
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.6.11
121
+ rubygems_version: 2.7.3
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Lisk API Ruby wrapper.