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 (opens in a new tab) 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
affiliates?: string[] // array of affiliate addresses that will be included in data
query?: QueryParameter<BettorsQuery['bettors']>
}
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
}>