Skip to content

WarmStorageService

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:52

new WarmStorageService(options): WarmStorageService

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:63

Create a new WarmStorageService instance

ParameterTypeDescription
options{ client: Client<Transport, Chain, Account>; }Options for the WarmStorageService
options.clientClient<Transport, Chain, Account>Wallet client

WarmStorageService

A new WarmStorageService instance

addApprovedProvider(options): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:356

Add an approved provider by ID (owner only)

ParameterTypeDescription
options{ providerId: bigint; }Options for the approved provider addition
options.providerIdbigintProvider ID from registry

Promise<`0x${string}`>

Transaction response


getAccountTotalStorageSize(options?): Promise<OutputType>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:204

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

ParameterTypeDescription
options{ address?: `0x${string}`; }Options for the total storage size query
options.address?`0x${string}`Address to query. Defaults to the client account address.

Promise<OutputType>

Total storage size and dataset count getAccountTotalStorageSize.OutputType

Errors getAccountTotalStorageSize.ErrorType


getActivePieceCount(options): Promise<bigint>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:260

Get the count of active pieces in a dataset (excludes removed pieces)

ParameterTypeDescription
options{ dataSetId: bigint; }Options for the data set
options.dataSetIdbigintThe PDPVerifier data set ID

Promise<bigint>

The number of active pieces


getApprovedProviderIds(): Promise<OutputType>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:382

Get list of approved provider IDs

Promise<OutputType>

Array of approved provider IDs


getClientDataSets(options): Promise<OutputType>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:112

Get all data sets for a specific client

ParameterTypeDescription
options{ address: `0x${string}`; }Options for the client data sets
options.address`0x${string}`The client address

Promise<OutputType>

Array of data set information getClientDataSets.OutputType

Errors getClientDataSets.ErrorType


getClientDataSetsWithDetails(options): Promise<EnhancedDataSetInfo[]>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:124

Get all data sets for a client with enhanced details This includes live status and management information

ParameterTypeDescription
options{ address?: `0x${string}`; onlyManaged?: boolean; }Options for the client data sets
options.address?`0x${string}`The client address. Defaults to the client account address.
options.onlyManaged?booleanIf true, only return data sets managed by this Warm Storage contract. Defaults to false.

Promise<EnhancedDataSetInfo[]>

Array of enhanced data set information EnhancedDataSetInfo


getDataSet(options): Promise<OutputType>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:101

Get a single data set by ID

ParameterTypeDescription
options{ dataSetId: bigint; }Options for the data set
options.dataSetIdbigintThe data set ID to retrieve

Promise<OutputType>

Data set information getDataSet.OutputType

Errors getDataSet.ErrorType


getDataSetMetadata(options): Promise<MetadataObject>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:273

Get all metadata for a data set

ParameterTypeDescription
options{ dataSetId: bigint; }Options for the data set
options.dataSetIdbigintThe data set ID

Promise<MetadataObject>

Object with metadata key-value pairs


getDataSetMetadataByKey(options): Promise<string | null>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:285

Get specific metadata key for a data set

ParameterTypeDescription
options{ dataSetId: bigint; key: string; }Options for the data set
options.dataSetIdbigintThe data set ID
options.keystringThe metadata key to retrieve

Promise<string | null>

The metadata value if it exists, null otherwise


getOwner(): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:405

Get the contract owner address

Promise<`0x${string}`>

Owner address


getPDPConfig(): Promise<{ challengesPerProof: bigint; challengeWindowSize: bigint; initChallengeWindowStart: bigint; maxProvingPeriod: bigint; }>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:428

Get the PDP config from the WarmStorage contract. Returns maxProvingPeriod, challengeWindowSize, challengesPerProof, initChallengeWindowStart

Promise<{ challengesPerProof: bigint; challengeWindowSize: bigint; initChallengeWindowStart: bigint; maxProvingPeriod: bigint; }>


getPieceMetadata(options): Promise<MetadataObject>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:303

Get all metadata for a piece in a data set

ParameterTypeDescription
options{ dataSetId: bigint; pieceId: bigint; }Options for the piece
options.dataSetIdbigintThe data set ID
options.pieceIdbigintThe piece ID

Promise<MetadataObject>

Object with metadata key-value pairs


getPieceMetadataByKey(options): Promise<string | null>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:316

Get specific metadata key for a piece in a data set

ParameterTypeDescription
options{ dataSetId: bigint; key: string; pieceId: bigint; }Options for the piece
options.dataSetIdbigintThe data set ID
options.keystringThe metadata key to retrieve
options.pieceIdbigintThe piece ID

Promise<string | null>

The metadata value if it exists, null otherwise


getServicePrice(): Promise<OutputType>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:332

Get the current service price per TiB per month

Promise<OutputType>

Service price information for both CDN and non-CDN options


isOwner(options): Promise<boolean>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:419

Check if an address is the contract owner

ParameterTypeDescription
options{ address: `0x${string}`; }Options for the owner check
options.address`0x${string}`Address to check

Promise<boolean>

Whether the address is the owner


isProviderIdApproved(options): Promise<boolean>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:392

Check if a provider ID is approved

ParameterTypeDescription
options{ providerId: bigint; }Options for the provider ID approval check
options.providerIdbigintProvider ID to check

Promise<boolean>

Whether the provider is approved


removeApprovedProvider(options): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:366

Remove an approved provider by ID (owner only)

ParameterTypeDescription
options{ providerId: bigint; }Options for the approved provider removal
options.providerIdbigintProvider ID from registry

Promise<`0x${string}`>

Transaction response


terminateDataSet(options): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:344

Terminate a data set with given ID

ParameterTypeDescription
options{ dataSetId: bigint; }Options for the data set termination
options.dataSetIdbigintID of the data set to terminate

Promise<`0x${string}`>

Transaction receipt


topUpCDNPaymentRails(options): Promise<`0x${string}`>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:462

Increments the fixed locked-up amounts for CDN payment rails.

This method tops up the prepaid balance for CDN services by adding to the existing lockup amounts. Both CDN and cache miss rails can be incremented independently.

ParameterTypeDescription
options{ cacheMissAmountToAdd: bigint; cdnAmountToAdd: bigint; dataSetId: bigint; }Options for the top up CDN payment rails
options.cacheMissAmountToAddbigintAmount to add to the cache miss rail lockup
options.cdnAmountToAddbigintAmount to add to the CDN rail lockup
options.dataSetIdbigintThe ID of the data set

Promise<`0x${string}`>

Transaction response Hash


validateDataSet(options): Promise<void>

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:223

Validate that a dataset is live and managed by this WarmStorage contract

Performs validation checks in parallel:

  • Dataset exists and is live
  • Dataset is managed by this WarmStorage contract
ParameterTypeDescription
options{ dataSetId: bigint; }Options for the data set
options.dataSetIdbigintThe PDPVerifier data set ID

Promise<void>

if dataset is not valid for operations


static create(options): WarmStorageService

Defined in: packages/synapse-sdk/src/warm-storage/service.ts:77

Create a new WarmStorageService with pre-configured client

ParameterTypeDescription
options{ account: Account; chain?: Chain; transport?: Transport; }Options for the WarmStorageService
options.accountAccountViem account (required)
options.chain?ChainFilecoin chain (optional, defaults to DEFAULT_CHAIN)
options.transport?TransportViem transport (optional, defaults to http())

WarmStorageService

A new WarmStorageService instance