peatio-ripple 2.5.3 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ec383e28ef458611a3e667a6c2da978fe038eb4be3b7445912014040e69a3d9
4
- data.tar.gz: 9d8aa39f2d04e0338af3c5a24c2bf72f3f682e384a9016d8596a764fe02c1373
3
+ metadata.gz: 7e2225e35320711601e51fa8adf2385cd01641cb0d2128022cd75d526790e5c2
4
+ data.tar.gz: 965d74f4e2cbb86bd95a90dfd6e3f9f550e84dc830a3ae824ca3881668a48887
5
5
  SHA512:
6
- metadata.gz: 5ac02b41d20347110fd8b2f33b6c8938a6749ff4d84b8d3903aec29f2bb31ecfc35d59732d08d18a07e785ccedb5133d6cff9e962d609ae221ab07d11f7e21d6
7
- data.tar.gz: a622f1fb5ae345e392ff3ef1c53132cf6da5f625f1c6fbb773eb7779dab224bddfb783ad1ea0bc937bc41e7c95a3579310fad769c7c737c544d048bddfdba1c0
6
+ metadata.gz: 30b42fabb2e63d30676802f034f0d1fdc920dd21f48d716e4e448cf5c9ec629c385feb46091fd45ba95fcf8369b5420b263b19ae56da3786c508168178fbd7ab
7
+ data.tar.gz: 8e4a91ab08a88923a6be1ade5c9b572bb34b804c9a7f166462e0c8d173d5c6f0395f3894330dfb39aa8262e05e450cd525f84e2e9e070a62cfbe56cb0655e0bd
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- peatio-ripple (2.5.3)
4
+ peatio-ripple (2.6.0)
5
5
  activesupport (~> 5.2.3)
6
6
  better-faraday (~> 1.0.5)
7
7
  faraday (~> 0.17)
@@ -12,9 +12,9 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- activemodel (5.2.4.3)
16
- activesupport (= 5.2.4.3)
17
- activesupport (5.2.4.3)
15
+ activemodel (5.2.4.2)
16
+ activesupport (= 5.2.4.2)
17
+ activesupport (5.2.4.2)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 0.7, < 2)
20
20
  minitest (~> 5.1)
@@ -34,13 +34,13 @@ GEM
34
34
  clamp (1.3.1)
35
35
  coderay (1.1.2)
36
36
  concurrent-ruby (1.1.6)
37
- connection_pool (2.2.3)
37
+ connection_pool (2.2.2)
38
38
  cookiejar (0.3.3)
39
39
  crack (0.4.3)
40
40
  safe_yaml (~> 1.0.0)
41
41
  daemons (1.3.1)
42
42
  diff-lcs (1.3)
43
- em-http-request (1.1.6)
43
+ em-http-request (1.1.5)
44
44
  addressable (>= 2.3.4)
45
45
  cookiejar (!= 0.3.1)
46
46
  em-socksify (>= 0.3)
@@ -58,7 +58,7 @@ GEM
58
58
  multipart-post (>= 1.2, < 3)
59
59
  faraday_middleware (0.13.1)
60
60
  faraday (>= 0.7.4, < 1.0)
61
- faye (1.3.0)
61
+ faye (1.2.5)
62
62
  cookiejar (>= 0.3.0)
63
63
  em-http-request (>= 0.3.0)
64
64
  eventmachine (>= 0.12.0)
@@ -71,19 +71,19 @@ GEM
71
71
  websocket-driver (>= 0.5.1)
72
72
  hashdiff (1.0.1)
73
73
  http_parser.rb (0.6.0)
74
- i18n (1.8.3)
74
+ i18n (1.8.2)
75
75
  concurrent-ruby (~> 1.0)
76
76
  jwt (2.2.1)
77
77
  memoist (0.16.2)
78
78
  method_source (1.0.0)
79
- minitest (5.14.1)
79
+ minitest (5.14.0)
80
80
  mocha (1.11.2)
81
81
  multi_json (1.14.1)
82
82
  multipart-post (2.1.1)
83
83
  mysql2 (0.5.3)
84
84
  net-http-persistent (3.0.1)
85
85
  connection_pool (~> 2.2)
86
- peatio (2.6.1)
86
+ peatio (2.4.4)
87
87
  activemodel (> 5.2, <= 6.0.0)
88
88
  amqp
89
89
  bunny
@@ -132,9 +132,9 @@ GEM
132
132
  addressable (>= 2.3.6)
133
133
  crack (>= 0.3.2)
134
134
  hashdiff (>= 0.4.0, < 2.0.0)
135
- websocket-driver (0.7.2)
135
+ websocket-driver (0.7.1)
136
136
  websocket-extensions (>= 0.1.0)
137
- websocket-extensions (0.1.5)
137
+ websocket-extensions (0.1.4)
138
138
 
139
139
  PLATFORMS
140
140
  ruby
@@ -6,7 +6,7 @@ module Peatio
6
6
  module Ripple
7
7
  class Client
8
8
  Error = Class.new(StandardError)
9
- class ConnectionError < Error; end
9
+ ConnectionError = Class.new(Error)
10
10
 
11
11
  class ResponseError < Error
12
12
  def initialize(code, msg)
@@ -27,31 +27,23 @@ module Peatio
27
27
  end
28
28
 
29
29
  def json_rpc(method, params = [])
30
- response = post(method, params)
31
-
30
+ response = connection.post \
31
+ '/',
32
+ { jsonrpc: '2.0', id: rpc_call_id, method: method, params: params }.to_json,
33
+ { 'Accept' => 'application/json',
34
+ 'Content-Type' => 'application/json' }
32
35
  response.assert_2xx!
33
36
  response = JSON.parse(response.body)
34
37
  response.fetch('result').tap do |result|
35
38
  raise ResponseError.new(result['error_code'], result['error_message']) if result['status'] == 'error'
36
39
  end
37
40
  response.fetch('result')
38
- rescue => e
39
- if e.is_a?(Error)
40
- raise e, e.message
41
- elsif e.is_a?(Faraday::Error)
42
- raise ConnectionError, e
43
- else
44
- raise Error, e
45
- end
41
+ rescue Faraday::Error => e
42
+ raise ConnectionError, e
46
43
  end
47
44
 
48
45
  private
49
46
 
50
- def post(method, params)
51
- connection.post("/", {jsonrpc: "2.0", id: rpc_call_id, method: method, params: params}.to_json,
52
- "Accept" => "application/json", "Content-Type" => "application/json")
53
- end
54
-
55
47
  def rpc_call_id
56
48
  @json_rpc_call_id += 1
57
49
  end
@@ -1,5 +1,5 @@
1
1
  module Peatio
2
2
  module Ripple
3
- VERSION = "2.5.3".freeze
3
+ VERSION = "2.6.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peatio-ripple
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.3
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksym N.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport