Skip to content

Releases: Azuro-protocol/sdk

v7.2.0

23 Apr 10:34

Choose a tag to compare

  • Bump toolkit for isTopLeague field in leagues;
  • Fix UseNavigationQueryFnData return map type;
  • Add topLeagueFilter to useSports.

Full Changelog: v7.1.1...v7.2.0

v7.1.1

01 Apr 07:22

Choose a tag to compare

  • simplify isCanceled condition logic of bet selection in useBetsGraph and useBets hooks

Full Changelog: v7.1.0...v7.1.1

v7.1.0

31 Mar 11:39

Choose a tag to compare

New: Query Options Helpers

Most of data hooks now:

  • export a getUse*QueryOptions function, allowing you to construct query options outside of a component — useful for prefetching, SSR, or composing with other queries.
  • export supporting types: GetUse*QueryOptionsProps, Use*QueryFnData
  • accept select field in the query prop for result transformation and re-render optimization. select receives Use*QueryFnData, query.data type is inferred from returning data from select, if it exists

Supported for:

  • useConditions
  • useGame
  • useGames
  • useSearchGames
  • useSports
  • useSportsNavigation
  • useNavigation
  • useBetFee
  • useBetCalculation
  • useBonuses
  • useAvailableFreebets
import { getUseSportsQueryOptions, type UseSportsQueryFnData } from '@azuro-org/sdk'

// UseSportsQueryFnData = SportData[]
const select = (data: UseSportsQueryFnData) => data[0]

const options = getUseSportsQueryOptions({
  chainId,
  isLive: false,
  query: { 
    select, 
    staleTime: 30_000,
  },
})

await queryClient.prefetchQuery(options)

// because of select, query.data type is `SportData | undefined`

New: sortLeaguesAndCountriesByName in useSports

Optional boolean prop. When true (or when start times are equal), leagues and countries are sorted alphabetically by name instead of by game start time.

useSports({ sortLeaguesAndCountriesByName: true })

New: hidden Field Support in Condition Watchers

useConditionState

  • New prop: isInitiallyHidden?: boolean — pass condition.hidden from ConditionDetailedData
  • New return value: isHidden — starts true for stopped secondary conditions; resets to false when a socket update arrives (condition is still alive, only temporarily stopped by the provider)

useConditionsState

  • Now accepts a conditions array (Pick<ConditionDetailedData, 'conditionId' | 'state' | 'hidden'>[]) as an alternative to conditionIds + initialStates
  • New return value: conditionsMapRecord<string, { state: ConditionState, hidden: boolean }>
  • hidden follows the same logic: starts from initial data, clears on any socket update
// preferred for game markets list
const { data, conditionsMap } = useConditionsState({ conditions })

// still works for betslip / ID-only scenarios
const { data, conditionsMap } = useConditionsState({ conditionIds, initialStates })

Extended Watcher Event Data

conditionWatcher events now include:

  • gameId, isLiveEnabled, isPrematchEnabled, isCashoutEnabled
  • Full outcomes[] array (previously only odds were propagated)

outcomeWatcher events now include:

  • turnover

ConditionData type changes:

  • maxConditionPayoutmaxConditionPotentialLoss
  • maxOutcomePayoutmaxOutcomePotentialLoss
  • Added isCashoutEnabled, outcomes[].turnover

Improved: useBet

  • New return value: isWalletReadyToSubmittrue when the account is connected, wallet client is resolved, and the appropriate client (AA or regular) is ready
  • UseBetProps is now exported
  • Submit function now uses refs for aaClient and walletClient — captures the latest value at call time instead of closing over a stale reference
  • Explicit guards added: throws descriptive errors if account or wallet client is missing at submit time
  • Chain switch for AA wallets only fires when the current chain differs from appChain
  • walletClient now scoped to appChain.id via useWalletClient({ chainId })

Fixed: useBets — Canceled Game State

isCanceled check additionally compares game state against GameState.Canceled as a double-check for edge cases.


Dependencies

  • @azuro-org/toolkit bumped to 6.0.2

Full Changelog: v7.0.2...v7.1.0

v7.0.2

17 Mar 10:10

Choose a tag to compare

fix useSports hook:

  • filter.maxGamesPerLeague: set default games per league limit to 1000 (as it was in previous graphql version)

v7.0.1

17 Mar 10:09

Choose a tag to compare

fix useSports:

  • correctly pass "games per league" limit to API
  • add new prop filter.maxGamesPerLeague, deprecate old filter.limit as it ambiguous

v7.0.0

16 Mar 11:24

Choose a tag to compare

SDK v7.0.0:

  • Major dependency update: Toolkit v6
  • New useSearchGames hook for enhanced game discovery
  • New useBetCalculation hook replaces useMaxBet
  • Full integration with Toolkit v6's REST API methods
  • Removed deprecated useMaxBet hook
  • If used tanstack/query keys of sdk hooks, they are changed (primarily, because there was a graphql url in the key, now it's chain id)
  • useBets is prepared to be used with REST API, that supports order history including preparing orders

Full Changelog: v6.2.3...v7.0.0

Migration Guide

v6.2.2

30 Jan 10:36

Choose a tag to compare

Bump deps:

v6.2.1

25 Dec 09:00

Choose a tag to compare

  • Bump toolkit package version in deps
  • Correct final odds calculation in bet history for v3 combo bets

v6.2.0

15 Dec 12:47

Choose a tag to compare

  • Disabled bet placing if total odds = 1. Added new value TotalOddsTooLow to enum BetslipDisableReason

v6.1.12

15 Dec 12:44

Choose a tag to compare

bump version (fix v6.1.11 published build)