UNPKG

@azuro-org/sdk

Version:

One-stop solution for building betting dApps on the Azuro Protocol.

34 lines (33 loc) 1.18 kB
import { type BettorsQuery, type ChainId } from '@azuro-org/toolkit'; import { type UseQueryResult } from '@tanstack/react-query'; import { type QueryParameter } from '../../global'; type UseBetsSummaryResult = { toPayout: string; inBets: string; totalPayout: string; totalProfit: string; betsCount: number; wonBetsCount: number; lostBetsCount: number; }; export type UseBetsSummaryProps = { account: string; chainId?: ChainId; affiliates?: string[]; query?: QueryParameter<BettorsQuery['bettors']>; }; export type UseBetsSummary = (props: UseBetsSummaryProps) => UseQueryResult<UseBetsSummaryResult>; /** * Get betting summary statistics for a given account. * Returns total amounts in bets, payouts, profits, and counts of won/lost bets. * * - Docs: https://gem.azuro.org/hub/apps/sdk/data-hooks/useBetsSummary * * @example * import { useBetsSummary } from '@azuro-org/sdk' * * const { data, isFetching } = useBetsSummary({ account: '0x...' }) * const { toPayout, inBets, totalPayout, totalProfit, betsCount, wonBetsCount, lostBetsCount } = data || {} * */ export declare const useBetsSummary: UseBetsSummary; export {};