cointrader.net 0.5.0 → 0.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
  SHA1:
3
- metadata.gz: 05b52221604c3a324a71a4bcdbeb291fe7dcfefc
4
- data.tar.gz: cec44051d133b23c704a2a5791dfb0de094143cd
3
+ metadata.gz: f4894f20a7eef3881ff64afa1fe7fbd5b5da0af4
4
+ data.tar.gz: 5af0e2e7d5c1778d030a922e9be8ed60564fcd32
5
5
  SHA512:
6
- metadata.gz: 8522a0c8016ffd7fde271d39a73aac91eafe713801e59268da728633642a0988983f202e36de804c90f93b6292af9ba5c5813cb340c09e2837d056fb51d08fb7
7
- data.tar.gz: 32548039ce2a17d37252da46a0ece1107bcb212a94d23f9fae73014dcd44618b5aa41d2884d4e3c3a77bc708f00b6e8b994aa0f8ecb09b3d88c064168234963b
6
+ metadata.gz: 8253b6732a84bbd7894dfd69bac57017636fa57684e343d68e17abed791e8fe32d0394239604e9f9b1d4335a9e0eb2278f3dfa23588391a0f226a8f9ee818554
7
+ data.tar.gz: cc40c7396012749ff811b1772ee1f27e912ae5e596e0d2cc13130973a88264f5fec2756912faf939401248644729a24bb13f84b2dbb505db77ecd79d888eaa05
@@ -23,5 +23,11 @@ module Cointrader
23
23
  path = join_params(params, :currency_pair, :book, :limit)
24
24
  request(:get, "/stats/orders/#{path}")
25
25
  end
26
+
27
+ def trades params={}
28
+ params = get_defaults(params)
29
+ path = join_params(params, :currency_pair, :limit, :offset)
30
+ request(:get, "/stats/trades/#{path}")
31
+ end
26
32
  end
27
33
  end
@@ -1,3 +1,3 @@
1
1
  module Cointrader
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
data/spec/client_spec.rb CHANGED
@@ -131,5 +131,16 @@ describe Cointrader::Client do
131
131
  end
132
132
  end
133
133
  end
134
+
135
+ describe '#trades' do
136
+ it 'lists recent trades executed' do
137
+ VCR.use_cassette('trades') do
138
+ response = subject.trades
139
+
140
+ expect_success(response)
141
+ expect(response['data'][0]['price'])
142
+ end
143
+ end
144
+ end
134
145
  end
135
146
  end
