Skip to content

getClientDataSets

getClientDataSets(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/warm-storage/get-client-data-sets.ts:84

Get one bounded page of a client’s data sets.

Pass the returned nextCursor back as cursor; treat it as opaque. Use paginate to traverse every page. Use getPdpDataSets when the enriched PDP data-set representation is required.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get data sets for a client address.
optionsOptionsTypegetClientDataSets.OptionsType

Promise<OutputType>

A page of data set info entries getClientDataSets.OutputType

Errors getClientDataSets.ErrorType

Read the first page

import { getClientDataSets } from '@filoz/synapse-core/warm-storage'
import { createPublicClient, http } from 'viem'
import { calibration } from '@filoz/synapse-core/chains'
const client = createPublicClient({
chain: calibration,
transport: http(),
})
const address = '0x0000000000000000000000000000000000000000'
const page = await getClientDataSets(client, { address })
console.log(page.items, page.nextCursor)

Iterate over every page

import { paginate } from '@filoz/synapse-core'
import { getClientDataSets } from '@filoz/synapse-core/warm-storage'
for await (const dataSet of paginate(({ cursor }) =>
getClientDataSets(client, { address, cursor })
)) {
console.log(dataSet.dataSetId)
}