forked from mito-systems/sol-mem-gen
Comment out create lock API
This commit is contained in:
parent
33350b263e
commit
5be2edfd43
@ -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 });
|
||||
// }
|
||||
// }
|
||||
|
@ -19,4 +19,4 @@ export async function extractTxInfo(transactionSignature: string) {
|
||||
|
||||
const { info: { amount, authority } } = transferInstruction.parsed;
|
||||
return { authority, amount };
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user