peatio-bitcoincash 2.4.0 → 2.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +75 -37
- data/lib/peatio/bitcoincash/blockchain.rb +11 -0
- data/lib/peatio/bitcoincash/client.rb +7 -5
- data/lib/peatio/bitcoincash/hooks.rb +2 -2
- data/lib/peatio/bitcoincash/version.rb +1 -1
- data/peatio-bitcoincash.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48b2f2ab9c8a1c69e3ffc4437dc7288b0dc4ba014c7bbdbf55703ab87b246d38
|
4
|
+
data.tar.gz: 66fb09f0725d67ea994d8dd33f39381f11fb54775eaa4c4f39be40a2c91f37a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e78082443be6dfbdd3a7392d86d653bd3ca443cfac0181a1171a81c432411cea7003288ad77b1f1341889593348e60757d0cb4a05f38a2f50792f5d86944fb2
|
7
|
+
data.tar.gz: c7e72eb4fa1571e6819a912aa44fe96e681d2e6a8c7747a88c12d196a445b74f453bf270db367ed1e8b0a3dc3965f90723d8f6e216824cfe14631bc7d7590d32
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
peatio-bitcoincash (2.4
|
4
|
+
peatio-bitcoincash (2.5.4)
|
5
5
|
activesupport (~> 5.2.3)
|
6
6
|
better-faraday (~> 1.0.5)
|
7
7
|
cash-addr (~> 0.2.0)
|
8
|
-
faraday (~> 0.
|
8
|
+
faraday (~> 0.17)
|
9
9
|
memoist (~> 0.16.0)
|
10
10
|
net-http-persistent (~> 3.0.1)
|
11
11
|
peatio (>= 0.6.3)
|
@@ -13,16 +13,16 @@ PATH
|
|
13
13
|
GEM
|
14
14
|
remote: https://rubygems.org/
|
15
15
|
specs:
|
16
|
-
activemodel (5.2.3)
|
17
|
-
activesupport (= 5.2.3)
|
18
|
-
activesupport (5.2.3)
|
16
|
+
activemodel (5.2.4.3)
|
17
|
+
activesupport (= 5.2.4.3)
|
18
|
+
activesupport (5.2.4.3)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 0.7, < 2)
|
21
21
|
minitest (~> 5.1)
|
22
22
|
tzinfo (~> 1.1)
|
23
23
|
addressable (2.7.0)
|
24
24
|
public_suffix (>= 2.0.2, < 5.0)
|
25
|
-
amq-protocol (2.3.
|
25
|
+
amq-protocol (2.3.1)
|
26
26
|
amqp (1.8.0)
|
27
27
|
amq-protocol (>= 2.2.0)
|
28
28
|
eventmachine
|
@@ -30,77 +30,115 @@ GEM
|
|
30
30
|
better-faraday (1.0.8)
|
31
31
|
activesupport (>= 4.0, < 6.0)
|
32
32
|
faraday (~> 0.12)
|
33
|
-
bunny (2.
|
34
|
-
amq-protocol (~> 2.3, >= 2.3.
|
35
|
-
byebug (11.
|
33
|
+
bunny (2.15.0)
|
34
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
35
|
+
byebug (11.1.1)
|
36
36
|
cash-addr (0.2.0)
|
37
37
|
base58 (~> 0.2.2)
|
38
38
|
clamp (1.3.1)
|
39
39
|
coderay (1.1.2)
|
40
|
-
concurrent-ruby (1.1.
|
41
|
-
connection_pool (2.2.
|
40
|
+
concurrent-ruby (1.1.6)
|
41
|
+
connection_pool (2.2.3)
|
42
|
+
cookiejar (0.3.3)
|
42
43
|
crack (0.4.3)
|
43
44
|
safe_yaml (~> 1.0.0)
|
45
|
+
daemons (1.3.1)
|
44
46
|
diff-lcs (1.3)
|
47
|
+
em-http-request (1.1.6)
|
48
|
+
addressable (>= 2.3.4)
|
49
|
+
cookiejar (!= 0.3.1)
|
50
|
+
em-socksify (>= 0.3)
|
51
|
+
eventmachine (>= 1.0.3)
|
52
|
+
http_parser.rb (>= 0.6.0)
|
53
|
+
em-socksify (0.3.2)
|
54
|
+
eventmachine (>= 1.0.0.beta.4)
|
55
|
+
em-synchrony (1.0.6)
|
56
|
+
eventmachine (>= 1.0.0.beta.1)
|
45
57
|
em-websocket (0.5.1)
|
46
58
|
eventmachine (>= 0.12.9)
|
47
59
|
http_parser.rb (~> 0.6.0)
|
48
60
|
eventmachine (1.2.7)
|
49
|
-
faraday (0.
|
61
|
+
faraday (0.17.3)
|
50
62
|
multipart-post (>= 1.2, < 3)
|
51
|
-
|
63
|
+
faraday_middleware (0.13.1)
|
64
|
+
faraday (>= 0.7.4, < 1.0)
|
65
|
+
faye (1.3.0)
|
66
|
+
cookiejar (>= 0.3.0)
|
67
|
+
em-http-request (>= 0.3.0)
|
68
|
+
eventmachine (>= 0.12.0)
|
69
|
+
faye-websocket (>= 0.9.1)
|
70
|
+
multi_json (>= 1.0.0)
|
71
|
+
rack (>= 1.0.0)
|
72
|
+
websocket-driver (>= 0.5.1)
|
73
|
+
faye-websocket (0.10.9)
|
74
|
+
eventmachine (>= 0.12.0)
|
75
|
+
websocket-driver (>= 0.5.1)
|
76
|
+
hashdiff (1.0.1)
|
52
77
|
http_parser.rb (0.6.0)
|
53
|
-
i18n (1.
|
78
|
+
i18n (1.8.3)
|
54
79
|
concurrent-ruby (~> 1.0)
|
55
80
|
jwt (2.2.1)
|
56
|
-
memoist (0.16.
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
metaclass (~> 0.0.1)
|
81
|
+
memoist (0.16.2)
|
82
|
+
method_source (1.0.0)
|
83
|
+
minitest (5.14.1)
|
84
|
+
mocha (1.11.2)
|
85
|
+
multi_json (1.14.1)
|
62
86
|
multipart-post (2.1.1)
|
63
|
-
mysql2 (0.5.
|
87
|
+
mysql2 (0.5.3)
|
64
88
|
net-http-persistent (3.0.1)
|
65
89
|
connection_pool (~> 2.2)
|
66
|
-
peatio (
|
90
|
+
peatio (2.6.1)
|
67
91
|
activemodel (> 5.2, <= 6.0.0)
|
68
92
|
amqp
|
69
93
|
bunny
|
70
94
|
clamp
|
95
|
+
em-synchrony (~> 1.0)
|
71
96
|
em-websocket
|
72
97
|
eventmachine
|
98
|
+
faraday_middleware (~> 0.13.1)
|
99
|
+
faye (~> 1.2)
|
73
100
|
jwt
|
74
101
|
mysql2
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
pry
|
102
|
+
prometheus-client
|
103
|
+
thin
|
104
|
+
prometheus-client (2.0.0)
|
105
|
+
pry (0.13.0)
|
106
|
+
coderay (~> 1.1)
|
107
|
+
method_source (~> 1.0)
|
108
|
+
pry-byebug (3.9.0)
|
79
109
|
byebug (~> 11.0)
|
80
|
-
pry (~> 0.
|
81
|
-
public_suffix (4.0.
|
82
|
-
|
110
|
+
pry (~> 0.13.0)
|
111
|
+
public_suffix (4.0.4)
|
112
|
+
rack (2.2.2)
|
113
|
+
rake (13.0.1)
|
83
114
|
rspec (3.9.0)
|
84
115
|
rspec-core (~> 3.9.0)
|
85
116
|
rspec-expectations (~> 3.9.0)
|
86
117
|
rspec-mocks (~> 3.9.0)
|
87
|
-
rspec-core (3.9.
|
88
|
-
rspec-support (~> 3.9.
|
89
|
-
rspec-expectations (3.9.
|
118
|
+
rspec-core (3.9.1)
|
119
|
+
rspec-support (~> 3.9.1)
|
120
|
+
rspec-expectations (3.9.1)
|
90
121
|
diff-lcs (>= 1.2.0, < 2.0)
|
91
122
|
rspec-support (~> 3.9.0)
|
92
|
-
rspec-mocks (3.9.
|
123
|
+
rspec-mocks (3.9.1)
|
93
124
|
diff-lcs (>= 1.2.0, < 2.0)
|
94
125
|
rspec-support (~> 3.9.0)
|
95
|
-
rspec-support (3.9.
|
126
|
+
rspec-support (3.9.2)
|
96
127
|
safe_yaml (1.0.5)
|
128
|
+
thin (1.7.2)
|
129
|
+
daemons (~> 1.0, >= 1.0.9)
|
130
|
+
eventmachine (~> 1.0, >= 1.0.4)
|
131
|
+
rack (>= 1, < 3)
|
97
132
|
thread_safe (0.3.6)
|
98
|
-
tzinfo (1.2.
|
133
|
+
tzinfo (1.2.7)
|
99
134
|
thread_safe (~> 0.1)
|
100
|
-
webmock (3.
|
135
|
+
webmock (3.8.3)
|
101
136
|
addressable (>= 2.3.6)
|
102
137
|
crack (>= 0.3.2)
|
103
138
|
hashdiff (>= 0.4.0, < 2.0.0)
|
139
|
+
websocket-driver (0.7.2)
|
140
|
+
websocket-extensions (>= 0.1.0)
|
141
|
+
websocket-extensions (0.1.5)
|
104
142
|
|
105
143
|
PLATFORMS
|
106
144
|
ruby
|
@@ -110,7 +148,7 @@ DEPENDENCIES
|
|
110
148
|
mocha (~> 1.8)
|
111
149
|
peatio-bitcoincash!
|
112
150
|
pry-byebug
|
113
|
-
rake (~>
|
151
|
+
rake (~> 13.0)
|
114
152
|
rspec (~> 3.0)
|
115
153
|
webmock (~> 3.5)
|
116
154
|
|
@@ -53,6 +53,17 @@ module Peatio
|
|
53
53
|
raise Peatio::Blockchain::ClientError, e
|
54
54
|
end
|
55
55
|
|
56
|
+
def transaction_sources(transaction)
|
57
|
+
transaction_hash = client.json_rpc(:getrawtransaction, [transaction.hash, 1])
|
58
|
+
transaction_hash['vin'].each_with_object([]) do |vin, source_addresses|
|
59
|
+
next if vin['txid'].blank?
|
60
|
+
|
61
|
+
vin_transaction = client.json_rpc(:getrawtransaction, [vin['txid'], 1])
|
62
|
+
source = vin_transaction['vout'].find { |hash| hash['n'] == vin['vout'] }
|
63
|
+
source_addresses << source['scriptPubKey']['addresses'][0]
|
64
|
+
end.compact.uniq
|
65
|
+
end
|
66
|
+
|
56
67
|
private
|
57
68
|
|
58
69
|
def build_transaction(tx_hash)
|
@@ -26,11 +26,8 @@ module Peatio
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def json_rpc(method, params = [])
|
29
|
-
response =
|
30
|
-
|
31
|
-
{ jsonrpc: '1.0', method: method, params: params }.to_json,
|
32
|
-
{ 'Accept' => 'application/json',
|
33
|
-
'Content-Type' => 'application/json' }
|
29
|
+
response = post(method, params)
|
30
|
+
|
34
31
|
response.assert_2xx!
|
35
32
|
response = JSON.parse(response.body)
|
36
33
|
response['error'].tap { |e| raise ResponseError.new(e['code'], e['message']) if e }
|
@@ -47,6 +44,11 @@ module Peatio
|
|
47
44
|
|
48
45
|
private
|
49
46
|
|
47
|
+
def post(method, params)
|
48
|
+
connection.post("/", {jsonrpc: "1.0", method: method, params: params}.to_json,
|
49
|
+
"Accept" => "application/json", "Content-Type" => "application/json")
|
50
|
+
end
|
51
|
+
|
50
52
|
def connection
|
51
53
|
@connection ||= Faraday.new(@json_rpc_endpoint) do |f|
|
52
54
|
f.adapter :net_http_persistent, pool_size: 5
|
@@ -26,8 +26,8 @@ module Peatio
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def register
|
29
|
-
Peatio::Blockchain.registry[:bitcoincash] = Bitcoincash::Blockchain
|
30
|
-
Peatio::Wallet.registry[:bitcoincashd] = Bitcoincash::Wallet
|
29
|
+
Peatio::Blockchain.registry[:bitcoincash] = Bitcoincash::Blockchain
|
30
|
+
Peatio::Wallet.registry[:bitcoincashd] = Bitcoincash::Wallet
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
data/peatio-bitcoincash.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_dependency "activesupport", "~> 5.2.3"
|
27
27
|
spec.add_dependency "better-faraday", "~> 1.0.5"
|
28
|
-
spec.add_dependency "faraday", "~> 0.
|
28
|
+
spec.add_dependency "faraday", "~> 0.17"
|
29
29
|
spec.add_dependency "memoist", "~> 0.16.0"
|
30
30
|
spec.add_dependency "peatio", ">= 0.6.3"
|
31
31
|
spec.add_dependency "cash-addr", '~> 0.2.0'
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_development_dependency "bundler", "~> 1.17"
|
35
35
|
spec.add_development_dependency "mocha", "~> 1.8"
|
36
36
|
spec.add_development_dependency "pry-byebug"
|
37
|
-
spec.add_development_dependency "rake", "~>
|
37
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
38
38
|
spec.add_development_dependency "rspec", "~> 3.0"
|
39
39
|
spec.add_development_dependency "webmock", "~> 3.5"
|
40
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peatio-bitcoincash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4
|
4
|
+
version: 2.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dinesh Chohda
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: '0.17'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: '0.17'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: memoist
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '13.0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '13.0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rspec
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|