Skip to content

Commit

Permalink
getPrices is able to get the prices with the correct configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitardanailov committed May 27, 2024
1 parent 6844b57 commit 31eab91
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/website/src/app/demos/dashboard-trade/utils/getPrices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ function getPrices(setPrices: unknown) {
const domain = process.env.NEXT_PUBLIC_COINGECKO_DOMAIN
const key = process.env.NEXT_PUBLIC_COINGECKO_API_KEY

const url = `${domain}/simple/price`

const coingeckoIds = ['bitcoin,chainlink,cosmos,solana']

const options = {
method: 'GET',
url: `${domain}/simple/price?ids=bitcoin&vs_currencies=usd`,
url,
params: {
ids: coingeckoIds.join(','),
vs_currencies: 'btc,usd,eth',
include_24hr_change: true,
include_7d_change: true,
include_last_updated_at: true,
},
headers: {
accept: 'application/json',
'x-cg-demo-api-key': key,
Expand All @@ -16,7 +27,7 @@ function getPrices(setPrices: unknown) {
axios
.request(options)
.then(function (response) {
console.log('prices ...', response.data)
console.log('prices ......', response.data)
})
.catch(function (error) {
console.error('prices ...', error)
Expand Down

0 comments on commit 31eab91

Please sign in to comment.