kraken_client 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94c1bf46988852a77f096554d7e253209d01e821
4
- data.tar.gz: c94550fe347df08a865971a49254c80160389d84
3
+ metadata.gz: ebd8411685dd3b46557ce562b26caeef70d4b908
4
+ data.tar.gz: 0f332e259ea5f639db5d35e451cc7289164d9a0c
5
5
  SHA512:
6
- metadata.gz: 0e859b44a953e0fc33003e692da86bb13dd06fcc022ece079720ca518386812c2425d331dd27dcfd2c0b91305d138499cc0ea7138992454e0a0eaf389f255192
7
- data.tar.gz: 8497cb258f41bb82e49c618b770892fa80c6378cef3d0c5aea3d975f2a16c585e84f3d76dc2c3d0fbd9e80b00c9c47796b1a69224e8aa7e7bc6d88fa39e12fda
6
+ metadata.gz: a6310dc3a7f97e8590649b5f069af5f120ecee09b1069082ac37c1bf12929e7416fdf541d077057b42c4e9a40a0ca0f9bba4655427eb6d881f186d2f1f3606f3
7
+ data.tar.gz: decf0bb904a909755763541816a2e373221420d279c2cc08a43dd28cb6cf64d627b266f7731644d5db8396cfd2c3b39f8e44ad166bfb8d5825fdb615f87420f4
data/.gitignore CHANGED
@@ -1,2 +1,10 @@
1
- /pkg/
1
+ /.bundle/
2
+ /.ruby-version
3
+ /.yardoc
4
+ /Gemfile.lock
5
+ /_yardoc/
2
6
  /coverage/
7
+ /doc/
8
+ /pkg/
9
+ /spec/reports/
10
+ /tmp/
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers 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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile CHANGED
@@ -1,8 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in kraken_client.gemspec
4
3
  gemspec
5
- gem 'httparty'
6
- gem 'hashie'
7
- gem 'addressable'
8
- gem 'activesupport', '~> 3.2'
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kraken_client (1.0.3)
4
+ kraken_client (1.1.1)
5
5
  activesupport (~> 3.2)
6
- addressable
6
+ addressabler
7
7
  hashie
8
8
  httparty
9
9
 
@@ -14,13 +14,19 @@ GEM
14
14
  i18n (~> 0.6, >= 0.6.4)
15
15
  multi_json (~> 1.0)
16
16
  addressable (2.3.8)
17
- codeclimate-test-reporter (0.4.7)
17
+ addressabler (0.1.2)
18
+ addressable (>= 2.3)
19
+ ast (2.1.0)
20
+ astrolabe (1.3.1)
21
+ parser (~> 2.2)
22
+ codeclimate-test-reporter (0.4.8)
18
23
  simplecov (>= 0.7.1, < 1.0.0)
19
24
  coderay (1.1.0)
20
- crack (0.3.1)
25
+ crack (0.4.2)
26
+ safe_yaml (~> 1.0.0)
21
27
  docile (1.1.5)
22
- hashie (3.4.2)
23
- httparty (0.13.5)
28
+ hashie (3.4.3)
29
+ httparty (0.13.7)
24
30
  json (~> 1.8)
25
31
  multi_xml (>= 0.5.2)
26
32
  i18n (0.7.0)
@@ -29,38 +35,52 @@ GEM
29
35
  method_source (0.8.2)
30
36
  multi_json (1.11.2)
31
37
  multi_xml (0.5.5)
38
+ parser (2.2.2.6)
39
+ ast (>= 1.1, < 3.0)
40
+ powerpack (0.1.1)
32
41
  pry (0.10.1)
33
42
  coderay (~> 1.1.0)
34
43
  method_source (~> 0.8.1)
35
44
  slop (~> 3.4)
45
+ rainbow (2.0.0)
36
46
  rake (10.4.2)
47
+ rubocop (0.34.0)
48
+ astrolabe (~> 1.3)
49
+ parser (>= 2.2.2.5, < 3.0)
50
+ powerpack (~> 0.1)
51
+ rainbow (>= 1.99.1, < 3.0)
52
+ ruby-progressbar (~> 1.4)
53
+ ruby-progressbar (1.7.5)
54
+ safe_yaml (1.0.4)
37
55
  simplecov (0.10.0)
38
56
  docile (~> 1.1.0)
39
57
  json (~> 1.8)
40
58
  simplecov-html (~> 0.10.0)
