@azuro-org/toolkit
Version:
This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.
64 lines (63 loc) • 1.8 kB
TypeScript
import type { ChainId } from '../../config';
import type { SportHubSlug } from './types';
export type GetNavigationParams = {
chainId: ChainId;
sportHub?: SportHubSlug;
sportIds?: string | number | (string | number)[];
};
type NavigationSportDataResponse = {
id: number;
slug: string;
name: string;
sportId: string;
sportHub: {
id: string;
slug: SportHubSlug;
};
activeGamesCount: number;
activeLiveGamesCount: number;
activePrematchGamesCount: number;
countries: {
id: string;
slug: string;
name: string;
turnover: string;
activeGamesCount: number;
activeLiveGamesCount: number;
activePrematchGamesCount: number;
leagues: {
id: string;
slug: string;
name: string;
isTopLeague: boolean;
topWeight?: number;
turnover: string;
activeGamesCount: number;
activeLiveGamesCount: number;
activePrematchGamesCount: number;
}[];
}[];
};
export type NavigationSportData = Omit<NavigationSportDataResponse, 'sportHub'> & {
sporthub: {
id: string;
slug: SportHubSlug;
};
};
export type GetNavigationResult = NavigationSportData[];
/**
* Fetches navigation structure with sports, countries, and leagues hierarchy.
* Returns active game counts at each level for building navigation menus.
*
* - Docs: https://gem.azuro.org/hub/apps/toolkit/feed/getNavigation
*
* @example
* import { getNavigation } from '@azuro-org/toolkit'
*
* const sports = await getNavigation({
* chainId: 137,
* sportHub: 'sports',
* })
* */
export declare const getNavigation: (props: GetNavigationParams) => Promise<GetNavigationResult>;
export {};