Kategorie: NodeJS
-
EUR<->ETH Exchange Rates von Coinbase via API
let getExchangeRates = async () => { const filename = ‚exchangeRates.json‘ let result = null let exchangeRatesUrl = „https://api.coinbase.com/v1/currencies/exchange_rates“ try { const response = await axios.get(exchangeRatesUrl) result = response.data } catch (error) { console.error(error); throw new Error(error) } return result } Use it like this: const exchangeRates = await getExchangeRates() const eth_to_eur = exchangeRates.eth_to_eur const…