@@ -0,0 +1,86 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.cointrader.net/api4/stats/trades/BTCUSD
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"secret":"l33lpBPqrNazDz5bgOpQkaerFtpOBqw8wjLTK3sbEcSK","t":"1433018591527"}'
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ X-Auth:
17
+ - hCkVvzR4Nuc6dbuN0biMFSqMqSfc1f1grhXqoaQAlq1y
18
+ X-Auth-Hash:
19
+ - 4feb0dd6e75359c6d34944382b2fb29ca4e4922b56e047adff86f10fd8f27287
20
+ Content-Length:
21
+ - '77'
22
+ User-Agent:
23
+ - Ruby
24
+ response:
25
+ status:
26
+ code: 200
27
+ message: OK
28
+ headers:
29
+ Date:
30
+ - Sat, 30 May 2015 20:40:02 GMT
31
+ Server:
32
+ - Apache/2.4.12 (Ubuntu) OpenSSL/1.0.1
33
+ Strict-Transport-Security:
34
+ - max-age=63072000; includeSubDomains
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ X-Xss-Protection:
38
+ - 1; mode=block
39
+ X-Content-Type-Options:
40
+ - nosniff
41
+ X-Powered-By:
42
+ - ''
43
+ Set-Cookie:
44
+ - CTXIDSCK=ldjcc9t7dtcsdpqsu9vmagcgt3; path=/; secure; HttpOnly
45
+ - "___utmvaoVuoloc=XCm\x01sriU; path=/; Max-Age=900"
46
+ - '___utmvboVuoloc=mZY XeXOFalE: AtB; path=/; Max-Age=900'
47
+ - ___utmvmoVuoloc=TeazqYKNBXH; path=/; Max-Age=900
48
+ - incap_ses_240_116144=BkywaFl6qmf6akKvHqdUAyIgalUAAAAAracgZQAMuThopbZAvK8nHA==;
49
+ path=/; Domain=.cointrader.net
50
+ - visid_incap_116144=cvQ1M0k/R+ucp8Zn8S0BfyIgalUAAAAAQUIPAAAAAADP7AFNnjMEUDXy6TFC2pEd;
51
+ expires=Mon, 29 May 2017 07:57:03 GMT; path=/; Domain=.cointrader.net
52
+ Expires:
53
+ - Thu, 19 Nov 1981 08:52:00 GMT
54
+ Cache-Control:
55
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
56
+ Pragma:
57
+ - no-cache
58
+ Accept-Ranges:
59
+ - none
60
+ Vary:
61
+ - Accept-Encoding
62
+ Content-Encoding:
63
+ - gzip
64
+ Content-Type:
65
+ - text/html
66
+ X-Iinfo:
67
+ - 8-177494102-177494174 NNNY CT(232 230 0) RT(1433018401527 140) q(0 0 5 -1)
68
+ r(8 8) U13
69
+ X-Cdn:
70
+ - Incapsula
71
+ Transfer-Encoding:
72
+ - chunked
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: !binary |-
76
+ H4sIAAAAAAAA/63SvU7DMBAA4J2niDy31p3/zyNlZGuZEEJRapVIkJbEEVRV
77
+ 3x03olIQTVsRvNk++7PvbseatihC0zAf6zZMWFzH/HW2bqvIPENgE/aWdvNV
78
+ SNP5y/qjrFbZfd7EDCFb1PkyNClkmcec+ccdK9q6DlWxfd7kZZ1O3C5mD/O7
79
+ FLGpy+JwhZCKw+HW9zavYhm3aQ04SNJOKMG+/bRIXJg0DZ+haGNYHo4C6ino
80
+ qYQM0SN5DWw/uco0nOiX6aAbPRMdp0so6mtRewIlSxok6B4qpOSIwyp4YXwK
81
+ GKFqAYoM9VUUkjt7TgXw0v5dRQ4KwTpF/b8qy+1FVV2ruhOthMpKUl0Zj6rU
82
+ qdiDKFDXS3IMCppASoP9BKc+18Oo8yqhYgyqHaEmY36gwIUYVrWX5OHqqv5P
83
+ ftEL7cUoVJAyRnb9ekRteoo8h4LwQGz/tL/5AjIbgqbkBAAA
84
+ http_version:
85
+ recorded_at: Sat, 30 May 2015 20:43:12 GMT
86
+ recorded_with: VCR 2.9.3
data/spec/spec_helper.rb CHANGED
@@ -16,10 +16,11 @@ end
16
16
  VCR.configure do |config|
17
17
  config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
18
18
  config.hook_into :webmock
19
+ config.default_cassette_options = { match_requests_on: [:method] }
19
20
  end
20
21
 
21
22
  Cointrader.configure do |config|
22
23
  config.api_key = ENV['API_KEY']
23
24
  config.api_secret = ENV['API_SECRET']
24
- config.api_url = 'https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4'
25
+ config.api_url = ENV['API_URL'] || 'https://private-anon-e01e290b7-cointrader.apiary-mock.com/api4'
25
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cointrader.net
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maros Hluska
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-27 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,6 +111,7 @@ files:
111
111
  - spec/fixtures/vcr_cassettes/stats_7d.yml
112
112
  - spec/fixtures/vcr_cassettes/symbol.yml
113
113
  - spec/fixtures/vcr_cassettes/tradehistory.yml
114
+ - spec/fixtures/vcr_cassettes/trades.yml
114
115
  - spec/spec_helper.rb
115
116
  homepage: https://github.com/mhluska/cointrader.net
116
117
  licenses:
@@ -148,4 +149,5 @@ test_files:
148
149
  - spec/fixtures/vcr_cassettes/stats_7d.yml
149
150
  - spec/fixtures/vcr_cassettes/symbol.yml
150
151
  - spec/fixtures/vcr_cassettes/tradehistory.yml
152
+ - spec/fixtures/vcr_cassettes/trades.yml
151
153
  - spec/spec_helper.rb