getConditionsState
Fetches up-to-date condition states and outcome odds for a list of conditions.
💎
To keep your odds perfectly synchronized with our system, you can leverage WebSocket subscriptions to track condition updates as they happen.
If you use SDK, it’s already done for you.
Usage
import { getConditionsState } from '@azuro-org/toolkit'
const conditions = await getConditionsState({
chainId: 137,
conditionIds: ['300610060000000000635055340000000000000000387193'],
})Props
type GetConditionsStateParams = {
chainId: ChainId
conditionIds: string[]
}Return Value
type GetConditionsStateResult = ConditionStateData[]type ConditionStateData = {
conditionId: string
title: string // market title — useful for new conditions ("5...") whose IDs are not in the dictionaries package
state: ConditionState
outcomes: {
id: string
title: string // outcome title
outcomeId: string
odds: string
}[]
}enum ConditionState {
Active = 'Active',
Canceled = 'Canceled',
Removed = 'Removed',
Resolved = 'Resolved',
Stopped = 'Stopped'
}Last updated on