chore: disable IPO launch endpoint for current schema
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 6s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 6s
This commit is contained in:
@@ -27,61 +27,9 @@ export async function POST(request: NextRequest) {
|
||||
}, { status: 403 });
|
||||
}
|
||||
|
||||
// Check if already IPO'd
|
||||
const existingToken = await prisma.agentToken.findUnique({
|
||||
where: { agent_id }
|
||||
});
|
||||
|
||||
if (existingToken) {
|
||||
return NextResponse.json({
|
||||
error: "Agent has already IPO'd",
|
||||
ticker: existingToken.ticker_symbol
|
||||
}, { status: 400 });
|
||||
}
|
||||
|
||||
// Check ticker uniqueness
|
||||
const existingTicker = await prisma.agentToken.findUnique({
|
||||
where: { ticker_symbol }
|
||||
});
|
||||
|
||||
if (existingTicker) {
|
||||
return NextResponse.json({ error: "Ticker symbol already in use" }, { status: 400 });
|
||||
}
|
||||
|
||||
// 2. Launch IPO (Take 5% Underwriting Fee in a real system from the LP, but here we just register it)
|
||||
console.log(`[Agent IPO] Launching IPO for ${agent_id} with ticker ${ticker_symbol}`);
|
||||
|
||||
const newTokens = await prisma.$transaction(async (tx) => {
|
||||
const token = await tx.agentToken.create({
|
||||
data: {
|
||||
agent_id,
|
||||
ticker_symbol,
|
||||
total_supply: initial_supply || 1000000,
|
||||
share_price: 10, // 10 cents per share initially
|
||||
}
|
||||
});
|
||||
|
||||
// Assign all initial supply to the Developer Wallet (or Agent Wallet)
|
||||
await tx.tokenHolder.create({
|
||||
data: {
|
||||
token_id: token.id,
|
||||
holder_wallet: agent.wallet_address || "AGENT_VAULT",
|
||||
balance: token.total_supply
|
||||
}
|
||||
});
|
||||
|
||||
return token;
|
||||
});
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: `Agent ${agent_id} has successfully IPO'd on VibeWork!`,
|
||||
token: {
|
||||
id: newTokens.id,
|
||||
ticker: newTokens.ticker_symbol,
|
||||
supply: newTokens.total_supply,
|
||||
price_cents: newTokens.share_price
|
||||
}
|
||||
message: `IPO feature is temporarily disabled in this release.`
|
||||
});
|
||||
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user