Developer Hub
🔮 For applications
SDK
Other Hooks
useGameStatus

Returns a detailed game status based on the game's status derived from the subgraph and start date. It also checks the game's start time for pre-match and updates the status after the game starts.

Usage

import { useGameStatus } from '@azuro-org/sdk'
 
const { status, isGameStarted } = useGameStatus()

Props

{
  startsAt: number // game's start date
  graphStatus: GraphGameStatus // game's graph status
  isGameExistInLive: boolean // Should evaluate to true if the game was fetched from the live graph
}
 
enum GraphGameStatus {
  Canceled = 'Canceled',
  Created = 'Created',
  Paused = 'Paused',
  Resolved = 'Resolved'
}

Return Value

{
    status: gameStatus,
    isGameStarted,
}
 
enum GameStatus {
  Created, // same as GraphGameStatus.Created
  Live, // game in live
  PendingResolution, // pre-match game status holds for 100 minutes after the start if the game doesn't exist in the live
  Resolved, // same as GraphGameStatus.Resolved
  Canceled, // same as GraphGameStatus.Canceled
  Paused, // same as GraphGameStatus.Paused
}