From 48ae4b8c3695d803e6ef7b1906eedbfca93dafaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Thu, 10 Oct 2024 14:33:00 +0700 Subject: [PATCH] fix env in api --- pages/api/daoProgramStatistics.api.ts | 6 +++--- pages/api/daoStatistics.api.ts | 6 +++--- pages/api/daoVoteStatistics.api.ts | 6 +++--- pages/api/daoVoteUserStatistics.api.ts | 6 +++--- pages/api/getDecodedMangoInstructionsFromProposal.api.ts | 6 +++--- pages/api/mangoAccountsWithDeposit.api.ts | 6 +++--- pages/api/vsrDeposits.api.ts | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pages/api/daoProgramStatistics.api.ts b/pages/api/daoProgramStatistics.api.ts index 9255c1b00b..09e203784d 100644 --- a/pages/api/daoProgramStatistics.api.ts +++ b/pages/api/daoProgramStatistics.api.ts @@ -6,9 +6,9 @@ import { getAllSplGovernanceProgramIds } from './tools/realms' import { withSentry } from '@sentry/nextjs' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') console.log('fetching spl-gov instances...') // Get all realms diff --git a/pages/api/daoStatistics.api.ts b/pages/api/daoStatistics.api.ts index dc59aa37e8..a64e45290b 100644 --- a/pages/api/daoStatistics.api.ts +++ b/pages/api/daoStatistics.api.ts @@ -59,9 +59,9 @@ async function getGovernances( } const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') console.log('fetching spl-gov instances...') // Get all realms diff --git a/pages/api/daoVoteStatistics.api.ts b/pages/api/daoVoteStatistics.api.ts index 69d47ce78f..e6170328ee 100644 --- a/pages/api/daoVoteStatistics.api.ts +++ b/pages/api/daoVoteStatistics.api.ts @@ -12,9 +12,9 @@ import { NextApiRequest, NextApiResponse } from 'next' import { getAllSplGovernanceProgramIds } from './tools/realms' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') console.log('fetching spl-gov instances...') // Get all realms diff --git a/pages/api/daoVoteUserStatistics.api.ts b/pages/api/daoVoteUserStatistics.api.ts index b246b3a693..a6de475282 100644 --- a/pages/api/daoVoteUserStatistics.api.ts +++ b/pages/api/daoVoteUserStatistics.api.ts @@ -19,9 +19,9 @@ import { NextApiRequest, NextApiResponse } from 'next' import mainnetList from 'public/realms/mainnet-beta.json' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') const { dao, user } = req.query if (!dao) { diff --git a/pages/api/getDecodedMangoInstructionsFromProposal.api.ts b/pages/api/getDecodedMangoInstructionsFromProposal.api.ts index 57ad397462..464a1951e3 100644 --- a/pages/api/getDecodedMangoInstructionsFromProposal.api.ts +++ b/pages/api/getDecodedMangoInstructionsFromProposal.api.ts @@ -14,9 +14,9 @@ import { getClient } from '@utils/mangoV4Tools' import { BN, BorshInstructionCoder } from '@coral-xyz/anchor' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') const proposalPk = req.query.proposal if (!proposalPk) { diff --git a/pages/api/mangoAccountsWithDeposit.api.ts b/pages/api/mangoAccountsWithDeposit.api.ts index ccaa79af8d..016092f58a 100644 --- a/pages/api/mangoAccountsWithDeposit.api.ts +++ b/pages/api/mangoAccountsWithDeposit.api.ts @@ -12,9 +12,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { if (!mint) { return res.status(403).json('Please provide mint param') } - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') const MAINNET_GROUP = new PublicKey( '78b8f4cGCwmZ9ysPFMWLaLTkkaYnUjwMJYStWe5RTSSX' ) diff --git a/pages/api/vsrDeposits.api.ts b/pages/api/vsrDeposits.api.ts index 4c88d867ba..72b563c21c 100644 --- a/pages/api/vsrDeposits.api.ts +++ b/pages/api/vsrDeposits.api.ts @@ -8,9 +8,9 @@ import { toUiDecimals } from '@blockworks-foundation/mango-v4' import { VsrClient } from 'VoteStakeRegistry/sdk/client' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (!process.env.BACKEND_MAINNET_RPC) - return res.status(500).json('BACKEND_MAINNET_RPC not provided in env') - const conn = new Connection(process.env.BACKEND_MAINNET_RPC, 'recent') + if (!process.env.MAINNET_RPC) + return res.status(500).json('MAINNET_RPC not provided in env') + const conn = new Connection(process.env.MAINNET_RPC, 'recent') const options = AnchorProvider.defaultOptions() const adminProvider = new AnchorProvider(