Skip to Content
Developer HubToolkitFeedgetConditionsState

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 sort: `${number}` category: ConditionCategory outcomes: { id: string title: string // outcome title outcomeId: string odds: string hidden: boolean state: OutcomeState }[] }
enum ConditionState { Active = 'Active', Canceled = 'Canceled', Removed = 'Removed', Resolved = 'Resolved', Stopped = 'Stopped' } enum OutcomeState { Active = 'Active', Canceled = 'Canceled', Stopped = 'Stopped', Won = 'Won', Lost = 'Lost' } // market category, e.g. 'total' | 'handicap' | 'winner' — see getConditionsByGameIds for the full list type ConditionCategory = string | null