41
59
  simplecov-html (0.10.0)
42
60
  slop (3.6.0)
43
- spectus (2.2.0)
61
+ spectus (2.3.1)
44
62
  matchi (~> 0.0)
45
63
  vcr (2.9.3)
46
- webmock (1.9.0)
47
- addressable (>= 2.2.7)
48
- crack (>= 0.1.7)
64
+ webmock (1.21.0)
65
+ addressable (>= 2.3.6)
66
+ crack (>= 0.3.2)
67
+ yard (0.8.7.6)
49
68
 
50
69
  PLATFORMS
51
70
  ruby
52
71
 
53
72
  DEPENDENCIES
54
- activesupport (~> 3.2)
55
- addressable
56
- bundler (~> 1.3)
73
+ bundler (~> 1.10)
57
74
  codeclimate-test-reporter
58
- hashie
59
- httparty
60
75
  kraken_client!
61
76
  pry
62
77
  rake
78
+ rubocop (~> 0.34)
63
79
  simplecov
64
80
  spectus
65
81
  vcr
66
82
  webmock
83
+ yard (~> 0.8)
84
+
85
+ BUNDLED WITH
86
+ 1.11.2
@@ -7,13 +7,14 @@
7
7
 
8
8
  ![kraken_client_blob](http://image.noelshack.com/fichiers/2015/34/1440350422-kraken3.png)
9
9
 
10
- __KrakenClient__ is a Ruby wrapper of the [Kraken API](https://support.kraken.com/hc/en-us/articles/206548367-What-is-the-API-call-rate-limit-).
10
+ __KrakenClient__ is a Ruby wrapper of the [Kraken API](https://support.kraken.com/hc/en-us/articles/206548367-What-is-the-API-call-rate-limit-).
11
11
  [Kraken](https://www.kraken.com/) is a market exchange site serving those trading with Crypto-Currencies, such as **Bitcoin**.
12
12
 
13
13
  It is a robust gem, and tested using the Awesome [Spectus gem](https://github.com/fixrb/spectus).
14
14
 
15
15
  ## Summary
16
16
 
17
+ * [Security](#security)
17
18
  * [Installation](#installation)
18
19
  * [Usage](#usage)
19
20
  * [Configuration](#configuration)
@@ -45,6 +46,19 @@ It is a robust gem, and tested using the Awesome [Spectus gem](https://github.co
45
46
  * [Contributing](#contributing)
46
47
  * [License](#license)
47
48
 
49
+ ## Security
50
+
51
+ As a basic form of security __KrakenClient__ provides a set of SHA512 checksums for
52
+ every Gem release. These checksums can be found in the `checksum/` directory.
53
+ Although these checksums do not prevent malicious users from tampering with a
54
+ built Gem they can be used for basic integrity verification purposes.
55
+
56
+ The checksum of a file can be checked using the `sha512sum` command. For
57
+ example:
58
+
59
+ $ sha512sum pkg/kraken_client-1.1.0.gem
60
+ d1b055b091443b862d88028cb517410be016264295950de4cf7973686063e031dfc619cfa7970dca8d4081f82bf6856339b9f35fef356ecce7c42f1ebb3f3b7f pkg/kraken_client-1.1.0.gem
61
+
48
62
 
49
63
  ## Installation
50
64
 
@@ -92,8 +106,7 @@ You can also pass any of those options inline when loading an instance of Kraken
92
106
  KrakenClient.load({base_uri: 'https://api.kraken.com', tier: 3}).config.tier
93
107
  ```
94
108
 
95
-
96
- **/!\\ Important Note /!\\** If you wish to use the Private Endpoints, you need to specify an API Key, or an exception will be raised.
109
+ :warning: **Important Note** :warning:: If you wish to use the Private Endpoints, you need to specify an API Key, or an exception will be raised.
97
110
 
98
111
  ### Call Rate Limiter ###
99
112
 
@@ -299,19 +312,22 @@ client.private.cancel_order("UKIYSP-9VN27-AJWWYC")
299
312
 
300
313
  If you like the work that has been done, do not hesitate in paying me a Coffee, I'd gladly accept it :)
301
314
 
302
- ![bitcoinadress](http://image.noelshack.com/fichiers/2015/34/1440342556-bitcoinadress.png)
315
+ ![bitcoinadress](http://image.noelshack.com/fichiers/2015/35/1440407022-lastbtc.png)
303
316
 
304
317
  Bitcoin Adress: 1LxffuH2C44mFNTYe1NtDz7FeWScCFZqM8
305
318
  Donate here: https://www.coinbase.com/shideneyu
306
319
 
307
320
  ## Credits
308
321
 
309
- This gem has been made by [Sidney SISSAOUI (shideneyu)](https://github.com/shideneyu).
322
+ This gem has been made by [Sidney SISSAOUI (shideneyu)](https://github.com/shideneyu).
310
323
 
311
324
  Special credits goes to [Alexander LEISHMAN](http://alexleishman.com/) and other [kraken_ruby](https://github.com/leishman/kraken_ruby/graphs/contributors) contributors for their gem, which helped me to have a nice skeleton to begin **KrakenClient**. It would have been difficult for me to sign the requests if it wasn't thanks to their work.
312
325
 
313
326
  If you want to be part of those credits, do not hesitate to contribute by doing some pull requests ;) !
314
327
 
328
+ ## Versioning
329
+
330
+ __KrakenClient__ follows [Semantic Versioning 2.0](http://semver.org/).
315
331
 
316
332
  ## Contributing
317
333
 
data/Rakefile CHANGED
@@ -1,10 +1,13 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'rake/testtask'
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new
3
6
 
4
7
  Rake::TestTask.new do |t|
5
- t.pattern = File.join 'test', '**', 'test_*.rb'
6
8
  t.verbose = true
7
9
  t.warning = false
10
+ t.pattern = File.join('test', '**', 'test_*.rb')
8
11
  end
9
12
 
10
13
  namespace :test do
@@ -14,4 +17,5 @@ namespace :test do
14
17
  end
15
18
  end
16
19
 
17
- task default: :test
20
+ task(:doc_stats) { ruby '-S yard stats' }
21
+ task default: [:test, :doc_stats, :rubocop]
data/VERSION.semver ADDED
@@ -0,0 +1 @@
1
+ 1.1.1
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'kraken_client'
5
+
6
+ require 'irb'
7
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
@@ -0,0 +1 @@
1
+ d1b055b091443b862d88028cb517410be016264295950de4cf7973686063e031dfc619cfa7970dca8d4081f82bf6856339b9f35fef356ecce7c42f1ebb3f3b7f
@@ -1,36 +1,32 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'version'
5
-
6
1
  Gem::Specification.new do |spec|
7
2
  spec.name = 'kraken_client'
8
- spec.version = KrakenClient::VERSION
3
+ spec.version = File.read('VERSION.semver').chomp
9
4
  spec.authors = ['Sidney SISSAOUI']
10
5
  spec.email = ['shideneyu@gmail.com']
11
6
  spec.description = %q{'Wrapper for Kraken Exchange API'}
12
7
  spec.summary = %q{'Wrapper for Kraken Exchange API'}
13
- spec.homepage = 'https://www.kraken.com/help/api'
8
+ spec.homepage = 'https://github.com/shideneyu/kraken_client'
14
9
  spec.license = 'MIT'
15
10
 
16
- spec.files = `git ls-files`.split($/).delete_if { |f| f =~ /\.gem$/ }
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
11
+ spec.files =
12
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
13
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
14
  spec.require_paths = ['lib']
20
15
 
21
- spec.add_development_dependency 'bundler', '~> 1.3'
16
+ spec.add_development_dependency 'bundler', '~> 1.10'
22
17
  spec.add_development_dependency 'rake'
23
18
  spec.add_development_dependency 'spectus'
24
19
  spec.add_development_dependency 'pry'
25
20
  spec.add_development_dependency 'webmock'
26
21
  spec.add_development_dependency 'vcr'
22
+ spec.add_development_dependency 'yard', '~> 0.8'
27
23
  spec.add_development_dependency 'simplecov'
28
24
  spec.add_development_dependency 'codeclimate-test-reporter'
25
+ spec.add_development_dependency 'rubocop', '~> 0.34'
29
26
 
30
27
  spec.add_dependency 'httparty'
31
28
  spec.add_dependency 'hashie'
32
- spec.add_dependency 'addressable'
29
+ spec.add_dependency 'addressabler'
33
30
 
34
31
  spec.add_runtime_dependency 'activesupport', '~> 3.2'
35
-
36
32
  end
data/lib/configurable.rb CHANGED
@@ -10,4 +10,4 @@ module KrakenClient
10
10
  end
11
11
 
12
12
  end
13
- end
13
+ end
@@ -1,7 +1,7 @@
1
1
  require 'active_support/inflector'
2
2
  require 'base64'
3
3
  require 'securerandom'
4
- require 'addressable/uri'
4
+ require 'addressabler'
5
5
  require 'httparty'
6
6
  require 'hashie'
7
7
  require 'pry'
@@ -19,12 +19,12 @@ module KrakenClient
19
19
 
20
20
  def set_methods
21
21
  data.each do |method, method_alias|
22
- self.class.send(:define_method, Array(method_alias).first) do |args = {}|
22
+ self.class.send(:define_method, Array(method_alias).first) do |args = {}|
23
23
  raise_exception(Array(method_alias).last, args)
24
24
 
25
25
  perform(method.to_s, args)
26
26
  end
27
- end
27
+ end
28
28
  end
29
29
 
30
30
  def type
@@ -4,7 +4,7 @@ module KrakenClient
4
4
 
5
5
  def perform(endpoint_name, args)
6
6
  url = config.base_uri + url_path(endpoint_name)
7
- response = Hashie::Mash.new(request_manager.call(url, endpoint_name, args))
7
+ Hashie::Mash.new(request_manager.call(url, endpoint_name, args))
8
8
  end
9
9
 
10
10
  def data
@@ -42,4 +42,4 @@ module KrakenClient
42
42
  end
43
43
  end
44
44
  end
45
- end
45
+ end
@@ -30,4 +30,4 @@ module KrakenClient
30
30
  end
31
31
  end
32
32
  end
33
- end
33
+ end
@@ -20,13 +20,11 @@ module KrakenClient
20
20
  "KrakenClient::Requests::#{type}".constantize.new(config, type)
21
21
  end
22
22
 
23
- def call(url, endpoint_name, options = nil)
23
+ def call(url, _endpoint_name, _options = nil)
24
24
  changed
25
25
  notify_observers(url.split('/').last)
26
26
  end
27
27
 
28
- private
29
-
30
28
  def self.type(given_type)
31
29
  given_type == 'Public' ? 'Get' : 'Post'
32
30
  end
@@ -51,28 +51,28 @@ module KrakenClient
51
51
  when 'AddOrder' then 0
52
52
  when 'CancelOrder' then 0
53
53
  else 1
54
- end
54
+ end
55
55
  end
56
56
 
57
57
  def counter_total
58
- @counter ||= case config.tier
59
- when 0 then 10
60
- when 1 then 10
61
- when 2 then 10
62
- when 3 then 20
63
- when 4 then 20
64
- end
58
+ @counter ||= case config.tier
59
+ when 0 then 10
60
+ when 1 then 10
61
+ when 2 then 10
62
+ when 3 then 20
63
+ when 4 then 20
64
+ end
65
65
  end
66
66
 
67
67
  def seconds_to_decrement
68
- @decrement ||= case config.tier
69
- when 0 then 5
70
- when 1 then 5
71
- when 2 then 5
72
- when 3 then 2
73
- when 4 then 1
74
- end
68
+ @decrement ||= case config.tier
69
+ when 0 then 5
70
+ when 1 then 5
71
+ when 2 then 5
72
+ when 3 then 2
73
+ when 4 then 1
74
+ end
75
75
  end
76
76
  end
77
77
  end
78
- end
78
+ end
@@ -35,4 +35,4 @@ module KrakenClient
35
35
 
36
36
  end
37
37
  end
38
- end
38
+ end
data/pkg_checksum ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'digest/sha2'
4
+
5
+ gemname = :kraken_client
6
+ ARGV[0] = File.read('VERSION.semver').chomp if ARGV[0].nil?
7
+ built_gem_path = "pkg/#{gemname}-#{ARGV[0]}.gem"
8
+ checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
9
+ checksum_path = "checksum/#{gemname}-#{ARGV[0]}.gem.sha512"
10
+
11
+ File.open(checksum_path, 'w') { |f| f.write("#{checksum}\n") }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kraken_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sidney SISSAOUI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '0.8'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '0.8'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: simplecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +136,20 @@ dependencies:
122
136
  - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.34'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.34'
125
153
  - !ruby/object:Gem::Dependency
126
154
  name: httparty
127
155
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +179,7 @@ dependencies:
151
179
  - !ruby/object:Gem::Version
152
180
  version: '0'
153
181
  - !ruby/object:Gem::Dependency
154
- name: addressable
182
+ name: addressabler
155
183
  requirement: !ruby/object:Gem::Requirement
156
184
  requirements:
157
185
  - - ">="
@@ -187,10 +215,16 @@ extra_rdoc_files: []
187
215
  files:
188
216
  - ".gitignore"
189
217
  - ".travis.yml"
218
+ - CODE_OF_CONDUCT.md
190
219
  - Gemfile
191
220
  - Gemfile.lock
192
221
  - LICENSE.md
222
+ - README.md
193
223
  - Rakefile
224
+ - VERSION.semver
225
+ - bin/console
226
+ - bin/setup
227
+ - checksum/kraken_client-1.1.0.gem.sha512
194
228
  - fixtures/vcr_cassettes/add_order.yml
195
229
  - fixtures/vcr_cassettes/assets.yml
196
230
  - fixtures/vcr_cassettes/assets_pairs.yml
@@ -210,7 +244,7 @@ files:
210
244
  - fixtures/vcr_cassettes/trade_volume.yml
211
245
  - fixtures/vcr_cassettes/trades.yml
212
246
  - fixtures/vcr_cassettes/trades_history.yml
213
- - kraken_rb.gemspec
247
+ - kraken_client.gemspec
214
248
  - lib/configurable.rb
215
249
  - lib/configuration.rb
216
250
  - lib/exceptions.rb
@@ -225,13 +259,8 @@ files:
225
259
  - lib/kraken_client/requests/get.rb
226
260
  - lib/kraken_client/requests/limiter.rb
227
261
  - lib/kraken_client/requests/post.rb
228
- - lib/version.rb
229
- - readme.md
230
- - test/support/coverage.rb
231
- - test/test_helper.rb
232
- - test/test_private.rb
233
- - test/test_public.rb
234
- homepage: https://www.kraken.com/help/api
262
+ - pkg_checksum
263
+ homepage: https://github.com/shideneyu/kraken_client
235
264
  licenses:
236
265
  - MIT
237
266
  metadata: {}
@@ -255,8 +284,5 @@ rubygems_version: 2.2.2
255
284
  signing_key:
256
285
  specification_version: 4
257
286
  summary: "'Wrapper for Kraken Exchange API'"
258
- test_files:
259
- - test/support/coverage.rb
260
- - test/test_helper.rb
261
- - test/test_private.rb
262
- - test/test_public.rb
287
+ test_files: []
288
+ has_rdoc:
data/lib/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module KrakenClient
2
- VERSION = "1.1.0"
3
- end
@@ -1,3 +0,0 @@
1
- require 'simplecov'
2
-
3
- SimpleCov.start
data/test/test_helper.rb DELETED
@@ -1,22 +0,0 @@
1
- require "codeclimate-test-reporter"
2
- CodeClimate::TestReporter.start
3
-
4
- require_relative File.join 'support', 'coverage'
5
- require_relative File.join '..', 'lib', 'kraken_client'
6
- require 'spectus'
7
- require 'vcr'
8
- require 'webmock'
9
-
10
- include WebMock::API
11
-
12
- VCR.configure do |config|
13
- config.cassette_library_dir = "fixtures/vcr_cassettes"
14
- config.hook_into :webmock # or :fakeweb
15
- config.ignore_hosts 'codeclimate.com'
16
- end
17
-
18
- # Testing Private Endpoints
19
- KrakenClient.configure do |config|
20
- config.api_key = ENV['KRAKEN_API_KEY'] || 'COMPUTED'
21
- config.api_secret = ENV['KRAKEN_API_SECRET'] ||'COMPUTED'
22
- end
data/test/test_private.rb DELETED
@@ -1,88 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- kraken = KrakenClient.load
4
- client = kraken.private
5
-
6
- # User Balance
7
- VCR.use_cassette("balance") do
8
- Spectus.this { client.balance.class }.MUST Equal: Hashie::Mash
9
- end
10
-
11
- # Trade Balance
12
- VCR.use_cassette("trade_balance") do
13
- Spectus.this { client.trade_balance.c }.MUST Eql: '0.0000'
14
- end
15
-
16
- # Open Orders
17
- VCR.use_cassette("open_orders") do
18
- Spectus.this { client.open_orders.open.class }.MUST Equal: Hashie::Mash
19
- end
20
-
21
- # Closed Orders
22
- VCR.use_cassette("closed_orders") do
23
- Spectus.this { client.closed_orders.closed.class }.MUST Equal: Hashie::Mash
24
- end
25
-
26
- # Query Orders
27
- VCR.use_cassette("query_orders") do
28
- Spectus.this do
29
- order = client.query_orders({txid: 'OKRRJ6-MH3UH-DV6IKT'})
30
- order['OKRRJ6-MH3UH-DV6IKT'].status
31
- end.MUST Eql: 'canceled'
32
- end
33
-
34
- # Trades History
35
- VCR.use_cassette("trades_history") do
36
- Spectus.this { client.trades_history.trades.class }.MUST Equal: Hashie::Mash
37
- end
38
-
39
- # Query Trades
40
- VCR.use_cassette("query_trades") do
41
- Spectus.this do
42
- order = client.query_trades({txid: 'THZPTW-BMF6X-VWMN5P'})
43
- order['THZPTW-BMF6X-VWMN5P'].pair
44
- end.MUST Eql: 'XETHZEUR'
45
- end
46
-
47
- # Open Positions
48
- #CANT TEST, PARAMS DO NOT WORK
49
-
50
- # Ledgers Info
51
- VCR.use_cassette("ledgers") do
52
- Spectus.this { client.ledgers.ledger.class }.MUST Equal: Hashie::Mash
53
- end
54
-
55
- # Query Ledgers
56
- VCR.use_cassette("query_ledgers") do
57
- Spectus.this do
58
- ledger = client.query_ledgers(id: 'LRSNYS-DICDD-3QM34P')
59
- ledger['LRSNYS-DICDD-3QM34P'].class
60
- end.MUST Equal: Hashie::Mash
61
- end
62
-
63
- # Trade Volume
64
- VCR.use_cassette("trade_volume") do
65
- Spectus.this { client.trade_volume(pair: 'XETHZEUR').count }.MUST Equal: 4
66
- end
67
-
68
- # Add Order
69
- VCR.use_cassette("add_order") do
70
- Spectus.this do
71
-
72
- opts = {
73
- pair: 'ETHEUR',
74
- type: 'buy',
75
- ordertype: 'market',
76
- volume: 0.01
77
- }
78
-
79
- client.add_order(opts).txid
80
- end.MUST Eql: ['OEDIZV-VDAW3-RHLJVB']
81
- end
82
-
83
- # Cancel Order
84
- VCR.use_cassette("cancel_order") do
85
- Spectus.this do
86
- client.cancel_order(txid: 'ODEC3J-QAMVD-NSF7XD').count
87
- end.MUST Eql: 1
88
- end
data/test/test_public.rb DELETED
@@ -1,46 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- kraken = KrakenClient.load
4
- client = kraken.public
5
-
6
- # Server Time
7
- VCR.use_cassette("server_time") do
8
- kraken_time = DateTime.parse(client.server_time.rfc1123)
9
- utc_time = Time.now.getutc
10
- Spectus.this { kraken_time.day.class }.MUST Equal: Fixnum
11
- Spectus.this { kraken_time.hour.class }.MUST Equal: Fixnum
12
- end
13
-
14
- # Assets
15
- VCR.use_cassette("assets") do
16
- Spectus.this { client.assets.XETH.aclass }.MUST Eql: 'currency'
17
- end
18
-
19
- # Assets Pairs
20
- VCR.use_cassette("assets_pairs") do
21
- Spectus.this { client.asset_pairs.XETHXXBT.altname }.MUST Eql: 'ETHXBT'
22
- end
23
-
24
- # Ticker
25
- VCR.use_cassette("ticker") do
26
- result = client.ticker(pair: 'XXBTZEUR, XXBTZGBP')
27
- Spectus.this { result.XXBTZGBP.a.class }.MUST Equal: Array
28
- end
29
-
30
- # Order Book
31
- VCR.use_cassette("order_book") do
32
- order_book = client.order_book(pair: 'XXBTZEUR')
33
- Spectus.this { order_book.XXBTZEUR.asks.class }.MUST Equal: Array
34
- end
35
-
36
- # Trades
37
- VCR.use_cassette("trades") do
38
- trades = client.trades(pair: 'XXBTZEUR')
39
- Spectus.this { trades.XXBTZEUR.class }.MUST Equal: Array
40
- end
41
-
42
- # Spread
43
- VCR.use_cassette("spread") do
44
- spread = client.spread(pair: 'XXBTZEUR')
45
- Spectus.this { spread.XXBTZEUR.class }.MUST Equal: Array
46
- end