@azuro-org/sdk
Version:
One-stop solution for building betting dApps on the Azuro Protocol.
31 lines (30 loc) • 1.02 kB
TypeScript
import { GameState } from '@azuro-org/toolkit';
import { type LiveStatistics } from '../../contexts/liveStatisticsSocket';
export type UseLiveStatisticsProps = {
gameId: string;
sportId: number | string;
gameState: GameState;
enabled?: boolean;
};
/**
* Watch real-time live game statistics (scores, periods, etc.) via websocket.
* Only works for live games from supported providers and sports.
*
* Returns `isAvailable` to check if statistics are supported for the game.
*
* - Docs: https://gem.azuro.org/hub/apps/sdk/watch/useLiveStatistics
*
* @example
* import { useLiveStatistics, GameState } from '@azuro-org/sdk'
*
* const { data: statistics, isFetching, isAvailable } = useLiveStatistics({
* gameId: '123456789',
* sportId: 33,
* gameState: GameState.Live
* })
* */
export declare const useLiveStatistics: ({ gameId, sportId, gameState, enabled }: UseLiveStatisticsProps) => {
data: LiveStatistics | null | undefined;
isFetching: boolean;
isAvailable: boolean;
};