Skip to content

getDataSetsById

getDataSetsById(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/warm-storage/get-data-sets-by-id.ts:50

Get one or more FWSS data sets by ID via a single multicall.

Duplicate IDs are read once and empty input returns an empty map. Every requested ID is present in the result; a non-existent data set maps to null, matching getDataSet.

Parameter Type Description
client Client<Transport, Chain> The client to use to get the data sets
options OptionsType getDataSetsById.OptionsType

Promise<OutputType>

Data-set information indexed by ID getDataSetsById.OutputType

Errors getDataSetsById.ErrorType

import { getDataSetsById } from '@filoz/synapse-core/warm-storage'
import { calibration } from '@filoz/synapse-core/chains'
import { createPublicClient, http } from 'viem'

const client = createPublicClient({
  chain: calibration,
  transport: http(),
})

const dataSets = await getDataSetsById(client, {
  dataSetIds: [1n, 2n],
})

console.log(dataSets.get(1n))