From 8884f1beb96958fbe40fd2869c234de8be2c1215 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Mon, 28 Feb 2022 13:40:48 -0600 Subject: [PATCH] Expose resolutionTime in API (#56) * Expose resolutionTime. Compute closeTime to be the min of resolution and close time * Rename settled to resolved, newest to most recent --- web/pages/api/v0/_types.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/pages/api/v0/_types.ts b/web/pages/api/v0/_types.ts index 6dc4b245..44a6119e 100644 --- a/web/pages/api/v0/_types.ts +++ b/web/pages/api/v0/_types.ts @@ -26,6 +26,7 @@ export type LiteMarket = { volume24Hours: number isResolved: boolean resolution?: string + resolutionTime?: number } export type FullMarket = LiteMarket & { @@ -54,6 +55,7 @@ export function toLiteMarket({ volume24Hours, isResolved, resolution, + resolutionTime, }: Contract): LiteMarket { return { id, @@ -61,7 +63,10 @@ export function toLiteMarket({ creatorName, createdTime, creatorAvatarUrl, - closeTime, + closeTime: + resolutionTime && closeTime + ? Math.min(resolutionTime, closeTime) + : closeTime, question, description, tags, @@ -72,5 +77,6 @@ export function toLiteMarket({ volume24Hours, isResolved, resolution, + resolutionTime, } }