excoin 0.0.1
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 +7 -0
- data/.gitignore +32 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +674 -0
- data/README.md +278 -0
- data/Rakefile +9 -0
- data/config/config.example.yml +16 -0
- data/excoin.gemspec +26 -0
- data/lib/account/account.rb +116 -0
- data/lib/account/deposit.rb +20 -0
- data/lib/account/order.rb +43 -0
- data/lib/account/orders.rb +138 -0
- data/lib/account/trade.rb +26 -0
- data/lib/account/trades.rb +59 -0
- data/lib/account/wallet.rb +72 -0
- data/lib/account/withdrawal.rb +27 -0
- data/lib/exchange/candlestick_chart.rb +33 -0
- data/lib/exchange/candlestick_data.rb +20 -0
- data/lib/exchange/exchange.rb +75 -0
- data/lib/exchange/market.rb +50 -0
- data/lib/exchange/order.rb +23 -0
- data/lib/exchange/order_depth_chart.rb +41 -0
- data/lib/exchange/order_depth_data.rb +23 -0
- data/lib/exchange/orders.rb +119 -0
- data/lib/exchange/trade.rb +26 -0
- data/lib/exchange/trades.rb +68 -0
- data/lib/excoin.rb +45 -0
- data/lib/excoin/api.rb +212 -0
- data/lib/excoin/version.rb +10 -0
- data/spec/fixtures/cassette_library/account_cancel_order_erb.yml +59 -0
- data/spec/fixtures/cassette_library/account_issue_order_erb.yml +59 -0
- data/spec/fixtures/cassette_library/account_view_order_erb.yml +59 -0
- data/spec/fixtures/cassette_library/exc_recent_trades.yml +157 -0
- data/spec/fixtures/cassette_library/exc_recent_trades_count.yml +62 -0
- data/spec/fixtures/cassette_library/exc_recent_trades_timestamp.yml +142 -0
- data/spec/fixtures/cassette_library/exchange_candlestick_chart_data.yml +58 -0
- data/spec/fixtures/cassette_library/exchange_candlestick_chart_data_duration.yml +58 -0
- data/spec/fixtures/cassette_library/exchange_open_orders.yml +58 -0
- data/spec/fixtures/cassette_library/exchange_open_orders_type.yml +58 -0
- data/spec/fixtures/cassette_library/exchange_order_depth_chart_data.yml +58 -0
- data/spec/fixtures/cassette_library/excoin_wallet_reserves.yml +59 -0
- data/spec/fixtures/cassette_library/excoin_wallets_summary.yml +65 -0
- data/spec/fixtures/cassette_library/excoin_wallets_summary_coin.yml +59 -0
- data/spec/fixtures/cassette_library/multi_exchange_summ.yml +58 -0
- data/spec/fixtures/cassette_library/multi_exchange_summ_currency.yml +58 -0
- data/spec/fixtures/cassette_library/single_exchange_summ.yml +58 -0
- data/spec/fixtures/cassette_library/single_exchange_summary.yml +58 -0
- data/spec/lib/account/account_spec.rb +136 -0
- data/spec/lib/account/orders_spec.rb +51 -0
- data/spec/lib/account/trades_spec.rb +52 -0
- data/spec/lib/account/wallet_spec.rb +67 -0
- data/spec/lib/exchange/candlestick_chart_spec.rb +23 -0
- data/spec/lib/exchange/exchange_spec.rb +38 -0
- data/spec/lib/exchange/market_spec.rb +23 -0
- data/spec/lib/exchange/order_depth_chart_spec.rb +20 -0
- data/spec/lib/exchange/orders_spec.rb +47 -0
- data/spec/lib/exchange/trades_spec.rb +50 -0
- data/spec/lib/excoin/api_spec.rb +228 -0
- data/spec/lib/excoin_spec.rb +28 -0
- data/spec/spec_helper.rb +46 -0
- data/spec/support/vcr.rb +21 -0
- metadata +209 -0
data/lib/excoin/api.rb
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
require 'net/https'
|
2
|
+
require 'uri'
|
3
|
+
require 'json'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
class Excoin::API
|
7
|
+
begin
|
8
|
+
config = YAML::load_file(File.expand_path('~/.excoin/config.yml', __FILE__))
|
9
|
+
rescue
|
10
|
+
config = ''
|
11
|
+
end
|
12
|
+
API_VERSION = config["api_version"]
|
13
|
+
API_KEY = config["api_key"]
|
14
|
+
API_SECRET = config["api_secret"]
|
15
|
+
API_REPLAY_STRATEGY = config["api_replay_strategy"]
|
16
|
+
NONCE_MULTIPLIER = config["nonce_multiplier"].to_i
|
17
|
+
EXPIRE_INTERVAL = config["expire_interval"].to_i
|
18
|
+
EXCOIN_API_BASE_URL = "https://api.exco.in/v#{API_VERSION}/"
|
19
|
+
ACCOUNT_INACCESSIBLE_ERROR = "Account inaccessible, valid API key not provided."
|
20
|
+
NO_REPLAY_STRATEGY = "Account inaccessible, valid replay strategy not provided."
|
21
|
+
NO_REPLAY_STRATEGY_PARAM = "Account inaccessible, valid replay strategy paramter not provided."
|
22
|
+
CONNECTION_REFUSED = "Connection refused."
|
23
|
+
|
24
|
+
def initialize(api_key = nil, api_secret = nil, replay_strategy = nil, strategy_parameter = nil)
|
25
|
+
@api_key = api_key
|
26
|
+
@api_key ||= API_KEY if API_KEY =~ /\A[\w|-]{42,}/
|
27
|
+
@api_secret = api_secret
|
28
|
+
@api_secret ||= API_SECRET if API_SECRET =~ /\A[\w|-]{42,}/
|
29
|
+
@account_accessible = !(@api_key.nil? or @api_secret.nil?)
|
30
|
+
|
31
|
+
@api_replay_strategy = replay_strategy
|
32
|
+
@api_replay_strategy ||= API_REPLAY_STRATEGY
|
33
|
+
@api_replay_strategy_parameter = strategy_parameter
|
34
|
+
@api_replay_strategy_parameter ||= ((EXPIRE_INTERVAL if @api_replay_strategy == "expire") or (NONCE_MULTIPLIER if @api_replay_strategy == "nonce"))
|
35
|
+
end
|
36
|
+
|
37
|
+
## Exchange API
|
38
|
+
|
39
|
+
def multiple_exchange_summary(currency = nil)
|
40
|
+
unless currency
|
41
|
+
self.get("summary")
|
42
|
+
else
|
43
|
+
self.get("summary/#{currency}")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def exchange_summary(currency, commodity)
|
48
|
+
self.get("exchange/#{currency}/#{commodity}/summary")
|
49
|
+
end
|
50
|
+
|
51
|
+
def exchange_recent_trades(currency, commodity, limit_type = "count", limit = 100)
|
52
|
+
if limit_type == "count"
|
53
|
+
self.get("exchange/#{currency}/#{commodity}/trades/#{limit}")
|
54
|
+
elsif limit_type == "timestamp"
|
55
|
+
self.get("exchange/#{currency}/#{commodity}/trades/timestamp/#{limit}")
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def exchange_open_orders(currency, commodity, type_or_count = nil)
|
60
|
+
if type_or_count
|
61
|
+
type = type_or_count.upcase if (type_or_count.class == String and (type_or_count.upcase == "BID" or type_or_count.upcase == "ASK"))
|
62
|
+
count = type_or_count.to_s unless type
|
63
|
+
end
|
64
|
+
self.get("exchange/#{currency}/#{commodity}/orders#{ '/type/' + type if type }#{'/' + count if count}")
|
65
|
+
end
|
66
|
+
|
67
|
+
def exchange_candlestick_chart_data(currency, commodity, duration = nil)
|
68
|
+
self.get("exchange/#{currency}/#{commodity}/chart/candlestick#{ '/' + duration if duration }")
|
69
|
+
end
|
70
|
+
|
71
|
+
def exchange_order_depth_chart_data(currency, commodity)
|
72
|
+
self.get("exchange/#{currency}/#{commodity}/chart/orderdepth")
|
73
|
+
end
|
74
|
+
|
75
|
+
## Account API
|
76
|
+
|
77
|
+
def account_summary
|
78
|
+
if @account_accessible
|
79
|
+
self.get("account/summary")
|
80
|
+
else
|
81
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def account_withdraw(currency, address, amount)
|
86
|
+
if @account_accessible
|
87
|
+
self.get("account/withdraw/#{currency}/#{address}/#{amount}")
|
88
|
+
else
|
89
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
def account_generate_deposit_address(coin)
|
94
|
+
if @account_accessible
|
95
|
+
self.get("account/#{coin}/generate_address")
|
96
|
+
else
|
97
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def account_trades(count = 100)
|
102
|
+
if @account_accessible
|
103
|
+
self.get("account/trades/#{count}")
|
104
|
+
else
|
105
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
def account_open_orders(currency = nil, commodity = nil, type = nil)
|
110
|
+
if @account_accessible
|
111
|
+
self.get("account/orders#{'/' + currency if currency}#{'/' + commodity if commodity}#{'/' + type if type }")
|
112
|
+
else
|
113
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def account_issue_order(currency, commodity, type, amount, price)
|
118
|
+
if @account_accessible
|
119
|
+
self.get("account/orders/issue/#{currency}/#{commodity}/#{type}/#{amount}/#{price}")
|
120
|
+
else
|
121
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def account_view_order(order_id)
|
126
|
+
if @account_accessible
|
127
|
+
self.get("account/order/#{order_id}")
|
128
|
+
else
|
129
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def account_cancel_order(order_id)
|
134
|
+
if @account_accessible
|
135
|
+
self.get("account/order/#{order_id}/cancel")
|
136
|
+
else
|
137
|
+
return{:error => ACCOUNT_INACCESSIBLE_ERROR}
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
## Reserves API
|
142
|
+
|
143
|
+
def excoin_wallets_summary(coin = nil)
|
144
|
+
unless coin
|
145
|
+
self.get("wallets/summary")
|
146
|
+
else
|
147
|
+
self.get("wallet/#{coin}")
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def excoin_wallet_reserves(coin)
|
152
|
+
self.get("wallet/#{coin}/reserves")
|
153
|
+
end
|
154
|
+
|
155
|
+
|
156
|
+
protected
|
157
|
+
|
158
|
+
def get(relative_url)
|
159
|
+
if @api_replay_strategy.nil?
|
160
|
+
return{:error => NO_REPLAY_STRATEGY}
|
161
|
+
elsif @api_replay_strategy_parameter.nil?
|
162
|
+
return{:error => NO_REPLAY_STRATEGY_PARAM}
|
163
|
+
end
|
164
|
+
if @api_replay_strategy == "nonce"
|
165
|
+
uri = URI.parse(EXCOIN_API_BASE_URL + relative_url)
|
166
|
+
http = Net::HTTP.new(uri.host, 443)
|
167
|
+
http.use_ssl = true
|
168
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
169
|
+
nonce = (Time.now.to_f * @api_replay_strategy_parameter).to_i
|
170
|
+
message = nonce.to_s + uri.to_s
|
171
|
+
signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @api_secret, message)
|
172
|
+
request.initialize_http_header({"api-key" => @api_key})
|
173
|
+
request.add_field("api-signature", signature)
|
174
|
+
request.add_field("api-nonce", nonce)
|
175
|
+
elsif @api_replay_strategy == "expire"
|
176
|
+
expire = Time.now.utc.to_i + @api_replay_strategy_parameter
|
177
|
+
uri = URI.parse(EXCOIN_API_BASE_URL + relative_url + "?expire=" + expire.to_s)
|
178
|
+
http = Net::HTTP.new(uri.host, 443)
|
179
|
+
http.use_ssl = true
|
180
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
181
|
+
message = uri.to_s
|
182
|
+
signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @api_secret, message)
|
183
|
+
request.add_field("api-key", @api_key)
|
184
|
+
request.add_field("api-signature", signature)
|
185
|
+
end
|
186
|
+
|
187
|
+
begin
|
188
|
+
response = http.request(request)
|
189
|
+
rescue
|
190
|
+
return{:error => CONNECTION_REFUSED}
|
191
|
+
end
|
192
|
+
|
193
|
+
begin
|
194
|
+
response_body = JSON.parse(response.body)
|
195
|
+
rescue
|
196
|
+
response_body = response.message
|
197
|
+
end
|
198
|
+
|
199
|
+
if response.code == "200"
|
200
|
+
return response_body
|
201
|
+
elsif response.code == "401"
|
202
|
+
error = response_body['error']
|
203
|
+
return {:status => response.code, :error => error}
|
204
|
+
elsif response.code == "400"
|
205
|
+
error = response_body['error']
|
206
|
+
return {:status => response.code, :error => error}
|
207
|
+
else
|
208
|
+
return {:status => response.code, :error => response_body}
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.exco.in/v1/account/order/<%= order_id %>/cancel?expire=1417294490
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Api-Key:
|
17
|
+
- 4Tas39EdsfAZ2rOFFY345wvIOMcD1IjLNdo9fudQfUdd
|
18
|
+
Api-Signature:
|
19
|
+
- 83eb44be9a79dae20c509682b00197b5a12fee041376b7bdcc6c922b71da801d
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Sat, 29 Nov 2014 20:44:50 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
X-Frame-Options:
|
40
|
+
- SAMEORIGIN
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Content-Type-Options:
|
44
|
+
- nosniff
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- 6d3169b8-316a-401c-b423-fced07f2929b
|
49
|
+
X-Runtime:
|
50
|
+
- '0.108582'
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=31536000; includeSubdomains;
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"id":"<%= order_id %>","timestamp":"2014-11-29
|
56
|
+
20:44:49 UTC","type":"BID","price":"0.00007250","commodity_amount":"451.53903448","currency_amount":"0.03273658","status":"CLOSED","trades":[]}'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Sat, 29 Nov 2014 20:44:50 GMT
|
59
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.exco.in/v1/account/orders/issue/<%= $currency %>/<%= $commodity %>/<%= $type %>/<%= $amount %>/<%= $price %>?expire=1417294489
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Api-Key:
|
17
|
+
- 4Tas39EdsfAZ2rOFFY345wvIOMcD1IjLNdo9fudQfUdd
|
18
|
+
Api-Signature:
|
19
|
+
- 6bd2e0b89206f0207682bf158d3d6731642c44052afafeff20b29c208df991ad
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Sat, 29 Nov 2014 20:44:49 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
X-Frame-Options:
|
40
|
+
- SAMEORIGIN
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Content-Type-Options:
|
44
|
+
- nosniff
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- bb6034e5-288e-4f1b-97ce-59f827927887
|
49
|
+
X-Runtime:
|
50
|
+
- '0.085639'
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=31536000; includeSubdomains;
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"id":"BTC-BLK-BID-Ot2EUeBHPUJYJbAd4V1lKd","timestamp":"2014-11-29
|
56
|
+
20:44:49 UTC","type":"<%= $type %>","price":"<%= $price %>","commodity_amount":"451","currency_amount":"<%= $amount %>","status":"OPEN"}'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Sat, 29 Nov 2014 20:44:49 GMT
|
59
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.exco.in/v1/account/order/<%= order_id %>?expire=1417294489
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Api-Key:
|
17
|
+
- 4Tas39EdsfAZ2rOFFY345wvIOMcD1IjLNdo9fudQfUdd
|
18
|
+
Api-Signature:
|
19
|
+
- b541e3b8b9814b8b38898cf342e07417ba00f4003be8824459ee6346f1e7308b
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Sat, 29 Nov 2014 20:44:50 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
X-Frame-Options:
|
40
|
+
- SAMEORIGIN
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Content-Type-Options:
|
44
|
+
- nosniff
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- 851e4eb9-b7e8-4204-be0a-444db27665d4
|
49
|
+
X-Runtime:
|
50
|
+
- '0.037266'
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=31536000; includeSubdomains;
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"id":"<%= order_id %>","timestamp":"2014-11-29
|
56
|
+
20:44:49 UTC","type":"BID","price":"0.00007250","commodity_amount":"451.53903448","currency_amount":"0.03273658","status":"OPEN","trades":[]}'
|
57
|
+
http_version:
|
58
|
+
recorded_at: Sat, 29 Nov 2014 20:44:50 GMT
|
59
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,157 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.exco.in/v1/exchange/BTC/BLK/trades/100?expire=1417128695
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
Api-Key:
|
17
|
+
- 4Tas39EdsfAZ2rOFFY345wvIOMcD1IjLNdo9fudQfUdd
|
18
|
+
Api-Signature:
|
19
|
+
- 4fc14a32237b81abcb5f4ebfdbb763a2a42e721eb48422e50d4cdb2518510626
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Thu, 27 Nov 2014 22:41:36 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Vary:
|
36
|
+
- Accept-Encoding
|
37
|
+
Status:
|
38
|
+
- 200 OK
|
39
|
+
X-Frame-Options:
|
40
|
+
- SAMEORIGIN
|
41
|
+
X-Xss-Protection:
|
42
|
+
- 1; mode=block
|
43
|
+
X-Content-Type-Options:
|
44
|
+
- nosniff
|
45
|
+
Cache-Control:
|
46
|
+
- max-age=0, private, must-revalidate
|
47
|
+
X-Request-Id:
|
48
|
+
- 32aae149-c364-4c40-a223-5d6480f20033
|
49
|
+
X-Runtime:
|
50
|
+
- '0.093592'
|
51
|
+
Strict-Transport-Security:
|
52
|
+
- max-age=31536000; includeSubdomains;
|
53
|
+
body:
|
54
|
+
encoding: UTF-8
|
55
|
+
string: '{"count":100,"trades":[{"timestamp":"2014-11-27 21:57:16 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007428","commodity_amount":"16.87690832","currency_amount":"0.00125362"},{"timestamp":"2014-11-27
|
56
|
+
21:20:51 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007421","commodity_amount":"21.76730000","currency_amount":"0.00161535"},{"timestamp":"2014-11-27
|
57
|
+
21:05:27 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"138.57778132","currency_amount":"0.01046262"},{"timestamp":"2014-11-27
|
58
|
+
20:53:33 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"21.01492033","currency_amount":"0.00158663"},{"timestamp":"2014-11-27
|
59
|
+
20:49:57 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007540","commodity_amount":"1497.75000000","currency_amount":"0.11293035"},{"timestamp":"2014-11-27
|
60
|
+
20:49:45 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007540","commodity_amount":"37.28215044","currency_amount":"0.00281108"},{"timestamp":"2014-11-27
|
61
|
+
20:49:41 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007530","commodity_amount":"998.50000000","currency_amount":"0.07518705"},{"timestamp":"2014-11-27
|
62
|
+
20:48:51 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"199.70000000","currency_amount":"0.01437840"},{"timestamp":"2014-11-27
|
63
|
+
20:29:38 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"3994.00000000","currency_amount":"0.28756800"},{"timestamp":"2014-11-27
|
64
|
+
20:26:12 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"2496.25000000","currency_amount":"0.17973000"},{"timestamp":"2014-11-27
|
65
|
+
20:25:13 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"3994.00000000","currency_amount":"0.28756800"},{"timestamp":"2014-11-27
|
66
|
+
20:24:43 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"2.99550000","currency_amount":"0.00021568"},{"timestamp":"2014-11-27
|
67
|
+
20:23:58 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"3.99400000","currency_amount":"0.00028757"},{"timestamp":"2014-11-27
|
68
|
+
20:22:58 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"41.93700000","currency_amount":"0.00301946"},{"timestamp":"2014-11-27
|
69
|
+
20:22:40 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"2.99550000","currency_amount":"0.00021568"},{"timestamp":"2014-11-27
|
70
|
+
20:19:42 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
71
|
+
20:16:17 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007429","commodity_amount":"148.77650000","currency_amount":"0.01105261"},{"timestamp":"2014-11-27
|
72
|
+
20:06:28 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007427","commodity_amount":"69.60339551","currency_amount":"0.00516944"},{"timestamp":"2014-11-27
|
73
|
+
19:58:07 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"499.25000000","currency_amount":"0.03594600"},{"timestamp":"2014-11-27
|
74
|
+
19:45:49 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
75
|
+
19:32:24 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
76
|
+
19:31:50 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
77
|
+
19:31:32 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
78
|
+
19:26:57 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"1.99700000","currency_amount":"0.00014378"},{"timestamp":"2014-11-27
|
79
|
+
19:16:45 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"4.99250000","currency_amount":"0.00035946"},{"timestamp":"2014-11-27
|
80
|
+
19:15:56 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"4.99250000","currency_amount":"0.00035946"},{"timestamp":"2014-11-27
|
81
|
+
19:11:43 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"9.98500000","currency_amount":"0.00071892"},{"timestamp":"2014-11-27
|
82
|
+
18:58:43 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007429","commodity_amount":"128.50690968","currency_amount":"0.00954678"},{"timestamp":"2014-11-27
|
83
|
+
18:53:13 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"9.98500000","currency_amount":"0.00071892"},{"timestamp":"2014-11-27
|
84
|
+
18:49:42 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"24.96250000","currency_amount":"0.00179730"},{"timestamp":"2014-11-27
|
85
|
+
18:48:42 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007200","commodity_amount":"24.96250000","currency_amount":"0.00179730"},{"timestamp":"2014-11-27
|
86
|
+
18:47:49 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"58.16533616","currency_amount":"0.00439148"},{"timestamp":"2014-11-27
|
87
|
+
18:31:35 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"57.85309000","currency_amount":"0.00429444"},{"timestamp":"2014-11-27
|
88
|
+
18:09:48 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007335","commodity_amount":"9625.85159734","currency_amount":"0.70605621"},{"timestamp":"2014-11-27
|
89
|
+
18:09:48 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007388","commodity_amount":"1749.14197198","currency_amount":"0.12922661"},{"timestamp":"2014-11-27
|
90
|
+
18:09:47 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007388","commodity_amount":"4108.71262115","currency_amount":"0.30355169"},{"timestamp":"2014-11-27
|
91
|
+
18:09:47 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007390","commodity_amount":"4053.45060893","currency_amount":"0.29955000"},{"timestamp":"2014-11-27
|
92
|
+
18:09:47 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007399","commodity_amount":"2389.90280004","currency_amount":"0.17682891"},{"timestamp":"2014-11-27
|
93
|
+
18:09:46 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007399","commodity_amount":"3035.44040485","currency_amount":"0.22459224"},{"timestamp":"2014-11-27
|
94
|
+
18:04:15 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007399","commodity_amount":"221.66700000","currency_amount":"0.01640114"},{"timestamp":"2014-11-27
|
95
|
+
17:50:38 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007421","commodity_amount":"5.99100000","currency_amount":"0.00044459"},{"timestamp":"2014-11-27
|
96
|
+
17:50:34 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"62.01097959","currency_amount":"0.00460308"},{"timestamp":"2014-11-27
|
97
|
+
17:35:11 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"249.62500000","currency_amount":"0.01884669"},{"timestamp":"2014-11-27
|
98
|
+
17:34:49 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"249.62500000","currency_amount":"0.01884669"},{"timestamp":"2014-11-27
|
99
|
+
17:34:21 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"4.95203099","currency_amount":"0.00037388"},{"timestamp":"2014-11-27
|
100
|
+
17:34:15 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"65.53000943","currency_amount":"0.00486429"},{"timestamp":"2014-11-27
|
101
|
+
17:34:02 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"44.06407127","currency_amount":"0.00330481"},{"timestamp":"2014-11-27
|
102
|
+
17:33:41 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"4.99250000","currency_amount":"0.00037444"},{"timestamp":"2014-11-27
|
103
|
+
17:32:55 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"353.00069689","currency_amount":"0.02665155"},{"timestamp":"2014-11-27
|
104
|
+
17:32:16 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"33.94900000","currency_amount":"0.00254617"},{"timestamp":"2014-11-27
|
105
|
+
17:31:59 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"45.94511213","currency_amount":"0.00344588"},{"timestamp":"2014-11-27
|
106
|
+
17:30:40 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"7.87642714","currency_amount":"0.00059073"},{"timestamp":"2014-11-27
|
107
|
+
17:30:19 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"63.31376086","currency_amount":"0.00478019"},{"timestamp":"2014-11-27
|
108
|
+
17:07:45 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"25.59656744","currency_amount":"0.00192230"},{"timestamp":"2014-11-27
|
109
|
+
16:26:37 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"37.94300000","currency_amount":"0.00286470"},{"timestamp":"2014-11-27
|
110
|
+
16:20:16 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"9.98500000","currency_amount":"0.00075387"},{"timestamp":"2014-11-27
|
111
|
+
16:16:49 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"62.01094385","currency_amount":"0.00465702"},{"timestamp":"2014-11-27
|
112
|
+
15:37:06 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"0.73994801","currency_amount":"0.00005587"},{"timestamp":"2014-11-27
|
113
|
+
15:36:12 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"0.74495279","currency_amount":"0.00005595"},{"timestamp":"2014-11-27
|
114
|
+
15:32:56 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"128.26850026","currency_amount":"0.00968427"},{"timestamp":"2014-11-27
|
115
|
+
15:24:12 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"204.69250000","currency_amount":"0.01545428"},{"timestamp":"2014-11-27
|
116
|
+
15:22:41 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"90.21785639","currency_amount":"0.00677536"},{"timestamp":"2014-11-27
|
117
|
+
15:11:06 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"22.89636285","currency_amount":"0.00171952"},{"timestamp":"2014-11-27
|
118
|
+
15:09:04 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007510","commodity_amount":"48.15827989","currency_amount":"0.00361669"},{"timestamp":"2014-11-27
|
119
|
+
14:41:35 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"5.99100000","currency_amount":"0.00044932"},{"timestamp":"2014-11-27
|
120
|
+
14:33:04 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007592","commodity_amount":"187.51830000","currency_amount":"0.01423639"},{"timestamp":"2014-11-27
|
121
|
+
13:27:18 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007596","commodity_amount":"30.95350000","currency_amount":"0.00235123"},{"timestamp":"2014-11-27
|
122
|
+
12:20:45 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"65.53005725","currency_amount":"0.00491476"},{"timestamp":"2014-11-27
|
123
|
+
10:51:20 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007500","commodity_amount":"199.70000000","currency_amount":"0.01497750"},{"timestamp":"2014-11-27
|
124
|
+
10:50:13 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007399","commodity_amount":"413.55646013","currency_amount":"0.03059904"},{"timestamp":"2014-11-27
|
125
|
+
08:41:21 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007596","commodity_amount":"32.75976494","currency_amount":"0.00248843"},{"timestamp":"2014-11-27
|
126
|
+
08:24:37 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007410","commodity_amount":"232.57274905","currency_amount":"0.01723364"},{"timestamp":"2014-11-27
|
127
|
+
08:24:29 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007411","commodity_amount":"223.05568432","currency_amount":"0.01653066"},{"timestamp":"2014-11-27
|
128
|
+
08:24:25 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007419","commodity_amount":"66.89950000","currency_amount":"0.00496327"},{"timestamp":"2014-11-27
|
129
|
+
08:24:16 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007420","commodity_amount":"137.33815768","currency_amount":"0.01019049"},{"timestamp":"2014-11-27
|
130
|
+
08:24:00 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007598","commodity_amount":"109.23587372","currency_amount":"0.00829974"},{"timestamp":"2014-11-27
|
131
|
+
08:23:51 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007599","commodity_amount":"109.19784689","currency_amount":"0.00829794"},{"timestamp":"2014-11-27
|
132
|
+
08:03:59 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007600","commodity_amount":"1.99700000","currency_amount":"0.00015177"},{"timestamp":"2014-11-27
|
133
|
+
07:28:01 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007599","commodity_amount":"109.23590000","currency_amount":"0.00830084"},{"timestamp":"2014-11-27
|
134
|
+
02:41:07 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007428","commodity_amount":"77.01515994","currency_amount":"0.00572069"},{"timestamp":"2014-11-27
|
135
|
+
02:34:08 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"64.40325000","currency_amount":"0.00478066"},{"timestamp":"2014-11-27
|
136
|
+
01:42:27 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007428","commodity_amount":"57.51360000","currency_amount":"0.00427211"},{"timestamp":"2014-11-27
|
137
|
+
00:21:54 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007429","commodity_amount":"115.76605505","currency_amount":"0.00860026"},{"timestamp":"2014-11-27
|
138
|
+
00:21:21 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007597","commodity_amount":"150.67361057","currency_amount":"0.01144667"},{"timestamp":"2014-11-27
|
139
|
+
00:11:10 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007420","commodity_amount":"66.89950000","currency_amount":"0.00496394"},{"timestamp":"2014-11-26
|
140
|
+
22:25:51 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007600","commodity_amount":"428.35650000","currency_amount":"0.03255509"},{"timestamp":"2014-11-26
|
141
|
+
22:04:27 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007575","commodity_amount":"10.73384205","currency_amount":"0.00081309"},{"timestamp":"2014-11-26
|
142
|
+
21:20:29 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007418","commodity_amount":"246.89480145","currency_amount":"0.01831466"},{"timestamp":"2014-11-26
|
143
|
+
20:40:51 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007600","commodity_amount":"6.80228125","currency_amount":"0.00051697"},{"timestamp":"2014-11-26
|
144
|
+
20:03:11 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007600","commodity_amount":"8880.67673652","currency_amount":"0.67493143"},{"timestamp":"2014-11-26
|
145
|
+
20:03:10 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007600","commodity_amount":"199.70000000","currency_amount":"0.01517720"},{"timestamp":"2014-11-26
|
146
|
+
19:48:15 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007596","commodity_amount":"0.19967371","currency_amount":"0.00001517"},{"timestamp":"2014-11-26
|
147
|
+
19:47:51 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007597","commodity_amount":"246.62950000","currency_amount":"0.01873644"},{"timestamp":"2014-11-26
|
148
|
+
19:28:15 UTC","currency":"BTC","commodity":"BLK","type":"BUY","price":"0.00007550","commodity_amount":"1448.42103005","currency_amount":"0.10935579"},{"timestamp":"2014-11-26
|
149
|
+
17:36:34 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007410","commodity_amount":"299.10478489","currency_amount":"0.02216366"},{"timestamp":"2014-11-26
|
150
|
+
17:36:33 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007420","commodity_amount":"9.98500000","currency_amount":"0.00074089"},{"timestamp":"2014-11-26
|
151
|
+
17:36:32 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007421","commodity_amount":"9.98365449","currency_amount":"0.00074089"},{"timestamp":"2014-11-26
|
152
|
+
17:36:32 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007422","commodity_amount":"9.86028840","currency_amount":"0.00073183"},{"timestamp":"2014-11-26
|
153
|
+
17:36:32 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"8.76455132","currency_amount":"0.00065059"},{"timestamp":"2014-11-26
|
154
|
+
17:36:32 UTC","currency":"BTC","commodity":"BLK","type":"SELL","price":"0.00007423","commodity_amount":"9.64212293","currency_amount":"0.00071573"}]}'
|
155
|
+
http_version:
|
156
|
+
recorded_at: Thu, 27 Nov 2014 22:41:36 GMT
|
157
|
+
recorded_with: VCR 2.9.3
|