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
}
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
}