Skip to content

getAccountTotalStorageSize

getAccountTotalStorageSize(client, options): Promise<OutputType>

Defined in: packages/synapse-core/src/warm-storage/get-account-total-storage-size.ts:55

Get the total storage size across all live datasets for an account.

Fetches all datasets for the given address from FWSS, checks liveness via PDP Verifier, and sums the sizes of live datasets.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use.
optionsOptionsTypegetAccountTotalStorageSize.OptionsType

Promise<OutputType>

Total storage size and dataset count getAccountTotalStorageSize.OutputType

import { getAccountTotalStorageSize } 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 { totalSizeBytes, datasetCount } = await getAccountTotalStorageSize(client, {
address: '0x...',
})

Errors getAccountTotalStorageSize.ErrorType