Skip to content

getActivePieces

getActivePieces(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/pdp-verifier/get-active-pieces.ts:66

Get active pieces for a data set with pagination

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the active pieces.
optionsOptionsTypegetActivePieces.OptionsType

Promise<OutputType>

The active pieces for the data set getActivePieces.OutputType

import { getActivePieces } 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 [piecesData, pieceIds, hasMore] = await getActivePieces(client, {
dataSetId: 1n,
})

Errors getActivePieces.ErrorType