Skip to content

Commit

Permalink
Merge pull request #237 from ilovespectra/dev
Browse files Browse the repository at this point in the history
Update price.ts
  • Loading branch information
0xIchigo authored Dec 1, 2023
2 parents b8fefdb + 66d065d commit 425f54e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib/trpc/routes/price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ import { t } from "$lib/trpc/t";
export const price = t.procedure
.input(z.string())
.query(async ({ input: token }) => {
const apiKey = import.meta.env.VITE_BIRDEYE_API_KEY;
const response = await fetch(
`https://public-api.birdeye.so/public/price/?address=${token}`
`https://public-api.birdeye.so/public/price/?address=${token}`,
{
headers: {
Accept: "application/json",
"X-API-KEY": apiKey,
"x-chain": "solana",
},
}
);

const json = await response.json();
Expand Down

0 comments on commit 425f54e

Please sign in to comment.