peatio-bitcoincash 2.4.0 → 2.6.1
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/client.rb +9 -11
- data/lib/peatio/bitcoincash/hooks.rb +2 -2
- data/lib/peatio/bitcoincash/version.rb +1 -1
- data/lib/peatio/bitcoincash/wallet.rb +5 -2
- 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: b5939f2a255d0f7ad89a188b9e4919f4220e4b938b005d333de0fe09e800f4e9
|
4
|
+
data.tar.gz: 329e6af472617f63e122b8159635ad7344660bf4d10f5b72b85e95bf788b5fd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00ca063953a35396cc209a72bc6492718bdaa2663df4183eeffed0352b1c2b0ef835e97158958df70ab90406e52bef8a8d02dc972ff3b8aef2bf5bf550fd9572
|
7
|
+
data.tar.gz: afb3b4598c9f626d565752abd6fec7bb5d8aa8d2b34fe2f652949ff5a828d35d8b764ce63f86c2759925f845d9363213ddab165d11db089227e416cd95beec3e
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
peatio-bitcoincash (2.
|
4
|
+
peatio-bitcoincash (2.6.1)
|
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
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'memoist'
|
2
4
|
require 'faraday'
|
3
5
|
require 'better-faraday'
|
@@ -6,7 +8,7 @@ module Peatio
|
|
6
8
|
module Bitcoincash
|
7
9
|
class Client
|
8
10
|
Error = Class.new(StandardError)
|
9
|
-
|
11
|
+
ConnectionError = Class.new(Error)
|
10
12
|
|
11
13
|
class ResponseError < Error
|
12
14
|
def initialize(code, msg)
|
@@ -29,20 +31,16 @@ module Peatio
|
|
29
31
|
response = connection.post \
|
30
32
|
'/',
|
31
33
|
{ jsonrpc: '1.0', method: method, params: params }.to_json,
|
32
|
-
{ 'Accept'
|
34
|
+
{ 'Accept' => 'application/json',
|
33
35
|
'Content-Type' => 'application/json' }
|
34
36
|
response.assert_2xx!
|
35
37
|
response = JSON.parse(response.body)
|
36
|
-
response['error'].tap
|
37
|
-
|
38
|
-
rescue => e
|
39
|
-
if e.is_a?(Error)
|
40
|
-
raise e
|
41
|
-
elsif e.is_a?(Faraday::Error)
|
42
|
-
raise ConnectionError, e
|
43
|
-
else
|
44
|
-
raise Error, e
|
38
|
+
response['error'].tap do |e|
|
39
|
+
raise ResponseError.new(e['code'], e['message']) if e
|
45
40
|
end
|
41
|
+
response.fetch('result')
|
42
|
+
rescue Faraday::Error => e
|
43
|
+
raise ConnectionError, e
|
46
44
|
end
|
47
45
|
|
48
46
|
private
|
@@ -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
|
|
@@ -3,8 +3,11 @@ module Peatio
|
|
3
3
|
class Wallet < Peatio::Wallet::Abstract
|
4
4
|
include CashAddressFormat
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
DEFAULT_FEATURES = { skip_deposit_collection: false }.freeze
|
7
|
+
|
8
|
+
def initialize(custom_features = {})
|
9
|
+
@features = DEFAULT_FEATURES.merge(custom_features).slice(*SUPPORTED_FEATURES)
|
10
|
+
@settings = {}
|
8
11
|
end
|
9
12
|
|
10
13
|
def configure(settings = {})
|
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
|
+
version: 2.6.1
|
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-10 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
|