getNextPieceId
getNextPieceId(
client,options):Promise<bigint>
Defined in: packages/synapse-core/src/pdp-verifier/get-next-piece-id.ts:46
Get the next piece ID for a data set
Total pieces ever added; does not decrease when pieces are removed
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client |
Client<Transport, Chain> |
The client to use to get the next piece ID. |
options |
OptionsType |
getNextPieceId.OptionsType |
Returns
Section titled “Returns”Promise<bigint>
The next piece ID for the data set getNextPieceId.OutputType
Example
Section titled “Example”import { getNextPieceId } 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 nextPieceId = await getNextPieceId(client, { dataSetId: 1n })Throws
Section titled “Throws”Errors getNextPieceId.ErrorType