Skip to Content
Developer HubToolkitFreebetgetBonuses

getBonuses

Fetches all bonuses (currently limited to freebets) for a bettor account filtered by status. By default, retrieves only available (not expired) bonuses. Returns null if no bonuses are found.

Usage

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

Props

type GetBonusesParams = { chainId: ChainId account: Address // user's address affiliate: Address // your affiliate address bonusStatus?: BonusStatus }
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.

type GetBonusesResult = Bonus[] | null
enum BonusType { FreeBet = 'FreeBet', } enum BonusStatus { Used = 'Used', Available = 'Available', } enum FreebetType { OnlyWin = 'OnlyWin', AllWin = 'AllWin', } enum BetRestrictionType { Ordinar = 'Ordinar', Combo = 'Combo', } enum EventRestrictionState { Live = 'Live', Prematch = 'Prematch', } 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 } settings: { type: FreebetType feeSponsored: boolean betRestriction: { type: BetRestrictionType | undefined minOdds: string maxOdds: string | undefined } eventRestriction: { state: EventRestrictionState | undefined } periodOfValidityMs: number } } & BonusBase type Bonus = Freebet
Last updated on