Skip to content

Commit

Permalink
updating fetch key label
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtranmer committed Apr 16, 2024
1 parent 9db3833 commit aa59598
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/functions/displayConvertAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

import { possibleAssetsObj } from "../data/possibleAssets";


// CREATE and IMPORT NEW function to get DYNAMIC price data for each token based on timestamps
// NEW: USE Single pricing API call to get only a single price for each token.

Expand Down Expand Up @@ -99,9 +100,12 @@ const getPrice = async(url:any) => {

// console.log(url);
// CG_API_KEY
const CG_API_KEY_LABEL = 'x-cg-pro-api-key'; // this changed between demo and pro API

console.log("API Key Label: ", CG_API_KEY_LABEL);

let data = await fetch(url,
{method: 'GET', headers: {accept: 'application/json', 'x-cg-demo-api-key': "CG-jbXwiJ1kcdvbUK6hP6m8Rt1b"}}
{method: 'GET', headers: {accept: 'application/json', CG_API_KEY_LABEL: "CG-jbXwiJ1kcdvbUK6hP6m8Rt1b"}}
);
let dataJSON = await data.json();

Expand Down

0 comments on commit aa59598

Please sign in to comment.