Skip to content

Commit

Permalink
fix env in api (solana-labs#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Oct 10, 2024
1 parent 23aecf9 commit b3d2df6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions pages/api/daoProgramStatistics.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pages/api/daoStatistics.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pages/api/daoVoteStatistics.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pages/api/daoVoteUserStatistics.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pages/api/getDecodedMangoInstructionsFromProposal.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pages/api/mangoAccountsWithDeposit.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down
6 changes: 3 additions & 3 deletions pages/api/vsrDeposits.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b3d2df6

Please sign in to comment.