Skip to content

getDataSet

getDataSet(client, options): Promise<OutputType>

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

Get a data set by ID

Use getPdpDataSet instead to get PDP data sets.

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

Promise<OutputType>

Data set info or undefined if the data set does not exist getDataSet.OutputType

Errors getDataSet.ErrorType

import { getDataSet } 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 dataSet = await getDataSet(client, {
dataSetId: 1n,
})
if (dataSet) {
console.log(dataSet.dataSetId)
} else {
console.log('Data set does not exist')
}