diff --git a/apps/api/src/api/services/ramp/base.service.test.ts b/apps/api/src/api/services/ramp/base.service.test.ts index 27725359d..384024c87 100644 --- a/apps/api/src/api/services/ramp/base.service.test.ts +++ b/apps/api/src/api/services/ramp/base.service.test.ts @@ -5,7 +5,7 @@ import QuoteTicket from "../../../models/quoteTicket.model"; import {BaseRampService} from "./base.service"; const transaction = { id: "cleanup-test-transaction" }; -const expectedDeleteBatchSize = 500; +const expectedDeleteBatchSize = 5000; type QuoteCleanupWhere = { expiresAt?: { diff --git a/apps/frontend/src/contexts/rampState.tsx b/apps/frontend/src/contexts/rampState.tsx index 161c401e0..871441332 100644 --- a/apps/frontend/src/contexts/rampState.tsx +++ b/apps/frontend/src/contexts/rampState.tsx @@ -21,7 +21,7 @@ const MAX_RAMP_EPHEMERALS = 50; type RampEphemeralEntry = { substrateEphemeral: EphemeralAccount; evmEphemeral: EphemeralAccount; - timestamp: number; + timestamp?: number; }; type RampEphemeralsMap = Record; @@ -32,7 +32,7 @@ export function updateRampEphemeral(rampId: string, ephemerals: RampExecutionInp const keys = Object.keys(existing); if (keys.length > MAX_RAMP_EPHEMERALS) { - const sorted = keys.sort((a, b) => (existing[a].timestamp ?? 0) - (existing[b].timestamp ?? 0)); + const sorted = keys.sort((a, b) => (existing[a]?.timestamp ?? 0) - (existing[b]?.timestamp ?? 0)); const toRemove = sorted.slice(0, sorted.length - MAX_RAMP_EPHEMERALS); for (const key of toRemove) { delete existing[key];