useActiveConditions
The useActiveConditions hook is wrapper over useConditions for getting active conditions.
Usage
import { useActiveConditions } from '@azuro-org/sdk'
const { data, isFetching, error } = useActiveConditions(props)Props
{
gameId: string | bigint | string[] | bigint[]
chainId?: ChainId
query?: QueryParameter<ConditionDetailedData[]> // useQuery params
}⚠️
gameId property is not the same as id. Each game fetched using useGames hook contains the gameId:
import { useGame } from '@azuro-org/sdk'
const { data: games } = useGames()
const gameId = games?.[0]?.gameIdReturn Value
UseQueryResult<ConditionDetailedData[]>import { type UseQueryResult } from '@tanstack/react-query'
type ConditionDetailedData = {
conditionId: string
gameId: string
state: ConditionState
outcomes: Array<{
outcomeId: string
odds: string
}>
wonOutcomeIds?: string[]
isExpressForbidden: boolean
margin: string
reinforcement: string
virtualFund: string
affiliate: string
turnover: string
wonOutcome?: string
core: {
address: string
type: CoreType
liquidityPoolAddress: string
}
}
enum ConditionState {
Created = 'Created',
Active = 'Active',
Stopped = 'Stopped',
Resolved = 'Resolved',
Canceled = 'Canceled',
Paused = 'Paused'
}Last updated on