Skip to content

warm-storage

Warm Storage Contract Operations

import * as WarmStorage from '@filoz/synapse-core/warm-storage'
NamespaceDescription
addApprovedProvider-
addApprovedProviderCall-
addApprovedProviderSync-
calculateAdditionalLockupRequired-
calculateDepositNeeded-
calculateEffectiveRate-
calculateLifecycleReserveFunding-
calculateUploadFees-
fetchProviderSelectionInput-
getAccountTotalStorageSize-
getAllDataSetMetadata-
getAllDataSetMetadataCall-
getApprovedProviderIds-
getApprovedProviderIdsCall-
getClientDataSetIds-
getClientDataSetIdsCall-
getClientDataSets-
getClientDataSetsCall-
getClientDataSetsLength-
getClientDataSetsLengthCall-
getDataSet-
getDataSetCall-
getDataSetsById-
getPdpDataSet-
getPdpDataSets-
getPriceList-
getPriceListCall-
getUploadCosts-
readAddresses-
removeApprovedProvider-
removeApprovedProviderCall-
removeApprovedProviderSync-
terminateService-
terminateServiceCall-
terminateServiceSync-
InterfaceDescription
PdpDataSetData set information returned from Warm Storage contract
Piece-
ProviderSelectionInputPre-fetched data for provider selection.
ProviderSelectionOptionsOptions for selectProviders(). Combines pre-fetched chain data with selection parameters in a single argument.
ResolvedLocationA resolved provider+dataset pair ready for upload.
SelectionDataSetDataset with piece-presence information used for provider selection.
Type AliasDescription
DataSetInfoData set information returned from Warm Storage contract
PdpDataSetInfo-
FunctionDescription
addApprovedProviderAdd an approved provider for the client
addApprovedProviderCallCreate a call to the addApprovedProvider function
addApprovedProviderSyncAdd an approved provider for the client and wait for confirmation
calculateAdditionalLockupRequiredCompute how much additional lockup an upload of known piece sizes requires.
calculateDepositNeededOrchestrate lockup + lifecycle-reserve replenishment + runway + debt + buffer to compute total deposit needed.
calculateEffectiveRateCalculate the expected FWSS recurring rate for a contract-priced data-set size.
calculateLifecycleReserveFundingCalculate lifecycle-reserve funding for an upload.
calculateUploadFeesCompute the one-time fees an upload incurs.
extractAddApprovedProviderEventExtracts the ProviderApproved event from transaction logs
extractPDPPaymentTerminatedEventExtracts the PDPPaymentTerminated event from transaction logs
extractRemoveApprovedProviderEventExtracts the ProviderUnapproved event from transaction logs
extractTerminateServiceEventExtracts the ServiceTerminated event from transaction logs
fetchProviderSelectionInputFetch all chain data needed for provider selection.
findMatchingDataSetsFind datasets matching the given metadata, sorted by preference.
getAccountTotalStorageSizeGet the total FWSS-priced approximate storage size for an account.
getAllDataSetMetadataGet all metadata for a data set formatted as a MetadataObject
getAllDataSetMetadataCallCreate a call to the getAllDataSetMetadata function
getApprovedProviderIdsGet one bounded page of approved provider IDs.
getApprovedProviderIdsCallCreate a call to the getApprovedProviderIds function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSetIdsGet one bounded page of a client’s data-set IDs.
getClientDataSetIdsCallCreate a call to the getClientDataSetIds function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSetsGet one bounded page of a client’s data sets.
getClientDataSetsCallCreate a call to the getClientDataSets function for use with the Viem multicall, readContract, or simulateContract functions.
getClientDataSetsLengthGet total count of client data sets
getClientDataSetsLengthCallCreate a call to the getClientDataSetsLength function for use with the Viem multicall, readContract, or simulateContract functions.
getDataSetGet a data set by ID
getDataSetCallCreate a call to the getDataSet function for use with the multicall or readContract function.
getDataSetsByIdGet one or more FWSS data sets by ID via a single multicall.
getPdpDataSetGet a PDP data set by ID.
getPdpDataSetsGet one bounded page of enriched PDP data sets.
getPriceListRead the warm storage price list.
getPriceListCallCreate a call to the getPriceList function
getUploadCostsRead-only function that computes upload costs, reserve-aware deposit needed, and approval state.
metadataMatchesCheck if a dataset’s metadata exactly matches the requested metadata.
parseAllDataSetMetadataParse the contract output into a MetadataObject
parseGetDataSetParse the FWSS getDataSet contract result.
readAddressesRead FOC addresses from the Warm Storage contract
readPdpDataSetInfoRead PDP data set information.
removeApprovedProviderRemove an approved provider for the client
removeApprovedProviderCallCreate a call to the removeApprovedProvider function
removeApprovedProviderSyncRemove an approved provider for the client and wait for confirmation
selectProvidersSelect providers for storage from an eligible pool.
terminateServiceTerminate a service (data set)
terminateServiceCallCreate a call to the terminateService function
terminateServiceSyncTerminate 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