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
This commit is contained in:
parent
b7f94e65a7
commit
8884f1beb9
|
@ -26,6 +26,7 @@ export type LiteMarket = {
|
||||||
volume24Hours: number
|
volume24Hours: number
|
||||||
isResolved: boolean
|
isResolved: boolean
|
||||||
resolution?: string
|
resolution?: string
|
||||||
|
resolutionTime?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FullMarket = LiteMarket & {
|
export type FullMarket = LiteMarket & {
|
||||||
|
@ -54,6 +55,7 @@ export function toLiteMarket({
|
||||||
volume24Hours,
|
volume24Hours,
|
||||||
isResolved,
|
isResolved,
|
||||||
resolution,
|
resolution,
|
||||||
|
resolutionTime,
|
||||||
}: Contract): LiteMarket {
|
}: Contract): LiteMarket {
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
|
@ -61,7 +63,10 @@ export function toLiteMarket({
|
||||||
creatorName,
|
creatorName,
|
||||||
createdTime,
|
createdTime,
|
||||||
creatorAvatarUrl,
|
creatorAvatarUrl,
|
||||||
closeTime,
|
closeTime:
|
||||||
|
resolutionTime && closeTime
|
||||||
|
? Math.min(resolutionTime, closeTime)
|
||||||
|
: closeTime,
|
||||||
question,
|
question,
|
||||||
description,
|
description,
|
||||||
tags,
|
tags,
|
||||||
|
@ -72,5 +77,6 @@ export function toLiteMarket({
|
||||||
volume24Hours,
|
volume24Hours,
|
||||||
isResolved,
|
isResolved,
|
||||||
resolution,
|
resolution,
|
||||||
|
resolutionTime,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user