Skip to content

Commit

Permalink
Merge pull request #2 from tohjustin/v1.0.1-development
Browse files Browse the repository at this point in the history
1.0.1
  • Loading branch information
tohjustin committed Dec 26, 2017
2 parents 75f7c8a + 5a7b159 commit 8a4707a
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 23 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "coincharts",
"version": "1.0.0",
"description": "Cyptocurrency price chart, powered by Coinbase",
"version": "1.0.1",
"description": "Cryptocurrency price chart, powered by Coinbase",
"license": "MIT",
"scripts": {
"build": "react-scripts build && rm build/static/**/*.map",
Expand Down
2 changes: 1 addition & 1 deletion public/priceData/btc-usd_all.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/btc-usd_day.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/btc-usd_hour.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/btc-usd_month.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/btc-usd_week.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/btc-usd_year.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_all.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_day.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_hour.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_month.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_week.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/eth-usd_year.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_all.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_day.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_hour.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_month.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_week.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/ltc-usd_year.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/priceData/usd_spot.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"data":[{"base":"BTC","currency":"USD","amount":"4028.23"},{"base":"ETH","currency":"USD","amount":"284.71"},{"base":"LTC","currency":"USD","amount":"63.47"}],"warnings":[{"id":"missing_version","message":"Please supply API version (YYYY-MM-DD) as CB-VERSION header","url":"https://developers.coinbase.com/api#versioning"}]}
{"data":[{"base":"BTC","currency":"USD","amount":"16073.00"},{"base":"BCH","currency":"USD","amount":"2853.00"},{"base":"ETH","currency":"USD","amount":"749.01"},{"base":"LTC","currency":"USD","amount":"283.61"}],"warnings":[{"id":"missing_version","message":"Please supply API version (YYYY-MM-DD) as CB-VERSION header","url":"https://developers.coinbase.com/api#versioning"}]}
2 changes: 1 addition & 1 deletion scripts/updatePriceData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ curl https://www.coinbase.com/api/v2/prices/LTC-USD/historic\?period\=week > "$D
curl https://www.coinbase.com/api/v2/prices/LTC-USD/historic\?period\=day > "$DATA_DIR/ltc-usd_day.json"
curl https://www.coinbase.com/api/v2/prices/LTC-USD/historic\?period\=hour > "$DATA_DIR/ltc-usd_hour.json"

# Spot Prices (BTC, ETH, LTC)
# Spot Prices (BTC, BCH, ETH, LTC)
curl https://www.coinbase.com/api/v2/prices/USD/spot? > "$DATA_DIR/usd_spot.json"
4 changes: 3 additions & 1 deletion src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ function fetchSpotPrices(currency) {
axios.get(url)
.then((response) => {
const spotPrices = get(response, ['data', 'data'], []);
const formattedSpotPrices = spotPrices.map(e => ({ ...e, amount: +e.amount }));
const formattedSpotPrices = spotPrices
.filter(e => ['BTC', 'ETH', 'LTC'].indexOf(e.base) >= 0)
.map(e => ({ ...e, amount: +e.amount }));
resolve(formattedSpotPrices);
})
.catch(err => reject(err));
Expand Down

0 comments on commit 8a4707a

Please sign in to comment.