WarmStorageService
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:54
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WarmStorageService(
options):WarmStorageService
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:65
Create a new WarmStorageService instance
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { client: Client<Transport, Chain, Account>; } | Options for the WarmStorageService |
options.client | Client<Transport, Chain, Account> | Wallet client |
Returns
Section titled “Returns”WarmStorageService
A new WarmStorageService instance
Methods
Section titled “Methods”addApprovedProvider()
Section titled “addApprovedProvider()”addApprovedProvider(
options):Promise<`0x${string}`>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:387
Add an approved provider by ID (owner only)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { providerId: bigint; } | Options for the approved provider addition |
options.providerId | bigint | Provider ID from registry |
Returns
Section titled “Returns”Promise<`0x${string}`>
Transaction response
getAccountTotalStorageSize()
Section titled “getAccountTotalStorageSize()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { address?: `0x${string}`; } | Options for the total storage size query |
options.address? | `0x${string}` | Address to query. Defaults to the client account address. |
Returns
Section titled “Returns”Total storage size and dataset count getAccountTotalStorageSize.OutputType
Throws
Section titled “Throws”Errors getAccountTotalStorageSize.ErrorType
getActivePieceCount()
Section titled “getActivePieceCount()”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)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; } | Options for the data set |
options.dataSetId | bigint | The PDPVerifier data set ID |
Returns
Section titled “Returns”Promise<bigint>
The number of active pieces
getApprovedProviderIds()
Section titled “getApprovedProviderIds()”getApprovedProviderIds():
Promise<OutputType>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:413
Get list of approved provider IDs
Returns
Section titled “Returns”Array of approved provider IDs
getClientDataSetIds()
Section titled “getClientDataSetIds()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { address: `0x${string}`; limit?: bigint; offset?: bigint; } | Options for the client data set IDs |
options.address | `0x${string}` | The client address |
options.limit? | bigint | Maximum number of IDs to return. Use 0n to get all remaining. |
options.offset? | bigint | Starting index (0-based). Use 0n to start from beginning. |
Returns
Section titled “Returns”Array of data set IDs getClientDataSetIds.OutputType
getClientDataSets()
Section titled “getClientDataSets()”getClientDataSets(
options):Promise<OutputType>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:116
Get all data sets for a specific client
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { address: `0x${string}`; limit?: bigint; offset?: bigint; } | Options for the client data sets |
options.address | `0x${string}` | The client address |
options.limit? | bigint | Maximum number of data sets to return. Use 0n to get all remaining. |
options.offset? | bigint | Starting index (0-based). Use 0n to start from beginning. |
Returns
Section titled “Returns”Array of data set information getClientDataSets.OutputType
Throws
Section titled “Throws”Errors getClientDataSets.ErrorType
getClientDataSetsLength()
Section titled “getClientDataSetsLength()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { address: `0x${string}`; } | Options for the client data sets length |
options.address | `0x${string}` | The client address |
Returns
Section titled “Returns”Promise<bigint>
Total count of data sets
getClientDataSetsWithDetails()
Section titled “getClientDataSetsWithDetails()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
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? | boolean | If true, only return data sets managed by this Warm Storage contract. Defaults to false. |
Returns
Section titled “Returns”Promise<EnhancedDataSetInfo[]>
Array of enhanced data set information EnhancedDataSetInfo
getDataSet()
Section titled “getDataSet()”getDataSet(
options):Promise<OutputType>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:103
Get a single data set by ID
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; } | Options for the data set |
options.dataSetId | bigint | The data set ID to retrieve |
Returns
Section titled “Returns”Data set information getDataSet.OutputType
Throws
Section titled “Throws”Errors getDataSet.ErrorType
getDataSetMetadata()
Section titled “getDataSetMetadata()”getDataSetMetadata(
options):Promise<MetadataObject>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:304
Get all metadata for a data set
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; } | Options for the data set |
options.dataSetId | bigint | The data set ID |
Returns
Section titled “Returns”Object with metadata key-value pairs
getDataSetMetadataByKey()
Section titled “getDataSetMetadataByKey()”getDataSetMetadataByKey(
options):Promise<string|null>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:316
Get specific metadata key for a data set
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; key: string; } | Options for the data set |
options.dataSetId | bigint | The data set ID |
options.key | string | The metadata key to retrieve |
Returns
Section titled “Returns”Promise<string | null>
The metadata value if it exists, null otherwise
getOwner()
Section titled “getOwner()”getOwner():
Promise<`0x${string}`>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:436
Get the contract owner address
Returns
Section titled “Returns”Promise<`0x${string}`>
Owner address
getPDPConfig()
Section titled “getPDPConfig()”getPDPConfig():
Promise<{challengesPerProof:bigint;challengeWindowSize:bigint;initChallengeWindowStart:bigint;maxProvingPeriod:bigint; }>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:459
Get the PDP config from the WarmStorage contract. Returns maxProvingPeriod, challengeWindowSize, challengesPerProof, initChallengeWindowStart
Returns
Section titled “Returns”Promise<{ challengesPerProof: bigint; challengeWindowSize: bigint; initChallengeWindowStart: bigint; maxProvingPeriod: bigint; }>
getPieceMetadata()
Section titled “getPieceMetadata()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; pieceId: bigint; } | Options for the piece |
options.dataSetId | bigint | The data set ID |
options.pieceId | bigint | The piece ID |
Returns
Section titled “Returns”Object with metadata key-value pairs
getPieceMetadataByKey()
Section titled “getPieceMetadataByKey()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; key: string; pieceId: bigint; } | Options for the piece |
options.dataSetId | bigint | The data set ID |
options.key | string | The metadata key to retrieve |
options.pieceId | bigint | The piece ID |
Returns
Section titled “Returns”Promise<string | null>
The metadata value if it exists, null otherwise
getServicePrice()
Section titled “getServicePrice()”getServicePrice():
Promise<OutputType>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:363
Get the current service price per TiB per month
Returns
Section titled “Returns”Service price information for both CDN and non-CDN options
isOwner()
Section titled “isOwner()”isOwner(
options):Promise<boolean>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:450
Check if an address is the contract owner
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { address: `0x${string}`; } | Options for the owner check |
options.address | `0x${string}` | Address to check |
Returns
Section titled “Returns”Promise<boolean>
Whether the address is the owner
isProviderIdApproved()
Section titled “isProviderIdApproved()”isProviderIdApproved(
options):Promise<boolean>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:423
Check if a provider ID is approved
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { providerId: bigint; } | Options for the provider ID approval check |
options.providerId | bigint | Provider ID to check |
Returns
Section titled “Returns”Promise<boolean>
Whether the provider is approved
removeApprovedProvider()
Section titled “removeApprovedProvider()”removeApprovedProvider(
options):Promise<`0x${string}`>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:397
Remove an approved provider by ID (owner only)
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { providerId: bigint; } | Options for the approved provider removal |
options.providerId | bigint | Provider ID from registry |
Returns
Section titled “Returns”Promise<`0x${string}`>
Transaction response
terminateDataSet()
Section titled “terminateDataSet()”terminateDataSet(
options):Promise<`0x${string}`>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:375
Terminate a data set with given ID
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; } | Options for the data set termination |
options.dataSetId | bigint | ID of the data set to terminate |
Returns
Section titled “Returns”Promise<`0x${string}`>
Transaction receipt
topUpCDNPaymentRails()
Section titled “topUpCDNPaymentRails()”topUpCDNPaymentRails(
options):Promise<`0x${string}`>
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:493
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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { cacheMissAmountToAdd: bigint; cdnAmountToAdd: bigint; dataSetId: bigint; } | Options for the top up CDN payment rails |
options.cacheMissAmountToAdd | bigint | Amount to add to the cache miss rail lockup |
options.cdnAmountToAdd | bigint | Amount to add to the CDN rail lockup |
options.dataSetId | bigint | The ID of the data set |
Returns
Section titled “Returns”Promise<`0x${string}`>
Transaction response Hash
validateDataSet()
Section titled “validateDataSet()”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
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { dataSetId: bigint; } | Options for the data set |
options.dataSetId | bigint | The PDPVerifier data set ID |
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if dataset is not valid for operations
create()
Section titled “create()”
staticcreate(options):WarmStorageService
Defined in: packages/synapse-sdk/src/warm-storage/service.ts:79
Create a new WarmStorageService with pre-configured client
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options | { account: Account; chain?: Chain; transport?: Transport; } | Options for the WarmStorageService |
options.account | Account | Viem account (required) |
options.chain? | Chain | Filecoin chain (optional, defaults to DEFAULT_CHAIN) |
options.transport? | Transport | Viem transport (optional, defaults to http()) |
Returns
Section titled “Returns”WarmStorageService
A new WarmStorageService instance