Skip to content

WarmStorageService

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

new WarmStorageService(options): WarmStorageService

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

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

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

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

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

Get list of approved provider IDs

Promise<OutputType>

Array of approved provider IDs


getClientDataSetIds(options): Promise<OutputType>

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

Get data set IDs for a specific client with optional pagination

ParameterTypeDescription
options{ address: `0x${string}`; limit?: bigint; offset?: bigint; }Options for the client data set IDs
options.address`0x${string}`The client address
options.limit?bigintMaximum number of IDs to return. Use 0n to get all remaining.
options.offset?bigintStarting index (0-based). Use 0n to start from beginning.

Promise<OutputType>

Array of data set IDs getClientDataSetIds.OutputType


getClientDataSets(options): Promise<OutputType>

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

Get all data sets for a specific client

ParameterTypeDescription
options{ address: `0x${string}`; limit?: bigint; offset?: bigint; }Options for the client data sets
options.address`0x${string}`The client address
options.limit?bigintMaximum number of data sets to return. Use 0n to get all remaining.
options.offset?bigintStarting index (0-based). Use 0n to start from beginning.

Promise<OutputType>

Array of data set information getClientDataSets.OutputType

Errors getClientDataSets.ErrorType


getClientDataSetsLength(options): Promise<bigint>

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

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

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

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

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

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

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

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

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

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

Get the current warm storage price list.

Promise<OutputType>

Recurring rates, operation fees, and lockups.


isOwner(options): Promise<boolean>

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

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

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

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

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

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

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

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