Skip to content

getDataSetLeafCount

getDataSetLeafCount(client, options): Promise<bigint>

Defined in: packages/synapse-core/src/pdp-verifier/get-data-set-leaf-count.ts:41

Get the leaf count for a data set

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the data set leaf count.
optionsOptionsTypegetDataSetLeafCount.OptionsType

Promise<bigint>

The leaf count for the data set getDataSetLeafCount.OutputType

import { getDataSetLeafCount } 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 leafCount = await getDataSetLeafCount(client, { dataSetId: 1n })

Errors getDataSetLeafCount.ErrorType