From a95b9909fee7a0d044d80e9a10d36fb9441da6d2 Mon Sep 17 00:00:00 2001 From: Milli Date: Wed, 25 May 2022 22:18:11 +0200 Subject: [PATCH] added automatic resolution to contract --- common/contract.ts | 1 + web/lib/firebase/contracts.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/contract.ts b/common/contract.ts index 0041c2f9..7fa3b1be 100644 --- a/common/contract.ts +++ b/common/contract.ts @@ -30,6 +30,7 @@ export type FullContract< resolution?: string resolutionType: 'manual' | 'combined' automaticResolutionTime?: number + automaticResolution?: resolution closeEmailsSent?: number diff --git a/web/lib/firebase/contracts.ts b/web/lib/firebase/contracts.ts index 4fcfb6da..cead2c6a 100644 --- a/web/lib/firebase/contracts.ts +++ b/web/lib/firebase/contracts.ts @@ -42,9 +42,10 @@ export function contractUrl(contract: Contract) { } export function contractMetrics(contract: Contract) { - const { createdTime, resolutionTime, isResolved } = contract + const { createdTime, resolutionTime, isResolved, automaticResolutionTime } = contract const createdDate = dayjs(createdTime).format('MMM D') + const automaticResolutionDate = dayjs(automaticResolutionTime).format('MMM D') const resolvedDate = isResolved ? dayjs(resolutionTime).format('MMM D') @@ -52,7 +53,7 @@ export function contractMetrics(contract: Contract) { const volumeLabel = `${formatMoney(contract.volume)} bet` - return { volumeLabel, createdDate, resolvedDate } + return { volumeLabel, createdDate, automaticResolutionDate, resolvedDate } } export function getBinaryProb(contract: FullContract) {