Developer Hub
🔮 For applications
Toolkit
Utils
createLiveBet

Sends live bet order.

Usage

import { createLiveBet } from '@azuro-org/toolkit'
 
 
const createdOrder = await createLiveBet({
  account: account.address,
  chainId: appChain.id,
  bet: liveBet,
  signature,
})

Props

{
  chainId: ChainId // liveSupportedChains
  account: Address
  bet: LiveBet
  signature: Hex // signed typed data
}
type LiveBet = {
  attention: string
  affiliate: Address
  core: Address
  amount: string
  chainId: ChainId
  conditionId: string
  outcomeId: number
  minOdds: string
  nonce: string
  expiresAt: number
  relayerFeeAmount: string
}

Return Value

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