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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client | Client<Transport, Chain> | The client to use to get the data set. |
options | OptionsType | getDataSet.OptionsType |
Returns
Section titled “Returns”Data set info or undefined if the data set does not exist getDataSet.OutputType
Throws
Section titled “Throws”Errors getDataSet.ErrorType
Example
Section titled “Example”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')}