Skip to content

Commit

Permalink
api sale details
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideSilva committed Jun 25, 2024
1 parent 14d7ce9 commit 91055e3
Showing 1 changed file with 9 additions and 49 deletions.
58 changes: 9 additions & 49 deletions packages/web-app/app/api/sale/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { saleDetails } from '@/app/_server/sales';
import { formatEther, formatUnits } from 'viem';

declare global {
interface BigInt {
Expand All @@ -14,52 +13,13 @@ BigInt.prototype.toJSON = function () {
export const dynamic = 'force-static';

export async function GET(_request: Request) {
return Response.json([]);
// const details = await saleDetails();
//
// if (typeof details === 'object' && 'error' in details) {
// return new Response(`Sales details error: ${details.error}`, {
// status: 500,
// });
// }
//
// const tempDetails = details.map((project) => {
// return {
// ...project,
// minTarget: formatUnits(project.minTarget, 6),
// maxTarget: formatUnits(project.maxTarget, 6),
// };
// });
//
// const host = process.env.NEXT_PUBLIC_DAPP_HOST;
//
// const extendedWithTBA = [
// ...tempDetails,
// {
// address: 'TBA',
// publicKey: 'TBA',
// project: 'The Posemesh (AUKI)',
// description:
// 'The DePIN for AI Perception. The posemesh is a decentralized machine perception network for the next 100 billion people, devices and AI.',
// status: 'upcoming',
// rate: 'TBA',
// minTarget: 'TBA',
// maxTarget: 'TBA',
// start: 'TBA',
// end: 'TBA',
// minContribution: 'TBA',
// maxContribution: 'TBA',
// totalTokensForSale: 'TBA',
// startRegistration: 'TBA',
// endRegistration: 'TBA',
// url: 'TBA',
// logo: `${host}/auki-logo.png`,
// background: `${host}/auki-card-background.png`,
// backgroundMobile: `${host}/auki-card-background.png`,
// supplyPercentage: 'TBA',
// currentPrice: 'TBA',
// },
// ];
//
// return Response.json(extendedWithTBA);
const details = await saleDetails();

if (typeof details === 'object' && 'error' in details) {
return new Response(`Sales details error: ${details.error}`, {
status: 500,
});
}

return Response.json(details);
}

0 comments on commit 91055e3

Please sign in to comment.