2022-02-17 23:00:19 +00:00
|
|
|
import { Answer } from './answer'
|
|
|
|
|
2022-01-10 21:07:57 +00:00
|
|
|
export type Contract = {
|
2022-01-10 23:52:03 +00:00
|
|
|
id: string
|
|
|
|
slug: string // auto-generated; must be unique
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
creatorId: string
|
|
|
|
creatorName: string
|
|
|
|
creatorUsername: string
|
2022-01-19 07:33:46 +00:00
|
|
|
creatorAvatarUrl?: string // Start requiring after 2022-03-01
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
question: string
|
|
|
|
description: string // More info about what the contract is about
|
2022-01-21 23:21:46 +00:00
|
|
|
tags: string[]
|
2022-01-24 22:33:02 +00:00
|
|
|
lowercaseTags: string[]
|
2022-01-13 01:53:50 +00:00
|
|
|
visibility: 'public' | 'unlisted'
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-02-17 23:00:19 +00:00
|
|
|
outcomeType: 'BINARY' | 'MULTI' | 'FREE_RESPONSE'
|
|
|
|
multiOutcomes?: string[] // Used for outcomeType 'MULTI'.
|
|
|
|
answers?: Answer[] // Used for outcomeType 'FREE_RESPONSE'.
|
|
|
|
|
2022-01-12 19:01:04 +00:00
|
|
|
mechanism: 'dpm-2'
|
2022-02-17 23:00:19 +00:00
|
|
|
phantomShares?: { [outcome: string]: number }
|
|
|
|
pool: { [outcome: string]: number }
|
|
|
|
totalShares: { [outcome: string]: number }
|
|
|
|
totalBets: { [outcome: string]: number }
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
createdTime: number // Milliseconds since epoch
|
|
|
|
lastUpdatedTime: number // If the question or description was changed
|
|
|
|
closeTime?: number // When no more trading is allowed
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
isResolved: boolean
|
|
|
|
resolutionTime?: number // When the contract creator resolved the market
|
2022-02-17 23:00:19 +00:00
|
|
|
resolution?: string
|
2022-02-20 07:26:26 +00:00
|
|
|
resolutionProbability?: number // Used for BINARY markets resolved to MKT
|
|
|
|
resolutions?: { [outcome: string]: number } // Used for outcomeType FREE_RESPONSE resolved to MKT
|
2022-02-17 18:18:02 +00:00
|
|
|
closeEmailsSent?: number
|
2022-01-10 21:07:57 +00:00
|
|
|
|
2022-01-10 23:52:03 +00:00
|
|
|
volume24Hours: number
|
|
|
|
volume7Days: number
|
|
|
|
}
|
2022-01-22 23:59:50 +00:00
|
|
|
|
2022-02-17 23:00:19 +00:00
|
|
|
export type outcomeType = 'BINARY' | 'MULTI' | 'FREE_RESPONSE'
|