Developer Hub
🔮 For applications
SDK
Utils
getPrematchBetDataBytes

Returns the encoded bytes of selections for Prematch bet.

Usage

import { type Selection } from '@azuro-org/sdk'
import { getPrematchBetDataBytes } from '@azuro-org/sdk/utils'
 
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