From 7acb3ee1825eabebff03cb548122f64acc178d39 Mon Sep 17 00:00:00 2001 From: AdityaSalunkhe21 Date: Thu, 6 Feb 2025 16:43:44 +0530 Subject: [PATCH] Comment out create lock API --- src/app/api/lock/route.ts | 30 +++++++++++++++--------------- src/utils/extractTxInfo.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/app/api/lock/route.ts b/src/app/api/lock/route.ts index ce1f981..c0d6e10 100644 --- a/src/app/api/lock/route.ts +++ b/src/app/api/lock/route.ts @@ -3,21 +3,21 @@ import { NextRequest, NextResponse } from "next/server"; import { createRewardLock } from "../../../utils/create-lock"; import { extractTxInfo } from "../../../utils/extractTxInfo"; -export async function GET(req: NextRequest) { - try { - const { searchParams } = new URL(req.url); - const signature = searchParams.get('signature') || '4HBtnoNUuMGpmbhD9cPiJtbxkhux31pfZs3HYud5eopAU69RaC4UbJsYdj83eafFxV6eH8pSaRgqELrwyjrWp7yz'; +// export async function GET(req: NextRequest) { +// try { +// const { searchParams } = new URL(req.url); +// const signature = searchParams.get('signature') - const { authority, amount } = await extractTxInfo(signature); - if (!authority || Number(amount) <= 0) { - return NextResponse.json({ error: "Invalid transaction details" }, { status: 400 }); - } +// const { authority, amount } = await extractTxInfo(signature); +// if (!authority || Number(amount) <= 0) { +// return NextResponse.json({ error: "Invalid transaction details" }, { status: 400 }); +// } - const escrow = await createRewardLock(authority, amount); - return NextResponse.json({ success: true, data: { escrow } }); +// const escrow = await createRewardLock(authority, amount); +// return NextResponse.json({ success: true, data: { escrow } }); - } catch (error) { - console.error('API route error:', error); - return NextResponse.json({ error: "Internal server error" }, { status: 500 }); - } -} +// } catch (error) { +// console.error('API route error:', error); +// return NextResponse.json({ error: "Internal server error" }, { status: 500 }); +// } +// } diff --git a/src/utils/extractTxInfo.ts b/src/utils/extractTxInfo.ts index 162c390..555eeef 100644 --- a/src/utils/extractTxInfo.ts +++ b/src/utils/extractTxInfo.ts @@ -19,4 +19,4 @@ export async function extractTxInfo(transactionSignature: string) { const { info: { amount, authority } } = transferInstruction.parsed; return { authority, amount }; - } \ No newline at end of file + }