Skip to Content

useBetsSummary

The useBetsSummary is used to fetch bets summary information for user’s address.

ℹ️

Hook represents a logic wrapper over TanStack Query’s useQuery hook. Explore TanStack Query docs  to understand what data the hook returns.

Usage

import { useBetsSummary } from '@azuro-org/sdk' const { data, isFetching, error } = useBetsSummary({ account: '0xlknqk123...' })

Props

{ account: string // user's address chainId?: ChainId affiliates?: string[] // array of affiliate addresses that will be included in data query?: QueryParameter<BettorsQuery['bettors']> }
type ChainId = | 100 // Gnosis | 137 // Polygon | 80002 // Polygon Amoy | 88888 // Chiliz | 88882 // Chiliz Spicy | 8453 // Base | 84532 // Base Sepolia type BettorsQuery = { __typename?: 'Query' bettors: Array<{ __typename?: 'Bettor' id: string rawToPayout: string rawInBets: string rawTotalPayout: string rawTotalProfit: string betsCount: number wonBetsCount: number lostBetsCount: number }> }

Return Value

UseQueryResult<{ toPayout: string inBets: string totalPayout: string totalProfit: string betsCount: number wonBetsCount: number lostBetsCount: number }>
import { type UseQueryResult } from '@tanstack/react-query'
Last updated on