sibit 0.20.1 → 0.20.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sibit +11 -2
- data/features/cli.feature +1 -1
- data/lib/sibit/btc.rb +4 -1
- data/lib/sibit/firstof.rb +1 -0
- data/lib/sibit/version.rb +1 -1
- data/sibit.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0734db295c639e548f4b51d170e87bbabe2c6b94d7d4ba7e858716b74f145185
|
4
|
+
data.tar.gz: 9ff51aecc8e78f13917907f62e6485800531dd7d36198df80b5a089831fcbfcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0095805aee3fbe209a73bcda6a9832e9aa26b43414232c6fa59d6fbed09a7648bcd6739e76a558106f86a152a9ebbf5b36c32afffd927f9a2f5feaa34fa4c4d4'
|
7
|
+
data.tar.gz: 0fde0492c34a1f636180f01d0a331da019e8b461b0819909869cd9f0b5b3f6fb9070f1d79fa6a80f87f3f8903975abeeb7a6e30e9b9b8a4fa5de7f8fbf522794
|
data/bin/sibit
CHANGED
@@ -29,9 +29,12 @@ require 'retriable_proxy'
|
|
29
29
|
require_relative '../lib/sibit'
|
30
30
|
require_relative '../lib/sibit/version'
|
31
31
|
require_relative '../lib/sibit/blockchain'
|
32
|
+
require_relative '../lib/sibit/blockchair'
|
32
33
|
require_relative '../lib/sibit/btc'
|
33
34
|
require_relative '../lib/sibit/bitcoinchain'
|
35
|
+
require_relative '../lib/sibit/cex'
|
34
36
|
require_relative '../lib/sibit/earn'
|
37
|
+
require_relative '../lib/sibit/fake'
|
35
38
|
require_relative '../lib/sibit/firstof'
|
36
39
|
|
37
40
|
begin
|
@@ -62,7 +65,7 @@ Options are:"
|
|
62
65
|
o.array(
|
63
66
|
'--api',
|
64
67
|
'Ordered List of APIs to use, e.g. "earn,blockchain,btc,bitcoinchain"',
|
65
|
-
default: %w[earn blockchain btc bitcoinchain]
|
68
|
+
default: %w[earn blockchain btc bitcoinchain blockchair cex]
|
66
69
|
)
|
67
70
|
end
|
68
71
|
rescue Slop::Error => ex
|
@@ -79,6 +82,12 @@ Options are:"
|
|
79
82
|
api = Sibit::Btc.new(http: http, log: log, dry: opts[:dry])
|
80
83
|
elsif a == 'bitcoinchain'
|
81
84
|
api = Sibit::Bitcoinchain.new(http: http, log: log, dry: opts[:dry])
|
85
|
+
elsif a == 'blockchair'
|
86
|
+
api = Sibit::Blockchair.new(http: http, log: log, dry: opts[:dry])
|
87
|
+
elsif a == 'cex'
|
88
|
+
api = Sibit::Cex.new(http: http, log: log, dry: opts[:dry])
|
89
|
+
elsif a == 'fake'
|
90
|
+
api = Sibit::Fake.new
|
82
91
|
elsif a == 'earn'
|
83
92
|
api = Sibit::Earn.new(http: http, log: log, dry: opts[:dry])
|
84
93
|
else
|
@@ -87,7 +96,7 @@ Options are:"
|
|
87
96
|
api = RetriableProxy.for_object(api, on: Sibit::Error) if opts[:attempts] > 1
|
88
97
|
api
|
89
98
|
end
|
90
|
-
sibit = Sibit.new(log: log, api: Sibit::FirstOf.new(apis, log: log))
|
99
|
+
sibit = Sibit.new(log: log, api: Sibit::FirstOf.new(apis, log: log, verbose: true))
|
91
100
|
case opts.arguments[0]
|
92
101
|
when 'price'
|
93
102
|
puts sibit.price
|
data/features/cli.feature
CHANGED
data/lib/sibit/btc.rb
CHANGED
@@ -95,6 +95,7 @@ class Sibit
|
|
95
95
|
data = json['data']
|
96
96
|
raise Sibit::Error, "The block #{hash} not found" if data.nil?
|
97
97
|
h = data['height']
|
98
|
+
raise Sibit::Error, "The block #{hash} found but the height is absent" if h.nil?
|
98
99
|
@log.info("The height of #{hash} is #{h}")
|
99
100
|
h
|
100
101
|
end
|
@@ -124,7 +125,9 @@ class Sibit
|
|
124
125
|
)
|
125
126
|
data = json['data']
|
126
127
|
raise Sibit::Error, "The address #{hash} not found" if data.nil?
|
127
|
-
data['list']
|
128
|
+
txns = data['list']
|
129
|
+
next if txns.nil?
|
130
|
+
txns.each do |u|
|
128
131
|
outs = Sibit::Json.new(http: @http, log: @log).get(
|
129
132
|
URI("https://chain.api.btc.com/v3/tx/#{u['tx_hash']}?verbose=3")
|
130
133
|
)['data']['outputs']
|
data/lib/sibit/firstof.rb
CHANGED
data/lib/sibit/version.rb
CHANGED
data/sibit.gemspec
CHANGED
@@ -55,7 +55,7 @@ and Ruby 2.3+.'
|
|
55
55
|
s.add_runtime_dependency 'retriable_proxy', '1.0.2'
|
56
56
|
s.add_runtime_dependency 'slop', '~> 4.6'
|
57
57
|
s.add_development_dependency 'aruba', '~> 0.14.1'
|
58
|
-
s.add_development_dependency 'codecov', '0.
|
58
|
+
s.add_development_dependency 'codecov', '0.2.8'
|
59
59
|
s.add_development_dependency 'cucumber', '~> 1.3.17'
|
60
60
|
s.add_development_dependency 'debase', '0.2.2'
|
61
61
|
s.add_development_dependency 'minitest', '5.5.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sibit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: backtrace
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.2.8
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.2.8
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: cucumber
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|