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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client |
Client<Transport, Chain> |
The client to use to get the client data set IDs. |
options |
OptionsType |
getClientDataSetIds.OptionsType |
Returns
Section titled “Returns”A page of data set IDs getClientDataSetIds.OutputType
Throws
Section titled “Throws”Errors getClientDataSetIds.ErrorType
Examples
Section titled “Examples”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)
}