Skip to content

WarmStorageService

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

new WarmStorageService(options): WarmStorageService

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

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:396

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:230

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:286

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<bigint[]>

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

Get list of approved provider IDs

Promise<bigint[]>

Array of approved provider IDs


getClientDataSetIds(options): Promise<OutputType>

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

Get data set IDs for a specific client with optional pagination

ParameterTypeDescription
optionsPaginationOptions & objectOptions for the client data set IDs

Promise<OutputType>

A page of data set IDs getClientDataSetIds.OutputType


getClientDataSets(options): Promise<OutputType>

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

Get one bounded page of data sets for a specific client

ParameterTypeDescription
optionsPaginationOptions & objectOptions for the client data sets

Promise<OutputType>

A page of data set information getClientDataSets.OutputType

Errors getClientDataSets.ErrorType


getClientDataSetsLength(options): Promise<bigint>

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

Get total count of data sets for a specific client

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

Promise<bigint>

Total count of data sets


getClientDataSetsWithDetails(options): Promise<EnhancedDataSetInfo[]>

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

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:106

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:311

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:323

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:445

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:468

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:341

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:354

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


getPriceList(): Promise<OutputType>

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

Get the current warm storage price list.

Promise<OutputType>

Recurring rates, operation fees, and lockups.


hasActivePieces(options): Promise<boolean>

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

Report whether a data set has at least one active piece.

Uses the contract’s dedicated active-piece count rather than paginating pieces.

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

Promise<boolean>

True when the data set has at least one active piece


isOwner(options): Promise<boolean>

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

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:432

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:406

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


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

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

Terminate the storage service by submitting the transaction on-chain directly. The service and its payments run to the end of the lockup period. For provider-relayed (immediate) termination use StorageManager.terminateService.

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

Promise<`0x${string}`>

Transaction hash


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

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

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:249

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:82

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