Skip to content

warm-storage

Warm Storage Contract Operations

import * as WarmStorage from '@filoz/synapse-core/warm-storage'
Namespace Description
addApprovedProvider -
addApprovedProviderCall -
addApprovedProviderSync -
calculateAdditionalLockupRequired -
calculateDepositNeeded -
calculateEffectiveRate -
calculateLifecycleReserveFunding -
calculateUploadFees -
estimateOnboardingCost -
estimateStorageCost -
fetchProviderSelectionInput -
getAccountTotalStorageSize -
getAddPiecesResult -
getAllDataSetMetadata -
getAllDataSetMetadataCall -
getApprovedProviderIds -
getApprovedProviderIdsCall -
getClientDataSetIds -
getClientDataSetIdsCall -
getClientDataSets -
getClientDataSetsCall -
getClientDataSetsLength -
getClientDataSetsLengthCall -
getClientNonce -
getClientNonceCall -
getCreateDataSetAndAddPiecesResult -
getCreateDataSetResult -
getDataSet -
getDataSetCall -
getDataSetsById -
getPdpDataSet -
getPdpDataSets -
getPriceList -
getPriceListCall -
getUploadCosts -
readAddresses -
removeApprovedProvider -
removeApprovedProviderCall -
removeApprovedProviderSync -
terminateService -
terminateServiceCall -
terminateServiceSync -
Interface Description
PdpDataSet Data set information returned from Warm Storage contract
Piece -
ProviderSelectionInput Pre-fetched data for provider selection.
ProviderSelectionOptions Options for selectProviders(). Combines pre-fetched chain data with selection parameters in a single argument.
ResolvedLocation A resolved provider+dataset pair ready for upload.
SelectionDataSet Dataset with piece-presence information used for provider selection.
Type Alias Description
DataSetInfo Data set information returned from Warm Storage contract
PdpDataSetInfo -
Function Description
addApprovedProvider Add an approved provider for the client
addApprovedProviderCall Create a call to the addApprovedProvider function
addApprovedProviderSync Add an approved provider for the client and wait for confirmation
calculateAdditionalLockupRequired Compute how much additional lockup an upload of known piece sizes requires.
calculateDepositNeeded Orchestrate lockup + lifecycle-reserve replenishment + runway + debt + buffer to compute total deposit needed.
calculateEffectiveRate Calculate the expected FWSS recurring rate for a contract-priced data-set size.
calculateLifecycleReserveFunding Calculate lifecycle-reserve funding for an upload.
calculateUploadFees Compute the one-time fees an upload incurs.
estimateOnboardingCost Estimate what it costs to bring data onto FWSS, without a wallet or account state.
estimateStorageCost Estimate what it costs to keep data on FWSS for a period of time, without a wallet or account state.
extractAddApprovedProviderEvent Extracts the ProviderApproved event from transaction logs
extractPDPPaymentTerminatedEvent Extracts the PDPPaymentTerminated event from transaction logs
extractRemoveApprovedProviderEvent Extracts the ProviderUnapproved event from transaction logs
extractTerminateServiceEvent Extracts the ServiceTerminated event from transaction logs
fetchProviderSelectionInput Fetch all chain data needed for provider selection.
findMatchingDataSets Find datasets matching the given metadata, sorted by preference.
getAccountTotalStorageSize Get the total FWSS-priced approximate storage size for an account.
getAddPiecesResult Check on chain whether an add pieces submission landed, without the SP or any transaction hash.
getAllDataSetMetadata Get all metadata for a data set formatted as a MetadataObject
getAllDataSetMetadataCall Create a call to the getAllDataSetMetadata function
getApprovedProviderIds Get one bounded page of approved provider IDs.
getApprovedProviderIdsCall Create a call to the getApprovedProviderIds function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSetIds Get one bounded page of a client’s data-set IDs.
getClientDataSetIdsCall Create a call to the getClientDataSetIds function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSets Get one bounded page of a client’s data sets.
getClientDataSetsCall Create a call to the getClientDataSets function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSetsLength Get total count of client data sets
getClientDataSetsLengthCall Create a call to the getClientDataSetsLength function for use with the Viem multicall, readContract, or simulateContract functions.
getClientNonce Read the raw value FWSS stores for a used replay-protection nonce.
getClientNonceCall Create a call to the getClientNonce function for use with the Viem multicall, readContract, or simulateContract functions.
getCreateDataSetAndAddPiecesResult Check on chain whether a create data set and add pieces submission landed, without the SP or any transaction hash.
getCreateDataSetResult Check on chain whether a create data set submission landed, without the SP or any transaction hash.
getDataSet Get a data set by ID
getDataSetCall Create a call to the getDataSet function for use with the multicall or readContract function.
getDataSetsById Get one or more FWSS data sets by ID via a single multicall.
getPdpDataSet Get a PDP data set by ID.
getPdpDataSets Get one bounded page of enriched PDP data sets.
getPriceList Read the warm storage price list.
getPriceListCall Create a call to the getPriceList function
getUploadCosts Read-only function that computes upload costs, reserve-aware deposit needed, and approval state.
metadataMatches Check if a dataset’s metadata exactly matches the requested metadata.
parseAllDataSetMetadata Parse the contract output into a MetadataObject
parseGetDataSet Parse the FWSS getDataSet contract result.
readAddresses Read FOC addresses from the Warm Storage contract
readPdpDataSetInfo Read PDP data set information.
removeApprovedProvider Remove an approved provider for the client
removeApprovedProviderCall Create a call to the removeApprovedProvider function
removeApprovedProviderSync Remove an approved provider for the client and wait for confirmation
selectProviders Select providers for storage from an eligible pool.
terminateService Terminate a service (data set)
terminateServiceCall Create a call to the terminateService function
terminateServiceSync Terminate a service (data set) and wait for confirmation

Re-exports datasetMetadataObjectToEntry


Re-exports METADATA_LIMITS


Re-exports MetadataArray


Re-exports metadataArrayToObject


Re-exports MetadataDataSetInternal


Re-exports MetadataEntry


Re-exports MetadataObject


Re-exports MetadataPieceInternal


Re-exports pieceMetadataObjectToEntry