Skip to content

Commit b14cd26

Browse files
committed
fix: store multisig chain id
1 parent 0f83d9c commit b14cd26

File tree

9 files changed

+575
-527
lines changed

9 files changed

+575
-527
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- AlterTable
2+
ALTER TABLE "Dex" ADD COLUMN "multisigChainId" INTEGER;

api/prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ model Dex {
9090
privyLoginMethods String? // Comma-separated list of Privy login methods (email,passkey,twitter,google)
9191
isGraduated Boolean @default(false) // Whether the DEX has fully graduated
9292
graduationTxHash String? @unique // Transaction hash used for graduation (prevents reuse)
93+
multisigChainId Int? // Chain ID where the multisig delegate signer link was established
9394
9495
// Social Card Fields
9596
description String? // DEX description for social cards

api/src/routes/graduation.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const verifyTxSchema = z.object({
4444

4545
const finalizeAdminWalletSchema = z.object({
4646
multisigAddress: z.string().optional(),
47+
multisigChainId: z.number().optional(),
4748
});
4849

4950
const graduationRoutes = new Hono();
@@ -404,7 +405,7 @@ graduationRoutes.post(
404405
);
405406
}
406407

407-
const { multisigAddress } = c.req.valid("json");
408+
const { multisigAddress, multisigChainId } = c.req.valid("json");
408409
const addressToCheck = multisigAddress || user.address;
409410

410411
const orderlyResponse = await fetch(
@@ -462,7 +463,10 @@ graduationRoutes.post(
462463

463464
await prismaClient.dex.update({
464465
where: { userId },
465-
data: { isGraduated: true },
466+
data: {
467+
isGraduated: true,
468+
multisigChainId: multisigChainId || null,
469+
},
466470
});
467471

468472
return c.json({
@@ -543,6 +547,7 @@ graduationRoutes.get("/graduation-status", async c => {
543547
brokerId: dex.brokerId,
544548
isMultisig,
545549
multisigAddress,
550+
multisigChainId: dex.multisigChainId,
546551
});
547552
} catch (error) {
548553
console.error("Error getting graduation status:", error);

0 commit comments

Comments
 (0)