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 }[] }
⚠️

A condition is only ever Active or Stopped; settlement lives on each outcome.

ConditionState no longer has Resolved, Canceled or Removed. Within one condition, outcomes settle independently — one can be Won, another Lost, a third Canceled (voided, stake refunded) and a fourth still Active. Read each outcome’s state, or isOutcomeSettled, for a result.

enum ConditionState { Active = 'Active', 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