undo april fools
This commit is contained in:
parent
9cbc895e29
commit
d08d593f69
@ -11,14 +11,13 @@ async function getPrice (fiat) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = `https://api.coinbase.com/v2/prices/BTC-${fiat}/spot`
|
const url = `https://api.coinbase.com/v2/prices/BTC-${fiat}/spot`
|
||||||
let price = await fetch(url)
|
const price = await fetch(url)
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((body) => parseFloat(body.data.amount))
|
.then((body) => parseFloat(body.data.amount))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
return -1
|
return -1
|
||||||
})
|
})
|
||||||
price *= 34
|
|
||||||
cache.set(fiat, { price, createdAt: Date.now() })
|
cache.set(fiat, { price, createdAt: Date.now() })
|
||||||
return price
|
return price
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user