Comment out create lock API

This commit is contained in:
AdityaSalunkhe21 2025-02-06 16:43:44 +05:30 committed by Adw8
parent 33350b263e
commit 5be2edfd43
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 { 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 });
// }
// }

View File

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