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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
client |
Client<Transport, Chain> |
The client to use to get the account total storage size. |
options |
OptionsType |
getAccountTotalStorageSize.OptionsType |
Returns
Section titled “Returns”Total storage size and dataset count getAccountTotalStorageSize.OutputType
Example
Section titled “Example”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...',
})