peatio_irix 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3bb366ac2a1c539d1d6e25b95764e65ce9d0185313a064b38b4656e3a1663d50
4
+ data.tar.gz: 1a25db7a6ad214615d4356458602a8f7fa38ec0731c6957d30dbbc5be6f2a2bc
5
+ SHA512:
6
+ metadata.gz: 43b400fbd6f0df1708cb7ce323f3ab6aa4e2b5fe9be3c4bf5a79777c067256eb16c10205f6d2866e8acc9ed11a5167e8d2c396c0d2b19cb289890776fac79e8f
7
+ data.tar.gz: 57d81d58ea3acf3733932efdb0e4422cb1b30c49621e79488ac0a3218b099064de1833a4dc34b4ed42bca029989962c9cbccc0d429138cd4aa9a67854e51aaa5
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,9 @@
1
+ image: ruby:2.6.5
2
+
3
+ before_script:
4
+ - gem install bundler -v 2.2.27
5
+ - bundle install
6
+
7
+ example_job:
8
+ script:
9
+ - bundle exec rake
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
+ </project>
data/.idea/misc.xml ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="ruby-2.7.0-p0" project-jdk-type="RUBY_SDK" />
4
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/peatio_irix.iml" filepath="$PROJECT_DIR$/.idea/peatio_irix.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, ruby-2.7.0-p0) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.27, ruby-2.7.0-p0) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, ruby-2.7.0-p0) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="em-synchrony (v1.0.6, ruby-2.7.0-p0) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="em-websocket (v0.5.2, ruby-2.7.0-p0) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="eventmachine (v1.2.7, ruby-2.7.0-p0) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="faraday_middleware (v0.13.1, ruby-2.7.0-p0) [gem]" level="application" />
21
+ <orderEntry type="library" scope="PROVIDED" name="faye (v1.4.0, ruby-2.7.0-p0) [gem]" level="application" />
22
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.21.0, ruby-2.7.0-p0) [gem]" level="application" />
23
+ <orderEntry type="library" scope="PROVIDED" name="parser (v3.0.2.0, ruby-2.7.0-p0) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="peatio (v2.6.5, ruby-2.7.0-p0) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="pry-byebug (v3.9.0, ruby-2.7.0-p0) [gem]" level="application" />
26
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, ruby-2.7.0-p0) [gem]" level="application" />
27
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, ruby-2.7.0-p0) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.1.1, ruby-2.7.0-p0) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, ruby-2.7.0-p0) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.10.0, ruby-2.7.0-p0) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, ruby-2.7.0-p0) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.10.1, ruby-2.7.0-p0) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.10.2, ruby-2.7.0-p0) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.3, ruby-2.7.0-p0) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.23.0, ruby-2.7.0-p0) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.13.0, ruby-2.7.0-p0) [gem]" level="application" />
37
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.11.0, ruby-2.7.0-p0) [gem]" level="application" />
38
+ <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, ruby-2.7.0-p0) [gem]" level="application" />
39
+ </component>
40
+ </module>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-11-25
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at pragya.sriharsh@antechindia.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in peatio_irix.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
data/Gemfile.lock ADDED
@@ -0,0 +1,199 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ peatio_irix (2.6.0)
5
+ em-synchrony (~> 1.0)
6
+ em-websocket
7
+ eventmachine
8
+ faraday_middleware (~> 0.13.1)
9
+ faye (~> 1.2)
10
+ peatio (>= 2.4.2)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (6.0.0)
16
+ activesupport (= 6.0.0)
17
+ activesupport (6.0.0)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 0.7, < 2)
20
+ minitest (~> 5.1)
21
+ tzinfo (~> 1.1)
22
+ zeitwerk (~> 2.1, >= 2.1.8)
23
+ addressable (2.8.0)
24
+ public_suffix (>= 2.0.2, < 5.0)
25
+ amq-protocol (2.3.2)
26
+ amqp (1.8.0)
27
+ amq-protocol (>= 2.2.0)
28
+ eventmachine
29
+ ast (2.4.2)
30
+ bunny (2.19.0)
31
+ amq-protocol (~> 2.3, >= 2.3.1)
32
+ sorted_set (~> 1, >= 1.0.2)
33
+ byebug (11.1.3)
34
+ clamp (1.3.2)
35
+ coderay (1.1.3)
36
+ concurrent-ruby (1.1.9)
37
+ cookiejar (0.3.3)
38
+ daemons (1.4.1)
39
+ diff-lcs (1.4.4)
40
+ docile (1.4.0)
41
+ em-http-request (1.1.7)
42
+ addressable (>= 2.3.4)
43
+ cookiejar (!= 0.3.1)
44
+ em-socksify (>= 0.3)
45
+ eventmachine (>= 1.0.3)
46
+ http_parser.rb (>= 0.6.0)
47
+ em-socksify (0.3.2)
48
+ eventmachine (>= 1.0.0.beta.4)
49
+ em-spec (0.2.7)
50
+ eventmachine
51
+ em-synchrony (1.0.6)
52
+ eventmachine (>= 1.0.0.beta.1)
53
+ em-websocket (0.5.3)
54
+ eventmachine (>= 0.12.9)
55
+ http_parser.rb (~> 0)
56
+ em-websocket-client (0.1.2)
57
+ eventmachine
58
+ websocket
59
+ eventmachine (1.2.7)
60
+ faraday (0.17.4)
61
+ multipart-post (>= 1.2, < 3)
62
+ faraday_middleware (0.13.1)
63
+ faraday (>= 0.7.4, < 1.0)
64
+ faye (1.4.0)
65
+ cookiejar (>= 0.3.0)
66
+ em-http-request (>= 1.1.6)
67
+ eventmachine (>= 0.12.0)
68
+ faye-websocket (>= 0.11.0)
69
+ multi_json (>= 1.0.0)
70
+ rack (>= 1.0.0)
71
+ websocket-driver (>= 0.5.1)
72
+ faye-websocket (0.11.1)
73
+ eventmachine (>= 0.12.0)
74
+ websocket-driver (>= 0.5.1)
75
+ http_parser.rb (0.8.0)
76
+ i18n (1.8.11)
77
+ concurrent-ruby (~> 1.0)
78
+ json (2.6.1)
79
+ jwt (2.3.0)
80
+ method_source (1.0.0)
81
+ minitest (5.14.4)
82
+ multi_json (1.15.0)
83
+ multipart-post (2.1.1)
84
+ mysql2 (0.5.3)
85
+ parallel (1.21.0)
86
+ parser (3.0.2.0)
87
+ ast (~> 2.4.1)
88
+ peatio (2.6.5)
89
+ activemodel (> 5.2, <= 6.0.0)
90
+ amqp
91
+ bunny
92
+ clamp
93
+ em-synchrony (~> 1.0)
94
+ em-websocket
95
+ eventmachine
96
+ faraday_middleware (~> 0.13.1)
97
+ faye (~> 1.2)
98
+ jwt
99
+ mysql2
100
+ prometheus-client
101
+ thin
102
+ prometheus-client (2.1.0)
103
+ pry (0.13.1)
104
+ coderay (~> 1.1)
105
+ method_source (~> 1.0)
106
+ pry-byebug (3.9.0)
107
+ byebug (~> 11.0)
108
+ pry (~> 0.13.0)
109
+ public_suffix (4.0.6)
110
+ rack (2.2.3)
111
+ rainbow (3.0.0)
112
+ rake (13.0.6)
113
+ rbtree (0.4.4)
114
+ regexp_parser (2.1.1)
115
+ rexml (3.2.5)
116
+ rspec (3.10.0)
117
+ rspec-core (~> 3.10.0)
118
+ rspec-expectations (~> 3.10.0)
119
+ rspec-mocks (~> 3.10.0)
120
+ rspec-core (3.10.1)
121
+ rspec-support (~> 3.10.0)
122
+ rspec-expectations (3.10.1)
123
+ diff-lcs (>= 1.2.0, < 2.0)
124
+ rspec-support (~> 3.10.0)
125
+ rspec-mocks (3.10.2)
126
+ diff-lcs (>= 1.2.0, < 2.0)
127
+ rspec-support (~> 3.10.0)
128
+ rspec-support (3.10.3)
129
+ rspec_junit_formatter (0.4.1)
130
+ rspec-core (>= 2, < 4, != 2.12.0)
131
+ rubocop (1.13.0)
132
+ parallel (~> 1.10)
133
+ parser (>= 3.0.0.0)
134
+ rainbow (>= 2.2.2, < 4.0)
135
+ regexp_parser (>= 1.8, < 3.0)
136
+ rexml
137
+ rubocop-ast (>= 1.2.0, < 2.0)
138
+ ruby-progressbar (~> 1.7)
139
+ unicode-display_width (>= 1.4.0, < 3.0)
140
+ rubocop-ast (1.13.0)
141
+ parser (>= 3.0.1.1)
142
+ rubocop-github (0.16.2)
143
+ rubocop (<= 1.13.0)
144
+ rubocop-performance (<= 1.11.0)
145
+ rubocop-rails (<= 2.7.1)
146
+ rubocop-performance (1.11.0)
147
+ rubocop (>= 1.7.0, < 2.0)
148
+ rubocop-ast (>= 0.4.0)
149
+ rubocop-rails (2.7.1)
150
+ activesupport (>= 4.2.0)
151
+ rack (>= 1.1)
152
+ rubocop (>= 0.87.0)
153
+ ruby-progressbar (1.11.0)
154
+ set (1.0.2)
155
+ simplecov (0.21.2)
156
+ docile (~> 1.1)
157
+ simplecov-html (~> 0.11)
158
+ simplecov_json_formatter (~> 0.1)
159
+ simplecov-html (0.12.3)
160
+ simplecov-json (0.2.3)
161
+ json
162
+ simplecov
163
+ simplecov_json_formatter (0.1.3)
164
+ sorted_set (1.0.3)
165
+ rbtree
166
+ set (~> 1.0)
167
+ thin (1.8.1)
168
+ daemons (~> 1.0, >= 1.0.9)
169
+ eventmachine (~> 1.0, >= 1.0.4)
170
+ rack (>= 1, < 3)
171
+ thread_safe (0.3.6)
172
+ tzinfo (1.2.9)
173
+ thread_safe (~> 0.1)
174
+ unicode-display_width (2.1.0)
175
+ websocket (1.2.9)
176
+ websocket-driver (0.7.5)
177
+ websocket-extensions (>= 0.1.0)
178
+ websocket-extensions (0.1.5)
179
+ zeitwerk (2.5.1)
180
+
181
+ PLATFORMS
182
+ x86_64-linux
183
+
184
+ DEPENDENCIES
185
+ bundler (~> 2.0)
186
+ em-spec
187
+ em-websocket-client
188
+ peatio_irix!
189
+ pry-byebug
190
+ rake (~> 13.0)
191
+ rspec (~> 3.0)
192
+ rspec_junit_formatter
193
+ rubocop (~> 1.7)
194
+ rubocop-github
195
+ simplecov
196
+ simplecov-json
197
+
198
+ BUNDLED WITH
199
+ 2.2.19
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Pragya Sriharsh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # PeatioIrix
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/peatio_irix`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'peatio_irix'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install peatio_irix
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/peatio_irix. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/peatio_irix/blob/master/CODE_OF_CONDUCT.md).
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the PeatioIrix project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/peatio_irix/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "peatio_irix"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,185 @@
1
+ # frozen_string_literal: true
2
+ module PeatioIrix
3
+ class Binance < Peatio::Upstream::Base
4
+ require 'time'
5
+
6
+ MIN_INCREMENT_COUNT_TO_SNAPSHOT = 100
7
+ MIN_PERIOD_TO_SNAPSHOT = 5
8
+ MAX_PERIOD_TO_SNAPSHOT = 60
9
+
10
+ attr_accessor :snap, :snapshot_time, :increment_count, :sequence_number,
11
+ :asks, :bids
12
+ # WS huobi global
13
+ # websocket: 'wss://api.huobi.pro/ws/'
14
+ # WS for krw markets
15
+ # websocket: 'wss://api-cloud.huobi.co.kr/ws/'
16
+
17
+ def initialize(config)
18
+ super
19
+ @connection = Faraday.new(url: (config['rest']).to_s) do |builder|
20
+ builder.response :json
21
+ builder.response :logger if config['debug']
22
+ builder.adapter(@adapter)
23
+ unless config['verify_ssl'].nil?
24
+ builder.ssl[:verify] = config['verify_ssl']
25
+ end
26
+ end
27
+ @ping_set = false
28
+ @rest = (config['rest']).to_s
29
+ @ws_url = (config['websocket']).to_s
30
+ end
31
+
32
+ def ws_read_message(msg)
33
+ response = JSON.parse msg.data
34
+ return if response.key? 'result'
35
+
36
+ # data = Zlib::GzipReader.new(StringIO.new(msg.data.map(&:chr).join)).read
37
+ # Rails.logger.debug { "received websocket message: #{data}" }
38
+
39
+ # object = JSON.parse(data)
40
+ ws_read_public_message(response)
41
+ end
42
+
43
+ def ws_read_public_message(msg)
44
+
45
+ if msg['ping'].present?
46
+ @ws.send(JSON.dump(pong: msg['ping']))
47
+ return
48
+ end
49
+
50
+ case msg['stream']
51
+ when /#{@target}@trade/
52
+ detect_trade(msg['data'])
53
+ when /#{@target}@depth@100ms/
54
+ detect_order(msg['data'])
55
+ end
56
+ end
57
+
58
+ def detect_order(msg)
59
+ if @increment_count < MIN_INCREMENT_COUNT_TO_SNAPSHOT && @snapshot_time <= Time.now - MAX_PERIOD_TO_SNAPSHOT
60
+ publish_snapshot
61
+ @increment_count = 0
62
+ elsif @increment_count >= MIN_INCREMENT_COUNT_TO_SNAPSHOT && @snapshot_time < Time.now - MIN_PERIOD_TO_SNAPSHOT
63
+ publish_snapshot
64
+ @increment_count = 0
65
+ end
66
+ fill_increment(msg)
67
+ end
68
+
69
+ def fill_increment(inc)
70
+ fill_side(inc, 'b')
71
+ fill_side(inc, 'a')
72
+ @increment_count += 1
73
+ end
74
+
75
+ def fill_side(inc, side)
76
+ inc[side].each do |price_point|
77
+ price = price_point[0].to_d
78
+ amount = price_point[1].to_d
79
+ if amount.zero?
80
+ @snap[side].delete_if { |point| point[0] == price.to_s }
81
+ else
82
+ @snap[side].delete_if { |point| point[0] == price.to_s }
83
+ @snap[side] << [price.to_s, amount.to_s]
84
+ end
85
+ if side == 'b'
86
+ @bids.delete_if { |point| point[0] == price }
87
+ @bids << [price.to_s, amount.to_s]
88
+ elsif side == 'a'
89
+ @asks.delete_if { |point| point[0] == price }
90
+ @asks << [price.to_s, amount.to_s]
91
+ end
92
+ end
93
+ end
94
+
95
+ def publish_increment
96
+ inc = {}
97
+ inc['b'] = @bids.sort.reverse if @bids.present?
98
+ inc['a'] = @asks.sort if @asks.present?
99
+ if inc.present?
100
+ @sequence_number += 1
101
+ @peatio_mq.enqueue_event('public', @market, 'ob-inc',
102
+ bids: inc['b'], asks: inc['a'],
103
+ sequence: @sequence_number)
104
+ end
105
+ @bids = []
106
+ @asks = []
107
+ end
108
+
109
+ def publish_snapshot
110
+ @snapshot_time = Time.now
111
+ @peatio_mq.enqueue_event('public', @market, 'ob-snap',
112
+ bids: @snap['b'].sort.reverse,
113
+ asks: @snap['a'].sort,
114
+ sequence: @sequence_number)
115
+ end
116
+
117
+ def detect_trade(msg)
118
+ trade =
119
+ {
120
+ tid: msg['t'],
121
+ amount: msg['q'].to_d,
122
+ price: msg['p'].to_d,
123
+ date: msg['T'] / 1000,
124
+ taker_type: msg['b'] > msg['a'] ? 'buy' : 'sell'
125
+ }
126
+ notify_public_trade(trade)
127
+ end
128
+
129
+ def ws_connect
130
+ super
131
+ return if @ping_set
132
+
133
+ Fiber.new do
134
+ EM::Synchrony.add_periodic_timer(80) do
135
+ @ws.send(JSON.dump('ping' => Time.now.to_i))
136
+ end
137
+ end.resume
138
+ @ping_set = true
139
+ end
140
+
141
+ def subscribe_trades(market, ws)
142
+ return unless @config['trade_proxy']
143
+
144
+ sub = {
145
+ method: 'SUBSCRIBE',
146
+ params: [
147
+ "#{market}@trade"
148
+ ],
149
+ id: 1
150
+ }
151
+
152
+ EM.next_tick do
153
+ ws.send(JSON.generate(sub))
154
+ end
155
+ end
156
+
157
+ def subscribe_orderbook(market, ws)
158
+ return unless @config['orderbook_proxy']
159
+
160
+ @sequence_number = 0
161
+ @increment_count = 0
162
+ @snapshot_time = Time.now
163
+ @bids = []
164
+ @asks = []
165
+ @snap = { 'a' => [], 'b' => [] }
166
+
167
+ sub = {
168
+ method: 'SUBSCRIBE',
169
+ params: [
170
+ "#{market}@depth@100ms"
171
+ ],
172
+ id: 1
173
+ }
174
+
175
+ EM.next_tick do
176
+ ws.send(JSON.generate(sub))
177
+ end
178
+ Fiber.new do
179
+ EM::Synchrony.add_periodic_timer(0.2) do
180
+ publish_increment
181
+ end
182
+ end.resume
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PeatioIrix
4
+ module Hooks
5
+ class << self
6
+ def register
7
+ Peatio::Upstream.registry[:binance] = PeatioIrix::Binance
8
+ end
9
+ end
10
+
11
+ if defined?(Rails::Railtie)
12
+ require 'peatio_irix/railtie'
13
+ else
14
+ register
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PeatioIrix
4
+ class Railtie < Rails::Railtie
5
+ config.after_initialize do
6
+ Hooks.register
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PeatioIrix
4
+ VERSION = "1.0.0"
5
+ end
@@ -0,0 +1,13 @@
1
+ require "peatio"
2
+ require "faraday_middleware"
3
+ require "em-synchrony"
4
+ require "em-websocket"
5
+ require "eventmachine"
6
+ require "faraday_middleware"
7
+ require "faye"
8
+
9
+ module PeatioIrix
10
+ require "peatio_irix/binance"
11
+ require "peatio_irix/hooks"
12
+ require "peatio_irix/version"
13
+ end
@@ -0,0 +1,41 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "peatio_irix/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "peatio_irix"
7
+ spec.version = PeatioIrix::VERSION
8
+ spec.authors = ["Anuj Dhiman"]
9
+ spec.email = ["dhimananuj93@gmail.com"]
10
+
11
+ spec.summary = %q{Peatio Irix is implementing several crypto-exchange for Arke and Peatio.}
12
+ spec.description = %q{Peatio Irix is implementing several crypto-exchange for Arke and Peatio.}
13
+ spec.homepage = "https://www.openware.com"
14
+
15
+ # Specify which files should be added to the gem when it is released.
16
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
17
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
18
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+ end
20
+ spec.bindir = "bin"
21
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_dependency "em-synchrony", "~> 1.0"
25
+ spec.add_dependency "em-websocket"
26
+ spec.add_dependency "eventmachine"
27
+ spec.add_dependency "faraday_middleware", "~> 0.13.1"
28
+ spec.add_dependency "faye", "~> 1.2"
29
+ spec.add_dependency "peatio", ">= 2.4.2"
30
+
31
+ spec.add_development_dependency "bundler", "~> 2.0"
32
+ spec.add_development_dependency "em-spec"
33
+ spec.add_development_dependency "em-websocket-client"
34
+ spec.add_development_dependency "pry-byebug"
35
+ spec.add_development_dependency "rake", "~> 13.0"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "rspec_junit_formatter"
38
+ spec.add_development_dependency "rubocop-github"
39
+ spec.add_development_dependency "simplecov"
40
+ spec.add_development_dependency "simplecov-json"
41
+ end
metadata ADDED
@@ -0,0 +1,293 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: peatio_irix
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Anuj Dhiman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-11-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: em-synchrony
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: em-websocket
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: eventmachine
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday_middleware
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.13.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.13.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: faye
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: peatio
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.4.2
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 2.4.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: bundler
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: em-spec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: em-websocket-client
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-byebug
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rake
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '13.0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '13.0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec_junit_formatter
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rubocop-github
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: simplecov
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: simplecov-json
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ">="
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ description: Peatio Irix is implementing several crypto-exchange for Arke and Peatio.
238
+ email:
239
+ - dhimananuj93@gmail.com
240
+ executables:
241
+ - console
242
+ - setup
243
+ extensions: []
244
+ extra_rdoc_files: []
245
+ files:
246
+ - ".gitignore"
247
+ - ".gitlab-ci.yml"
248
+ - ".idea/.gitignore"
249
+ - ".idea/encodings.xml"
250
+ - ".idea/misc.xml"
251
+ - ".idea/modules.xml"
252
+ - ".idea/peatio_irix.iml"
253
+ - ".idea/vcs.xml"
254
+ - ".rspec"
255
+ - ".rubocop.yml"
256
+ - CHANGELOG.md
257
+ - CODE_OF_CONDUCT.md
258
+ - Gemfile
259
+ - Gemfile.lock
260
+ - LICENSE.txt
261
+ - README.md
262
+ - Rakefile
263
+ - bin/console
264
+ - bin/setup
265
+ - lib/peatio_irix.rb
266
+ - lib/peatio_irix/binance.rb
267
+ - lib/peatio_irix/hooks.rb
268
+ - lib/peatio_irix/railtie.rb
269
+ - lib/peatio_irix/version.rb
270
+ - peatio_irix.gemspec
271
+ homepage: https://www.openware.com
272
+ licenses: []
273
+ metadata: {}
274
+ post_install_message:
275
+ rdoc_options: []
276
+ require_paths:
277
+ - lib
278
+ required_ruby_version: !ruby/object:Gem::Requirement
279
+ requirements:
280
+ - - ">="
281
+ - !ruby/object:Gem::Version
282
+ version: '0'
283
+ required_rubygems_version: !ruby/object:Gem::Requirement
284
+ requirements:
285
+ - - ">="
286
+ - !ruby/object:Gem::Version
287
+ version: '0'
288
+ requirements: []
289
+ rubygems_version: 3.0.8
290
+ signing_key:
291
+ specification_version: 4
292
+ summary: Peatio Irix is implementing several crypto-exchange for Arke and Peatio.
293
+ test_files: []