getPiecesWithMetadata
getPiecesWithMetadata(
client,options):Promise<OutputType>
Defined in: packages/synapse-core/src/pdp-verifier/get-pieces.ts:147
Get pieces with metadata for a data set with pagination
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the active pieces. |
options | { address: `0x${string}`; contractAddress?: `0x${string}`; dataSet: PdpDataSet; limit?: bigint; offset?: bigint; } | getPiecesWithMetadata.OptionsType |
options.address | `0x${string}` | The address of the user. |
options.contractAddress? | `0x${string}` | PDP Verifier contract address. If not provided, the default is the PDP Verifier contract address for the chain. |
options.dataSet | PdpDataSet | The data set to get the pieces from. |
options.limit? | bigint | The limit for pagination. Default 100n |
options.offset? | bigint | The offset for pagination. Default 0n |
Returns
Section titled “Returns”The active pieces for the data set getPiecesWithMetadata.OutputType
Example
Section titled “Example”import { getPiecesWithMetadata } 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 getPiecesWithMetadata(client, { dataSetId: 1n,})