Comment out create lock API

This commit is contained in:
AdityaSalunkhe21 2025-02-06 16:43:44 +05:30 committed by Adw8
parent 0439c2b492
commit 7acb3ee182
2 changed files with 16 additions and 16 deletions

View File

@ -3,21 +3,21 @@ import { NextRequest, NextResponse } from "next/server";
import { createRewardLock } from "../../../utils/create-lock"; import { createRewardLock } from "../../../utils/create-lock";
import { extractTxInfo } from "../../../utils/extractTxInfo"; import { extractTxInfo } from "../../../utils/extractTxInfo";
export async function GET(req: NextRequest) { // export async function GET(req: NextRequest) {
try { // try {
const { searchParams } = new URL(req.url); // const { searchParams } = new URL(req.url);
const signature = searchParams.get('signature') || '4HBtnoNUuMGpmbhD9cPiJtbxkhux31pfZs3HYud5eopAU69RaC4UbJsYdj83eafFxV6eH8pSaRgqELrwyjrWp7yz'; // const signature = searchParams.get('signature')
const { authority, amount } = await extractTxInfo(signature); // const { authority, amount } = await extractTxInfo(signature);
if (!authority || Number(amount) <= 0) { // if (!authority || Number(amount) <= 0) {
return NextResponse.json({ error: "Invalid transaction details" }, { status: 400 }); // return NextResponse.json({ error: "Invalid transaction details" }, { status: 400 });
} // }
const escrow = await createRewardLock(authority, amount); // const escrow = await createRewardLock(authority, amount);
return NextResponse.json({ success: true, data: { escrow } }); // return NextResponse.json({ success: true, data: { escrow } });
} catch (error) { // } catch (error) {
console.error('API route error:', error); // console.error('API route error:', error);
return NextResponse.json({ error: "Internal server error" }, { status: 500 }); // return NextResponse.json({ error: "Internal server error" }, { status: 500 });
} // }
} // }

View File

@ -19,4 +19,4 @@ export async function extractTxInfo(transactionSignature: string) {
const { info: { amount, authority } } = transferInstruction.parsed; const { info: { amount, authority } } = transferInstruction.parsed;
return { authority, amount }; return { authority, amount };
} }