Skip to content

Synapse

Synapse SDK - Main entry point

import {
class Synapse
Synapse
,
const RPC_URLS: Record<FilecoinNetworkType, {
http: string;
websocket: string;
}>
RPC_URLS
} from '@filoz/synapse-sdk'
ClassDescription
SynapseClass for interacting with Filecoin storage and other on-chain services
InterfaceDescription
AuthSignatureSignature data for authenticated operations
CreateContextsOptions-
DataSetDataData set data returned from the API
DataSetInfoData set information returned from Warm Storage contract
DataSetPieceDataIndividual data set piece data from API
EnhancedDataSetInfoEnhanced data set information with chain details and clear ID separation
PieceRecordCanonical representation of a piece within a data set.
PieceRetrieverPieceRetriever interface for fetching pieces from various sources Returns standard Web API Response objects for flexibility
PieceStatusStatus information for a piece stored on a provider Note: Proofs are submitted for entire data sets, not individual pieces. The timing information reflects the data set’s status.
PreflightInfoPreflight information for storage uploads
ProviderInfoDecoded provider info for SDK use
ProviderSelectionResultResult of provider selection and data set resolution
RailInfoInformation about a payment rail
SettlementResultSettlement result from settling a payment rail
StorageContextCallbacksCallbacks for storage service creation process
StorageInfoComprehensive storage service information
StorageOptionsStorage service options
StorageServiceOptionsOptions for creating or selecting a storage context
SubgraphConfigConfiguration for the SubgraphService, determining how to connect to a Synapse-compatible subgraph for provider discovery.
SubgraphRetrievalServiceDefines the contract for a service that can retrieve provider information from a data source, typically a Synapse-compatible subgraph.
SynapseOptionsOptions for initializing the Synapse instance Must provide one of: 1. privateKey + rpcURL (for server environments) 2. provider (for browser environments - user handles MetaMask coupling) 3. signer (for direct ethers.js integration)
UploadCallbacks-
UploadOptionsOptions for uploading individual pieces to an existing storage context
UploadResultUpload result information
UploadTaskUpload task tracking
Type AliasDescription
Address-
DataSetId-
DownloadOptionsDownload options Currently empty, reserved for future options
FilecoinNetworkTypeSupported Filecoin network types
MetadataEntry-
PieceCID-
PrivateKey-
ServiceProvider-
TokenAmount-
TokenIdentifierToken identifier for balance queries
VariableDescription
CHAIN_IDSNetwork chain IDs
CONTRACT_ABISContract ABIs
CONTRACT_ADDRESSESContract addresses
EIP2612_PERMIT_TYPESEIP-2612 typed data schema (Permit)
GENESIS_TIMESTAMPSGenesis timestamps for Filecoin networks (Unix timestamp in seconds)
METADATA_KEYSCommon metadata keys
RPC_URLSRecommended RPC endpoints for Filecoin networks
SIZE_CONSTANTSData size constants
TIME_CONSTANTSTime and size constants
TIMING_CONSTANTSTiming constants for blockchain operations
TOKENSToken identifiers