From 457a77b77fc4040078ecc0fa817e6c3034c8c128 Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Thu, 19 Dec 2024 15:36:54 +0000 Subject: [PATCH] do it --- apps/staking/src/app/api/v1/locked_accounts/route.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/staking/src/app/api/v1/locked_accounts/route.ts b/apps/staking/src/app/api/v1/locked_accounts/route.ts index 378c7faf46..c940847dd0 100644 --- a/apps/staking/src/app/api/v1/locked_accounts/route.ts +++ b/apps/staking/src/app/api/v1/locked_accounts/route.ts @@ -72,10 +72,12 @@ export async function GET(req: NextRequest) { actualAmount: tokensToString(custodyAccount.amount), lock: { type: lock.type, - schedule: lock.schedule.map((unlock) => ({ - date: unlock.date, - amount: tokensToString(unlock.amount), - })), + schedule: lock.schedule + .filter((unlock) => unlock.date > new Date()) + .map((unlock) => ({ + date: unlock.date, + amount: tokensToString(unlock.amount), + })), }, }; }),