Skip to content

getAccountTotalStorageSize

getAccountTotalStorageSize(client, options): Promise<OutputType>

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

Get the total FWSS-priced approximate storage size for an account.

Fetches all datasets for the given address from FWSS, checks liveness via PDP Verifier, converts each aggregate data-set leaf count using the same approximation as FWSS pricing, and sums the results. This is not the exact sum of raw piece payload sizes.

ParameterTypeDescription
clientClient<Transport, Chain>The client to use to get the account total storage size.
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