Skip to content

getNextChallengeEpoch

getNextChallengeEpoch(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/pdp-verifier/get-next-challenge-epoch.ts:62

Get next challenge epoch

Parameter Type Description
client Client<Transport, Chain> The client to use to get the next challenge epoch.
options OptionsType getNextChallengeEpoch.OptionsType

Promise<OutputType>

The next challenge epoch for the data set getNextChallengeEpoch.OutputType. Returns null if the data set is not live or no challenge epoch has been set.

import { getNextChallengeEpoch } from '@filoz/synapse-core/pdp-verifier'
import { calibration } from '@filoz/synapse-core/chains'
import { createPublicClient, http } from 'viem'

const client = createPublicClient({
  chain: calibration,
  transport: http(),
})

const nextChallengeEpoch = await getNextChallengeEpoch(client, {
  dataSetId: 1n,
})

Errors getNextChallengeEpoch.ErrorType