Skip to content

getClientDataSetIds

getClientDataSetIds(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/warm-storage/get-client-data-set-ids.ts:82

Get one bounded page of a client’s data-set IDs.

Pass the returned nextCursor back as cursor; treat it as opaque. Use paginate to traverse every page. limit must be greater than zero.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the client data set IDs.
optionsOptionsTypegetClientDataSetIds.OptionsType

Promise<OutputType>

A page of data set IDs getClientDataSetIds.OutputType

Errors getClientDataSetIds.ErrorType

Read the first page

import { getClientDataSetIds } 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 getClientDataSetIds(client, { address })
console.log(page.items, page.nextCursor)

Iterate over every page

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