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

Sends live bet order.

Usage

import { getComboBetTypedData, createBet } from '@azuro-org/toolkit'
 
 
const typedData = getComboBetTypedData({
  account: '0xlkns...',
  minOdds: '...',
  amount: '...',
  nonce: '...',
  clientData: {...},
  bets: [ {...}, {...} ],
})
 
const signature = await walletClient.data.signTypedData(typedData)
 
const createdOrder = await createBet({
  account: '0xlkns...',
  minOdds: '...',
  amount: '...',
  nonce: '...',
  clientData: {...},
  bets: [ {...}, {...} ],
  signature,
})

Props

{
  account: Address
  amount: string | bigint
  minOdds: string | bigint
  nonce: string | number | bigint
  clientData: BetClientData
  bets: {
    conditionId: string | bigint
    outcomeId: string | number | bigint
  }[]
  signature: Hex // signed typed data
}
type BetClientData = {
  attention: string
  affiliate: Address
  core: Address
  expiresAt: number
  chainId: ChainId
  relayerFeeAmount: string
  isBetSponsored: boolean
  isFeeSponsored: boolean
  isSponsoredBetReturnable: boolean
}

Return Value

type CreateLiveBetResponse = {
  id: string
  state: BetState
  errorMessage?: string
  error?: string
}
 
enum LiveBetState {
  Created = 'Created',
  Pending = 'Pending',
  Sent = 'Sent',
  Accepted = 'Accepted',
  Rejected = 'Rejected'
}