Skip to content

Commit

Permalink
remove all serverside apis
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Mar 18, 2024
1 parent c9396d1 commit a038975
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 5 deletions.
13 changes: 11 additions & 2 deletions frontend/integration/api.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { VersionedTransaction } from '@solana/web3.js'
import { NextApiRequest, NextApiResponse } from 'next'
import handlerFundTransaction from '../pages/api/grant/v1/fund_transaction'
//import handlerFundTransaction from '../pages/api/grant/v1/fund_transaction'
import {
getAmountAndProofRoute,
getFundTransactionRoute,
handleAmountAndProofResponse,
handleFundTransaction,
} from '../utils/api'
import { ClaimInfo, Ecosystem } from '../claim_sdk/claim'
import handlerAmountAndProof from '../pages/api/grant/v1/amount_and_proof'
//import handlerAmountAndProof from '../pages/api/grant/v1/amount_and_proof'


function handlerFundTransaction(...args: any[]) {
throw new Error('Function not implemented.')
}

function handlerAmountAndProof(...args: any[]) {
throw new Error('Function not implemented.')
}

export class NextApiResponseMock {
public jsonBody: any
Expand Down
4 changes: 2 additions & 2 deletions frontend/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export function middleware(req) {
`

// NextResponse object does not have a body property so we use Response instead
return new Response(body, {
/*return new Response(body, {
status: 200,
headers: {
'Content-Type': 'text/html',
},
})
})*/
}
3 changes: 2 additions & 1 deletion frontend/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NextAuth, { NextAuthOptions, Session } from 'next-auth'
/*import NextAuth, { NextAuthOptions, Session } from 'next-auth'
import DiscordProvider from 'next-auth/providers/discord'
import { hashDiscordUserId } from 'utils/hashDiscord'
Expand Down Expand Up @@ -66,3 +66,4 @@ export const authOptions: NextAuthOptions = {
}
export default NextAuth(authOptions)
*/
3 changes: 3 additions & 0 deletions frontend/pages/api/grant/v1/amount_and_proof.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import type { NextApiRequest, NextApiResponse } from 'next'
import { Pool } from 'pg'
Expand All @@ -7,6 +8,7 @@ const pool = new Pool()
/**
* This endpoint returns the amount of tokens allocated to a specific identity
*/
/*
export default async function handlerAmountAndProof(
req: NextApiRequest,
res: NextApiResponse
Expand Down Expand Up @@ -52,3 +54,4 @@ function lowerCapIfEvm(identity: string, ecosystem: string): string {
}
return identity
}
*/
2 changes: 2 additions & 0 deletions frontend/pages/api/grant/v1/discord_signed_message.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import type { NextApiRequest, NextApiResponse } from 'next'
import { getServerSession } from 'next-auth/next'
import { authOptions } from '../../auth/[...nextauth]'
Expand Down Expand Up @@ -49,3 +50,4 @@ export default async function handler(
})
}
}
*/
3 changes: 3 additions & 0 deletions frontend/pages/api/grant/v1/evm_breakdown.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import type { NextApiRequest, NextApiResponse } from 'next'
import { Pool } from 'pg'
Expand All @@ -7,6 +8,7 @@ const pool = new Pool()
/**
* This endpoint returns the breakdown by chain for the evm allocation of a given evm identity.
*/
/*
export default async function handlerEvmBreakdown(
req: NextApiRequest,
res: NextApiResponse
Expand Down Expand Up @@ -37,3 +39,4 @@ export default async function handlerEvmBreakdown(
})
}
}
*/
2 changes: 2 additions & 0 deletions frontend/pages/api/grant/v1/fund_transaction.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import NodeWallet from '@coral-xyz/anchor/dist/cjs/nodewallet'
import { loadFunderWallet } from '../../../../claim_sdk/testWallets'
import {
Expand Down Expand Up @@ -75,3 +76,4 @@ export default async function handlerFundTransaction(
return res.status(403).json({ error: 'Unauthorized transaction' })
}
}
*/
3 changes: 3 additions & 0 deletions frontend/pages/api/grant/v1/solana_breakdown.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
import type { NextApiRequest, NextApiResponse } from 'next'
import { Pool } from 'pg'
Expand All @@ -7,6 +8,7 @@ const pool = new Pool()
/**
* This endpoint returns the breakdown for the solana allocation of a given solana identity.
*/
/*
export default async function handlerSolanaBreakdown(
req: NextApiRequest,
res: NextApiResponse
Expand Down Expand Up @@ -37,3 +39,4 @@ export default async function handlerSolanaBreakdown(
})
}
}
*/

0 comments on commit a038975

Please sign in to comment.