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.

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

Promise<OutputType>

Data set info or null 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')
}