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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use. |
options | OptionsType | getDataSetSizes.OptionsType |
Returns
Section titled “Returns”Array of data set sizes in bytes getDataSetSizes.OutputType
Example
Section titled “Example”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 datasetconst [size] = await getDataSetSizes(client, { dataSetIds: [1n] })Throws
Section titled “Throws”Errors getDataSetSizes.ErrorType