Developer Hub
🔮 For applications
SDK
Data Hooks
useBetsSummaryBySelection

This Hook should use if you want to show user's bets results on the game page for resolved markets, check useResolvedMarkets.

Usage

import { useBetsSummaryBeSelection } from '@azuro-org/sdk'
 
const { betsSummary, loading, error } = useBetsSummaryBeSelection({
  account: '...',
  gameId: '...',
  gameStatus: GameStatus.Resolved
})

Props

{
  account: Address
  gameId: string
  gameStatus: GameStatus
  keyStruct?: 'outcomeId' | 'conditionId-outcomeId' // the key in betsSummary object
}
ℹ️

If you use groupedMarkets from useResolvedMarkets the keyStruct should be outcomeId otherwise conditionId-outcomeId.

Return Value

{
  loading: boolean
  error: Error | null
  betsSummary: Record<string, string>
}