Skip to content

Commit

Permalink
removed birdeye api key exposure to the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
joeetwork committed Dec 6, 2023
1 parent 48acf78 commit 6ed698f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/trpc/routes/price.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ import { z } from "zod";

import { t } from "$lib/trpc/t";

import { VITE_BIRDEYE_API_KEY } from "$env/static/private";

export const price = t.procedure
.input(z.string())
.query(async ({ input: token }) => {
const apiKey = import.meta.env.BIRDEYE_API_KEY;
const response = await fetch(
`https://public-api.birdeye.so/public/price/?address=${token}`,
{
headers: {
Accept: "application/json",
"X-API-KEY": VITE_BIRDEYE_API_KEY,
"X-API-KEY": apiKey,
"x-chain": "solana",
},
}
Expand Down

0 comments on commit 6ed698f

Please sign in to comment.