Developer Hub
🔮 For applications
SDK
Providers
AzuroSDK

The AzuroSDKProvider serves as the central component that encompasses all providers:

Usage

Wrap your application in AzuroSDKProvider.

import { AzuroSDKProvider } from '@azuro-org/sdk'
import { WagmiProvider, createConfig } from 'wagmi'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { polygonAmoy } from 'viem/chains'
 
 
const wagmiConfig = createConfig(config)
const queryClient = new QueryClient() 
 
function Providers(props: { children: React.ReactNode }) {
  const { children } = props
 
  return (
    <WagmiProvider config={wagmiConfig}>
      <QueryClientProvider client={queryClient}> 
        <AzuroSDKProvider initialChainId={polygonAmoy.id} initialLiveState={true}>
          {children}
        </AzuroSDKProvider>
      </QueryClientProvider>
    </WagmiProvider>
  )
}
⚠️

The AzuroSDKProvider requires access to the Wagmi context.

Following the setup, you gain access to all the data provided by the providers:

import { useChain, useLive, useApolloClients, useSocket, useBaseBetslip, useDetailedBetslip } from '@azuro-org/sdk'
 
const { ... } = useChain()
const { ... } = useLive()
const { ... } = useApolloClients()
const { ... } = useSocket()
const { ... } = useBaseBetslip()
const { ... } = useDetailedBetslip()

Props

{
  children: React.ReactNode
  initialChainId: ChainId // your initial chain id
  initialLiveState?: boolean // enable/disable live by default
}
type ChainId =  100 | 137 | 80001