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

Retrieves all of a user's bonuses (currently limited to freebets).

⚠️

Available in version 5.1.0-beta.1

ℹ️

You can find more information Here.

Usage

import { getBonuses } from '@azuro-org/toolkit'
 
const bonuses = await getBonuses({
  chainId: 137
  account: '0x...'
  affiliate: '0x...'
})

Props

{
  chainId: ChainId
  account: Address // user's address
  affiliate: Address // your affiliate address
}
type ChainId = 
  | 100     // Gnosis
  | 137     // Polygon
  | 80002   // Polygon Amoy
  | 88888   // Chiliz
  | 88882   // Chiliz Spicy
  | 8453    // Base
  | 84532   // Base Sepolia
 
import { type Address } from 'viem'

Return Value

ℹ️

Currently, the only available bonus type is freebet.

Promise<Bonus[] | null>
enum BonusType {
  FreeBet = 'FreeBet',
}
 
enum BonusStatus {
  Used = 'Used',
  Available = 'Available',
}
 
type BonusBase = {
  id: string
  type: BonusType,
  amount: string
  status: BonusStatus
  chainId: ChainId
  expiresAt: number
  usedAt: number
  createdAt: number
}
 
type Freebet = {
  type: BonusType.FreeBet,
  params: {
    isBetSponsored: boolean,
    isFeeSponsored: boolean,
    isSponsoredBetReturnable: boolean
  }
} & BonusBase
 
type Bonus = Freebet