⚠️
Important! We’ve moved to V3! This documentation is for V2 only and will be updated in May.
Developer Hub
🔮 For applications
SDK
Freebet
useAvailableFreebets

useAvailableFreebets

The useAvailableFreebets hook returns all freebets that can be used based on the provided bet information (selections).

ℹ️

You can find more information Here.

Usage

import { useAvailableFreebets } from '@azuro-org/sdk'
 
const { data: freebets, isFetching: isFreebetsFetching } = useAvailableFreebets({
  account: '0x...', // user's address
  affiliate: '0x...', // your affiliate address
  selections: [...]
})

Props

  account: Address
  affiliate: Address
  selections: Selection[]
  chainId?: ChainId
  query?: QueryParameter<Freebet[]>
type Selection = {
  outcomeId: string
  conditionId: string
}
 
export enum BonusType {
  FreeBet = 'FreeBet',
}
 
export enum BonusStatus {
  Used = 'Used',
  Available = 'Available',
}
 
type BonusBase = {
  id: string
  type: BonusType,
  amount: string
  status: BonusStatus
  chainId: ChainId
  expiresAt: number
  usedAt: number
  createdAt: number
}
 
export type Freebet = {
  type: BonusType.FreeBet,
  params: {
    isBetSponsored: boolean,
    isFeeSponsored: boolean,
    isSponsoredBetReturnable: boolean
  }
} & BonusBase

Return Value

UseQueryResult<Freebet[]>
import { type UseQueryResult } from '@tanstack/react-query'