Skip to content

getPdpDataSet

getPdpDataSet(client, options): Promise<OutputType>

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

Get a PDP data set by ID

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

Promise<OutputType>

PDP data set or undefined if the data set does not exist getPdpDataSet.OutputType

Errors getPdpDataSet.ErrorType

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