Developer Hub
🔮 For applications
Toolkit
Utils
getPrematchBetDataBytes

Returns the encoded bytes of selections for Prematch bet.

Usage

import { type Selection, getPrematchBetDataBytes } from '@azuro-org/toolkit'
 
const selections: Selection = [...]
 
const selectionsData = await getPrematchBetDataBytes(selections)
 
const prematchBetArguments = [
  lpAddress,
  [
    {
      core,
      amount,
      expiresAt,
      extraData: {
        affiliate,
        minOdds,
        data: selectionsData,
      },
    },
  ]
]

Props

selections: Selection[]

type Selection = {
  outcomeId: string
  conditionId: string
  coreAddress: string
}

Return Value

Hex