april fools
This commit is contained in:
parent
e4a3095cb4
commit
9cbc895e29
@ -11,13 +11,14 @@ 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`
|
||||||
const price = await fetch(url)
|
let 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