useResolvedMarkets
The useResolvedMarkets hook is wrapper over useConditions. It obtains resolved conditions and groups prematch and live markets. Should be used to show game results.
Usage
import { useResolvedMarkets } from '@azuro-org/sdk'
const { data, isFetching, error } = useResolvedMarkets({ gameId: '...' })Props
{
gameId: string
extended?: boolean // opt-in: include new conditions/markets not present in the dictionaries package
chainId?: ChainId
query?: QueryParameter<ConditionsQuery['conditions']>
}type ChainId =
| 137 // Polygon
| 80002 // Polygon Amoy
| 8453 // Base
| 84532 // Base Sepoliaℹ️
extended is forwarded to the underlying useConditions call. Set it to true to also surface new-generation markets (conditions whose conditionId[0] === '5') in the grouped result — groupConditionsByMarket already understands the new shape. See the useConditions docs for the full caveat, especially if your app reads @azuro-org/dictionaries directly.
Return Value
UseQueryResult<GameMarkets>import { type UseQueryResult } from '@tanstack/react-query'
type GameMarkets = Market[]
type Market = {
marketKey: string
name: string
description: string
conditions: Condition[]
}
type Condition = {
conditionId: string
state: ConditionState
margin: string
isExpressForbidden: boolean
outcomes: MarketOutcome[]
}
type MarketOutcome = {
selectionName: string
odds: number
gameId: string
isExpressForbidden: boolean
isWon?: boolean
} & Selection
type Selection = {
conditionId: string
outcomeId: string
}Last updated on