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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client |
Client<Transport, Chain> |
The client to use to get the data sets |
options |
OptionsType |
getDataSetsById.OptionsType |
Returns
Section titled “Returns”Data-set information indexed by ID getDataSetsById.OutputType
Throws
Section titled “Throws”Errors getDataSetsById.ErrorType
Example
Section titled “Example”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))