From d27ced851e721d3afe256d667e8eefcd67e23b51 Mon Sep 17 00:00:00 2001 From: tjs Date: Wed, 11 Jan 2023 13:27:35 -0500 Subject: [PATCH] use new birdeye key --- apis/birdeye/helpers.ts | 5 +++-- apis/birdeye/streaming.ts | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apis/birdeye/helpers.ts b/apis/birdeye/helpers.ts index 85936c7f..425964e7 100644 --- a/apis/birdeye/helpers.ts +++ b/apis/birdeye/helpers.ts @@ -1,4 +1,5 @@ -export const BE_API_KEY = +export const NEXT_PUBLIC_BIRDEYE_API_KEY = + process.env.NEXT_PUBLIC_BIRDEYE_API_KEY || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2Njc1NTI4MzV9.FpbBT3M6GN_TKSJ8CarGeOMU5U7ZUvgZOIy8789m1bk' export const API_URL = 'https://public-api.birdeye.so/' @@ -8,7 +9,7 @@ export async function makeApiRequest(path: string) { try { const response = await fetch(`${API_URL}${path}`, { headers: { - 'X-API-KEY': BE_API_KEY, + 'X-API-KEY': NEXT_PUBLIC_BIRDEYE_API_KEY, }, }) return response.json() diff --git a/apis/birdeye/streaming.ts b/apis/birdeye/streaming.ts index 9ca3460d..33970739 100644 --- a/apis/birdeye/streaming.ts +++ b/apis/birdeye/streaming.ts @@ -1,13 +1,14 @@ -import { parseResolution, getNextBarTime } from './helpers' - -const BE_API_KEY = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2Njc1NTI4MzV9.FpbBT3M6GN_TKSJ8CarGeOMU5U7ZUvgZOIy8789m1bk' +import { + parseResolution, + getNextBarTime, + NEXT_PUBLIC_BIRDEYE_API_KEY, +} from './helpers' let subscriptionItem: any = {} // Create WebSocket connection. const socket = new WebSocket( - `wss://public-api.birdeye.so/socket?x-api-key=${BE_API_KEY}`, + `wss://public-api.birdeye.so/socket?x-api-key=${NEXT_PUBLIC_BIRDEYE_API_KEY}`, 'echo-protocol' )