currency-rate 0.3.9 → 0.4.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8d1d28a5dc8b5bd2fc9630c031e0c82a3762b0c
|
4
|
+
data.tar.gz: 8277f86ef10630c3120640798fe1537591383e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5daf71d517b475883ee70fd679c777e42e799162812b5cc0148ad41f3f24886387aabe2c415735b25854cf625c6511a48f93f0ebc0701104bd692041bf6d4ef
|
7
|
+
data.tar.gz: 4a0c63d528df7138a1db9b576e084a8a324d31cd023d5996082bd6b424faa550c820c315153f667d694fe34f787bfafccc56978fb750be7644ccf037cb45c158
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
@@ -4,10 +4,12 @@ module CurrencyRate
|
|
4
4
|
FETCH_URL = {
|
5
5
|
'btc_usd' => 'https://www.bitstamp.net/api/v2/ticker/btcusd/',
|
6
6
|
'btc_eur' => 'https://www.bitstamp.net/api/v2/ticker/btceur/',
|
7
|
+
'ltc_usd' => 'https://www.bitstamp.net/api/v2/ticker/ltcusd/',
|
8
|
+
'ltc_eur' => 'https://www.bitstamp.net/api/v2/ticker/ltceur/',
|
7
9
|
'eur_usd' => 'https://www.bitstamp.net/api/v2/ticker/eurusd/'
|
8
10
|
}
|
9
11
|
DEFAULT_CURRENCIES = ["USD", "BTC"]
|
10
|
-
SUPPORTED_CRYPTO_CURRENCIES = ["BTC"]
|
12
|
+
SUPPORTED_CRYPTO_CURRENCIES = ["BTC", "LTC"]
|
11
13
|
|
12
14
|
def rate_for(from,to)
|
13
15
|
super
|
@@ -118,6 +118,124 @@ http_interactions:
|
|
118
118
|
"946.00", "open": "940.01"}'
|
119
119
|
http_version:
|
120
120
|
recorded_at: Mon, 06 Feb 2017 05:24:36 GMT
|
121
|
+
- request:
|
122
|
+
method: get
|
123
|
+
uri: https://www.bitstamp.net/api/v2/ticker/ltcusd/
|
124
|
+
body:
|
125
|
+
encoding: US-ASCII
|
126
|
+
string: ''
|
127
|
+
headers:
|
128
|
+
Accept-Encoding:
|
129
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
130
|
+
Accept:
|
131
|
+
- "*/*"
|
132
|
+
User-Agent:
|
133
|
+
- Ruby
|
134
|
+
response:
|
135
|
+
status:
|
136
|
+
code: 200
|
137
|
+
message: OK
|
138
|
+
headers:
|
139
|
+
Accept-Ranges:
|
140
|
+
- bytes
|
141
|
+
Access-Control-Allow-Headers:
|
142
|
+
- x-requested-with, Content-Type, origin, accept, cache-control
|
143
|
+
Access-Control-Allow-Methods:
|
144
|
+
- POST, GET
|
145
|
+
Access-Control-Allow-Origin:
|
146
|
+
- "*"
|
147
|
+
Content-Type:
|
148
|
+
- application/json
|
149
|
+
Date:
|
150
|
+
- Mon, 06 Feb 2017 05:24:29 GMT
|
151
|
+
Etag:
|
152
|
+
- W/"61580-b8-547d5d87cce4a"
|
153
|
+
Last-Modified:
|
154
|
+
- Mon, 06 Feb 2017 05:24:29 GMT
|
155
|
+
Server:
|
156
|
+
- Apache
|
157
|
+
Strict-Transport-Security:
|
158
|
+
- max-age=63072000; includeSubDomains
|
159
|
+
Connection:
|
160
|
+
- keep-alive
|
161
|
+
Set-Cookie:
|
162
|
+
- incap_ses_526_99025=rZ+ZC6n/gWdhQVcebLpMB4wImFgAAAAAPzEv9wCFV+bROOkr9Wx0Sg==;
|
163
|
+
path=/; Domain=.bitstamp.net
|
164
|
+
- nlbi_99025=P24SAcIds0Uk1n6/8F1n9AAAAAAxZWPGGV+bIlBfqaL6Kc1J; path=/; Domain=.bitstamp.net
|
165
|
+
- visid_incap_99025=ODI6i9FxRBaKgUDHQdjhzYwImFgAAAAAQUIPAAAAAAC1HRMSoFGdC16PkB2u683N;
|
166
|
+
expires=Mon, 05 Feb 2018 09:10:53 GMT; path=/; Domain=.bitstamp.net
|
167
|
+
X-Iinfo:
|
168
|
+
- 3-13530015-13528068 2NNN RT(1486358667779 431) q(0 0 0 -1) r(4 4)
|
169
|
+
X-Cdn:
|
170
|
+
- Incapsula
|
171
|
+
Transfer-Encoding:
|
172
|
+
- chunked
|
173
|
+
body:
|
174
|
+
encoding: ASCII-8BIT
|
175
|
+
string: '{"high": "42.86", "last": "41.01", "timestamp": "1501173770", "bid":
|
176
|
+
"41.06", "vwap": "41.85", "volume": "19272.83690189", "low": "40.75",
|
177
|
+
"ask": "41.35", "open": "42.10"}'
|
178
|
+
http_version:
|
179
|
+
recorded_at: Mon, 06 Feb 2017 05:24:29 GMT
|
180
|
+
- request:
|
181
|
+
method: get
|
182
|
+
uri: https://www.bitstamp.net/api/v2/ticker/ltceur/
|
183
|
+
body:
|
184
|
+
encoding: US-ASCII
|
185
|
+
string: ''
|
186
|
+
headers:
|
187
|
+
Accept-Encoding:
|
188
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
189
|
+
Accept:
|
190
|
+
- "*/*"
|
191
|
+
User-Agent:
|
192
|
+
- Ruby
|
193
|
+
response:
|
194
|
+
status:
|
195
|
+
code: 200
|
196
|
+
message: OK
|
197
|
+
headers:
|
198
|
+
Accept-Ranges:
|
199
|
+
- bytes
|
200
|
+
Access-Control-Allow-Headers:
|
201
|
+
- x-requested-with, Content-Type, origin, accept, cache-control
|
202
|
+
Access-Control-Allow-Methods:
|
203
|
+
- POST, GET
|
204
|
+
Access-Control-Allow-Origin:
|
205
|
+
- "*"
|
206
|
+
Content-Type:
|
207
|
+
- application/json
|
208
|
+
Date:
|
209
|
+
- Mon, 06 Feb 2017 05:24:29 GMT
|
210
|
+
Etag:
|
211
|
+
- W/"61580-b8-547d5d87cce4a"
|
212
|
+
Last-Modified:
|
213
|
+
- Mon, 06 Feb 2017 05:24:29 GMT
|
214
|
+
Server:
|
215
|
+
- Apache
|
216
|
+
Strict-Transport-Security:
|
217
|
+
- max-age=63072000; includeSubDomains
|
218
|
+
Connection:
|
219
|
+
- keep-alive
|
220
|
+
Set-Cookie:
|
221
|
+
- incap_ses_526_99025=rZ+ZC6n/gWdhQVcebLpMB4wImFgAAAAAPzEv9wCFV+bROOkr9Wx0Sg==;
|
222
|
+
path=/; Domain=.bitstamp.net
|
223
|
+
- nlbi_99025=P24SAcIds0Uk1n6/8F1n9AAAAAAxZWPGGV+bIlBfqaL6Kc1J; path=/; Domain=.bitstamp.net
|
224
|
+
- visid_incap_99025=ODI6i9FxRBaKgUDHQdjhzYwImFgAAAAAQUIPAAAAAAC1HRMSoFGdC16PkB2u683N;
|
225
|
+
expires=Mon, 05 Feb 2018 09:10:53 GMT; path=/; Domain=.bitstamp.net
|
226
|
+
X-Iinfo:
|
227
|
+
- 3-13530015-13528068 2NNN RT(1486358667779 431) q(0 0 0 -1) r(4 4)
|
228
|
+
X-Cdn:
|
229
|
+
- Incapsula
|
230
|
+
Transfer-Encoding:
|
231
|
+
- chunked
|
232
|
+
body:
|
233
|
+
encoding: ASCII-8BIT
|
234
|
+
string: '{"high": "36.69", "last": "35.62", "timestamp": "1501173975", "bid":
|
235
|
+
"35.49", "vwap": "35.97", "volume": "2442.41279776", "low": "35.40",
|
236
|
+
"ask": "35.80", "open": "36.26"}'
|
237
|
+
http_version:
|
238
|
+
recorded_at: Mon, 06 Feb 2017 05:24:29 GMT
|
121
239
|
- request:
|
122
240
|
method: get
|
123
241
|
uri: https://www.bitstamp.net/api/v2/ticker/eurusd/
|
@@ -19,6 +19,10 @@ RSpec.describe CurrencyRate::BitstampAdapter do
|
|
19
19
|
expect(@exchange_adapter.rate_for('USD', 'BTC').to_f).to eq(0.00098312)
|
20
20
|
expect(@exchange_adapter.rate_for('BTC', 'EUR')).to eq(946.0)
|
21
21
|
expect(@exchange_adapter.rate_for('EUR', 'BTC').to_f).to eq(0.001057082)
|
22
|
+
expect(@exchange_adapter.rate_for('LTC', 'USD')).to eq(41.01)
|
23
|
+
expect(@exchange_adapter.rate_for('USD', 'LTC')).to eq(0.024384297)
|
24
|
+
expect(@exchange_adapter.rate_for('LTC', 'EUR')).to eq(35.62)
|
25
|
+
expect(@exchange_adapter.rate_for('EUR', 'LTC')).to eq(0.028074116)
|
22
26
|
expect(@exchange_adapter.rate_for('USD', 'EUR').to_f).to eq(0.933619643)
|
23
27
|
expect(@exchange_adapter.rate_for('EUR', 'USD')).to eq(1.0711)
|
24
28
|
expect( -> { @exchange_adapter.rate_for('FEDcoin', 'USD') }).to raise_error(CurrencyRate::Adapter::CurrencyNotSupported)
|