Add min, max, isLogScale to numeric market API return

This commit is contained in:
Sinclair Chen 2022-07-29 15:33:45 -07:00
parent 779b6dfc0c
commit 20f3fa9eec
2 changed files with 9 additions and 0 deletions

View File

@ -5,6 +5,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:@next/next/recommended',
'prettier',
],
rules: {
'@typescript-eslint/no-empty-function': 'off',

View File

@ -97,6 +97,11 @@ export function toLiteMarket(contract: Contract): LiteMarket {
const probability =
contract.outcomeType === 'BINARY' ? getProbability(contract) : undefined
let min, max, isLogScale: any
if (contract.outcomeType === 'PSEUDO_NUMERIC') {
;({ min, max, isLogScale } = contract)
}
return removeUndefinedProps({
id,
creatorUsername,
@ -124,6 +129,9 @@ export function toLiteMarket(contract: Contract): LiteMarket {
resolution,
resolutionTime,
resolutionProbability,
min,
max,
isLogScale,
})
}