peatio 2.4.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.drone.yml +29 -0
- data/Gemfile.lock +56 -46
- data/lib/peatio/ranger/connection.rb +10 -3
- data/lib/peatio/ranger/web_socket.rb +1 -1
- data/lib/peatio/transaction.rb +4 -0
- data/lib/peatio/upstream/base.rb +6 -1
- data/lib/peatio/version.rb +1 -1
- data/peatio.gemspec +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3cf7b575b86a434da7210b3ef4b7cd1bc703a61248c02b5de6868302493653c
|
4
|
+
data.tar.gz: e23017b721c9ae86537907bea8cf97423422cca48f92280e055b5af67f36e7e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51e0f35070706c1bdb1a152808116667daf0401865883df5f74202293b22023d111b94cf176c1eceed65bbfa339a424b25fcbebc40fbb160a0e0fa33198f9f76
|
7
|
+
data.tar.gz: dc90d88ef3b7d394dd65e1f71aec90cccec3a9b76709774c0b5c2d7e21b141c40eb14e772b23b3cb837fe1d97317c3e46a976cb23b08ef6d060377c0e4a08f8f
|
data/.drone.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
kind: pipeline
|
3
|
+
name: default
|
4
|
+
|
5
|
+
steps:
|
6
|
+
- name: Run rspec for each library
|
7
|
+
image: ruby:2.6
|
8
|
+
commands:
|
9
|
+
- bundle install
|
10
|
+
- bundle exec rspec
|
11
|
+
|
12
|
+
- name: Release gems
|
13
|
+
image: ruby:2.6
|
14
|
+
environment:
|
15
|
+
GEM_CREDENTIALS:
|
16
|
+
from_secret: gem_credentials
|
17
|
+
commands:
|
18
|
+
- mkdir -p ~/.gem
|
19
|
+
- echo $GEM_CREDENTIALS | base64 -d > ~/.gem/credentials
|
20
|
+
- chmod 0600 ~/.gem/credentials
|
21
|
+
- gem build peatio.gemspec
|
22
|
+
- gem push peatio-*.gem
|
23
|
+
when:
|
24
|
+
branch:
|
25
|
+
- master
|
26
|
+
|
27
|
+
trigger:
|
28
|
+
event:
|
29
|
+
- push
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
peatio (2.
|
4
|
+
peatio (2.6.0)
|
5
5
|
activemodel (> 5.2, <= 6.0.0)
|
6
6
|
amqp
|
7
7
|
bunny
|
@@ -29,25 +29,25 @@ GEM
|
|
29
29
|
zeitwerk (~> 2.1, >= 2.1.8)
|
30
30
|
addressable (2.7.0)
|
31
31
|
public_suffix (>= 2.0.2, < 5.0)
|
32
|
-
amq-protocol (2.3.
|
32
|
+
amq-protocol (2.3.1)
|
33
33
|
amqp (1.8.0)
|
34
34
|
amq-protocol (>= 2.2.0)
|
35
35
|
eventmachine
|
36
36
|
ast (2.4.0)
|
37
|
-
bump (0.
|
38
|
-
bunny (2.
|
39
|
-
amq-protocol (~> 2.3, >= 2.3.
|
37
|
+
bump (0.9.0)
|
38
|
+
bunny (2.15.0)
|
39
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
40
40
|
bunny-mock (1.7.0)
|
41
41
|
bunny (>= 1.7)
|
42
|
-
byebug (11.
|
42
|
+
byebug (11.1.3)
|
43
43
|
clamp (1.3.1)
|
44
|
-
coderay (1.1.
|
44
|
+
coderay (1.1.3)
|
45
45
|
concurrent-ruby (1.1.6)
|
46
46
|
cookiejar (0.3.3)
|
47
47
|
daemons (1.3.1)
|
48
48
|
diff-lcs (1.3)
|
49
49
|
docile (1.3.2)
|
50
|
-
em-http-request (1.1.
|
50
|
+
em-http-request (1.1.6)
|
51
51
|
addressable (>= 2.3.4)
|
52
52
|
cookiejar (!= 0.3.1)
|
53
53
|
em-socksify (>= 0.3)
|
@@ -70,7 +70,7 @@ GEM
|
|
70
70
|
multipart-post (>= 1.2, < 3)
|
71
71
|
faraday_middleware (0.13.1)
|
72
72
|
faraday (>= 0.7.4, < 1.0)
|
73
|
-
faye (1.
|
73
|
+
faye (1.3.0)
|
74
74
|
cookiejar (>= 0.3.0)
|
75
75
|
em-http-request (>= 0.3.0)
|
76
76
|
eventmachine (>= 0.12.0)
|
@@ -82,65 +82,75 @@ GEM
|
|
82
82
|
eventmachine (>= 0.12.0)
|
83
83
|
websocket-driver (>= 0.5.1)
|
84
84
|
http_parser.rb (0.6.0)
|
85
|
-
i18n (1.8.
|
85
|
+
i18n (1.8.3)
|
86
86
|
concurrent-ruby (~> 1.0)
|
87
|
-
|
87
|
+
io-console (0.5.6)
|
88
|
+
irb (1.2.4)
|
89
|
+
reline (>= 0.0.1)
|
88
90
|
jaro_winkler (1.5.4)
|
89
|
-
json (2.
|
91
|
+
json (2.3.0)
|
90
92
|
jwt (2.2.1)
|
91
|
-
method_source (0.
|
92
|
-
minitest (5.14.
|
93
|
+
method_source (1.0.0)
|
94
|
+
minitest (5.14.1)
|
93
95
|
multi_json (1.14.1)
|
94
96
|
multipart-post (2.1.1)
|
95
97
|
mysql2 (0.5.3)
|
96
|
-
parallel (1.19.
|
97
|
-
parser (2.
|
98
|
+
parallel (1.19.1)
|
99
|
+
parser (2.7.1.3)
|
98
100
|
ast (~> 2.4.0)
|
99
101
|
prometheus-client (2.0.0)
|
100
|
-
pry (0.
|
101
|
-
coderay (~> 1.1
|
102
|
-
method_source (~>
|
103
|
-
pry-byebug (3.
|
102
|
+
pry (0.13.1)
|
103
|
+
coderay (~> 1.1)
|
104
|
+
method_source (~> 1.0)
|
105
|
+
pry-byebug (3.9.0)
|
104
106
|
byebug (~> 11.0)
|
105
|
-
pry (~> 0.
|
106
|
-
public_suffix (4.0.
|
107
|
+
pry (~> 0.13.0)
|
108
|
+
public_suffix (4.0.5)
|
107
109
|
rack (2.2.2)
|
108
110
|
rainbow (3.0.0)
|
109
|
-
rake (
|
111
|
+
rake (13.0.1)
|
112
|
+
reline (0.1.4)
|
113
|
+
io-console (~> 0.5)
|
114
|
+
rexml (3.2.4)
|
110
115
|
rspec (3.9.0)
|
111
116
|
rspec-core (~> 3.9.0)
|
112
117
|
rspec-expectations (~> 3.9.0)
|
113
118
|
rspec-mocks (~> 3.9.0)
|
114
|
-
rspec-core (3.9.
|
115
|
-
rspec-support (~> 3.9.
|
116
|
-
rspec-expectations (3.9.
|
119
|
+
rspec-core (3.9.2)
|
120
|
+
rspec-support (~> 3.9.3)
|
121
|
+
rspec-expectations (3.9.2)
|
117
122
|
diff-lcs (>= 1.2.0, < 2.0)
|
118
123
|
rspec-support (~> 3.9.0)
|
119
|
-
rspec-mocks (3.9.
|
124
|
+
rspec-mocks (3.9.1)
|
120
125
|
diff-lcs (>= 1.2.0, < 2.0)
|
121
126
|
rspec-support (~> 3.9.0)
|
122
|
-
rspec-support (3.9.
|
127
|
+
rspec-support (3.9.3)
|
123
128
|
rspec_junit_formatter (0.4.1)
|
124
129
|
rspec-core (>= 2, < 4, != 2.12.0)
|
125
|
-
rubocop (0.
|
130
|
+
rubocop (0.82.0)
|
126
131
|
jaro_winkler (~> 1.5.1)
|
127
132
|
parallel (~> 1.10)
|
128
|
-
parser (>= 2.
|
133
|
+
parser (>= 2.7.0.1)
|
129
134
|
rainbow (>= 2.2.2, < 4.0)
|
135
|
+
rexml
|
130
136
|
ruby-progressbar (~> 1.7)
|
131
|
-
unicode-display_width (>= 1.4.0, <
|
132
|
-
rubocop-github (0.
|
133
|
-
rubocop (
|
134
|
-
rubocop-performance (~> 1.
|
135
|
-
|
136
|
-
|
137
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
138
|
+
rubocop-github (0.16.0)
|
139
|
+
rubocop (<= 0.82.0)
|
140
|
+
rubocop-performance (~> 1.0)
|
141
|
+
rubocop-rails (~> 2.0)
|
142
|
+
rubocop-performance (1.6.1)
|
143
|
+
rubocop (>= 0.71.0)
|
144
|
+
rubocop-rails (2.6.0)
|
145
|
+
activesupport (>= 4.2.0)
|
146
|
+
rack (>= 1.1)
|
147
|
+
rubocop (>= 0.82.0)
|
137
148
|
ruby-progressbar (1.10.1)
|
138
|
-
simplecov (0.
|
149
|
+
simplecov (0.18.5)
|
139
150
|
docile (~> 1.1)
|
140
|
-
|
141
|
-
|
142
|
-
simplecov-
|
143
|
-
simplecov-json (0.2)
|
151
|
+
simplecov-html (~> 0.11)
|
152
|
+
simplecov-html (0.12.2)
|
153
|
+
simplecov-json (0.2.1)
|
144
154
|
json
|
145
155
|
simplecov
|
146
156
|
thin (1.7.2)
|
@@ -148,13 +158,13 @@ GEM
|
|
148
158
|
eventmachine (~> 1.0, >= 1.0.4)
|
149
159
|
rack (>= 1, < 3)
|
150
160
|
thread_safe (0.3.6)
|
151
|
-
tzinfo (1.2.
|
161
|
+
tzinfo (1.2.7)
|
152
162
|
thread_safe (~> 0.1)
|
153
|
-
unicode-display_width (1.
|
163
|
+
unicode-display_width (1.7.0)
|
154
164
|
websocket (1.2.8)
|
155
|
-
websocket-driver (0.7.
|
165
|
+
websocket-driver (0.7.2)
|
156
166
|
websocket-extensions (>= 0.1.0)
|
157
|
-
websocket-extensions (0.1.
|
167
|
+
websocket-extensions (0.1.5)
|
158
168
|
zeitwerk (2.3.0)
|
159
169
|
|
160
170
|
PLATFORMS
|
@@ -169,7 +179,7 @@ DEPENDENCIES
|
|
169
179
|
irb
|
170
180
|
peatio!
|
171
181
|
pry-byebug
|
172
|
-
rake (~>
|
182
|
+
rake (~> 13.0)
|
173
183
|
rspec (~> 3.0)
|
174
184
|
rspec_junit_formatter
|
175
185
|
rubocop-github
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module Peatio::Ranger
|
4
2
|
class Connection
|
5
3
|
attr_reader :socket, :user, :authorized, :streams, :logger, :id
|
@@ -23,7 +21,11 @@ module Peatio::Ranger
|
|
23
21
|
end
|
24
22
|
|
25
23
|
def send_raw(payload)
|
26
|
-
|
24
|
+
if user
|
25
|
+
logger.debug { "sending to user #{user.inspect} payload: #{payload}" }
|
26
|
+
else
|
27
|
+
logger.debug { "sending to anonymous payload: #{payload}" }
|
28
|
+
end
|
27
29
|
@socket.send(payload)
|
28
30
|
end
|
29
31
|
|
@@ -77,6 +79,11 @@ module Peatio::Ranger
|
|
77
79
|
def handle(msg)
|
78
80
|
return if msg.to_s.empty?
|
79
81
|
|
82
|
+
if msg =~ /^ping/
|
83
|
+
send_raw("pong")
|
84
|
+
return
|
85
|
+
end
|
86
|
+
|
80
87
|
data = JSON.parse(msg)
|
81
88
|
case data["event"]
|
82
89
|
when "subscribe"
|
data/lib/peatio/transaction.rb
CHANGED
@@ -53,6 +53,10 @@ module Peatio #:nodoc:
|
|
53
53
|
# return [Integer] transaction number in send-to-many request
|
54
54
|
attr_accessor :txout
|
55
55
|
|
56
|
+
# @!attribute [rw] from_address
|
57
|
+
# return [Array<String>] transaction source addresses
|
58
|
+
attr_accessor :from_addresses
|
59
|
+
|
56
60
|
# @!attribute [rw] to_address
|
57
61
|
# return [String] transaction recepient address
|
58
62
|
attr_accessor :to_address
|
data/lib/peatio/upstream/base.rb
CHANGED
@@ -33,6 +33,7 @@ module Peatio
|
|
33
33
|
|
34
34
|
@ws.on(:open) do |_e|
|
35
35
|
subscribe_trades(@target, @ws)
|
36
|
+
subscribe_orderbook(@target, @ws)
|
36
37
|
logger.info { "Websocket connected" }
|
37
38
|
end
|
38
39
|
|
@@ -59,6 +60,10 @@ module Peatio
|
|
59
60
|
method_not_implemented
|
60
61
|
end
|
61
62
|
|
63
|
+
def subscribe_orderbook(_market, _ws)
|
64
|
+
method_not_implemented
|
65
|
+
end
|
66
|
+
|
62
67
|
def ws_read_public_message(msg)
|
63
68
|
logger.info { "received public message: #{msg}" }
|
64
69
|
end
|
@@ -88,7 +93,7 @@ module Peatio
|
|
88
93
|
price: trade[:price],
|
89
94
|
amount: trade[:amount],
|
90
95
|
market_id: @market,
|
91
|
-
created_at: Time.at(trade[:date]),
|
96
|
+
created_at: Time.at(trade[:date]).utc.iso8601,
|
92
97
|
taker_type: trade[:taker_type]
|
93
98
|
}
|
94
99
|
end
|
data/lib/peatio/version.rb
CHANGED
data/peatio.gemspec
CHANGED
@@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
|
|
44
44
|
spec.add_development_dependency "em-websocket-client"
|
45
45
|
spec.add_development_dependency "irb"
|
46
46
|
spec.add_development_dependency "pry-byebug"
|
47
|
-
spec.add_development_dependency "rake", "~>
|
47
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
48
48
|
spec.add_development_dependency "rspec", "~> 3.0"
|
49
49
|
spec.add_development_dependency "rspec_junit_formatter"
|
50
50
|
spec.add_development_dependency "rubocop-github"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peatio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Louis B.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -303,14 +303,14 @@ dependencies:
|
|
303
303
|
requirements:
|
304
304
|
- - "~>"
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version: '
|
306
|
+
version: '13.0'
|
307
307
|
type: :development
|
308
308
|
prerelease: false
|
309
309
|
version_requirements: !ruby/object:Gem::Requirement
|
310
310
|
requirements:
|
311
311
|
- - "~>"
|
312
312
|
- !ruby/object:Gem::Version
|
313
|
-
version: '
|
313
|
+
version: '13.0'
|
314
314
|
- !ruby/object:Gem::Dependency
|
315
315
|
name: rspec
|
316
316
|
requirement: !ruby/object:Gem::Requirement
|
@@ -391,6 +391,7 @@ executables:
|
|
391
391
|
extensions: []
|
392
392
|
extra_rdoc_files: []
|
393
393
|
files:
|
394
|
+
- ".drone.yml"
|
394
395
|
- ".gitignore"
|
395
396
|
- ".rspec"
|
396
397
|
- ".rubocop.yml"
|
@@ -456,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
457
|
- !ruby/object:Gem::Version
|
457
458
|
version: '0'
|
458
459
|
requirements: []
|
459
|
-
rubygems_version: 3.0.
|
460
|
+
rubygems_version: 3.0.3
|
460
461
|
signing_key:
|
461
462
|
specification_version: 4
|
462
463
|
summary: Peatio is a gem for running critical core services
|