april fools

This commit is contained in:
keyan 2023-04-01 16:59:37 -05:00
parent e4a3095cb4
commit 9cbc895e29
1 changed files with 2 additions and 1 deletions

View File

@ -11,13 +11,14 @@ async function getPrice (fiat) {
}
}
const url = `https://api.coinbase.com/v2/prices/BTC-${fiat}/spot`
const price = await fetch(url)
let price = await fetch(url)
.then((res) => res.json())
.then((body) => parseFloat(body.data.amount))
.catch((err) => {
console.error(err)
return -1
})
price *= 34
cache.set(fiat, { price, createdAt: Date.now() })
return price
}