Skip to content

getDataSetSizes

getDataSetSizes(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/pdp-verifier/get-dataset-size.ts:51

Get the sizes of one or more data sets in bytes via a single multicall.

Takes an array of dataset IDs and returns an array of sizes in the same order. Uses multicall internally for efficiency.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use.
optionsOptionsTypegetDataSetSizes.OptionsType

Promise<OutputType>

Array of data set sizes in bytes getDataSetSizes.OutputType

import { getDataSetSizes } 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 sizes = await getDataSetSizes(client, {
dataSetIds: [1n, 2n, 3n],
})
// Single dataset
const [size] = await getDataSetSizes(client, { dataSetIds: [1n] })

Errors getDataSetSizes.ErrorType