Expose multiple choice answer probabilities (#939)

* Expose multiple choice answer probabilities

* Run prettier

* Update api.md

Co-authored-by: Austin Chen <akrolsmir@gmail.com>
This commit is contained in:
Olivia Appleton 2022-09-29 14:17:52 -04:00 committed by GitHub
parent 2d1fd07834
commit 1e6b72059e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -411,7 +411,7 @@ Requires no authorization.
type FullMarket = LiteMarket & {
bets: Bet[]
comments: Comment[]
answers?: Answer[] // Free response markets only
answers?: Answer[] // dpm-2 markets only
description: JSONContent // Rich text content. See https://tiptap.dev/guide/output#option-1-json
textDescription: string // string description without formatting, images, or embeds
}

View File

@ -149,7 +149,8 @@ export function toFullMarket(
): FullMarket {
const liteMarket = toLiteMarket(contract)
const answers =
contract.outcomeType === 'FREE_RESPONSE'
contract.outcomeType === 'FREE_RESPONSE' ||
contract.outcomeType === 'MULTIPLE_CHOICE'
? contract.answers.map((answer) =>
augmentAnswerWithProbability(contract, answer)
)