Synapse
Synapse SDK - Main entry point
Example
Section titled “Example”import { class Synapse
Synapse, const RPC_URLS: Record<FilecoinNetworkType, { http: string; websocket: string;}>
RPC_URLS } from '@filoz/synapse-sdk'Classes
Section titled “Classes”| Class | Description |
|---|---|
| Synapse | Class for interacting with Filecoin storage and other on-chain services |
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| AuthSignature | Signature data for authenticated operations |
| CreateContextsOptions | - |
| DataSetData | Data set data returned from the API |
| DataSetInfo | Data set information returned from Warm Storage contract |
| DataSetPieceData | Individual data set piece data from API |
| EnhancedDataSetInfo | Enhanced data set information with chain details and clear ID separation |
| PieceRecord | Canonical representation of a piece within a data set. |
| PieceRetriever | PieceRetriever interface for fetching pieces from various sources Returns standard Web API Response objects for flexibility |
| PieceStatus | Status 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. |
| PreflightInfo | Preflight information for storage uploads |
| ProviderInfo | Decoded provider info for SDK use |
| ProviderSelectionResult | Result of provider selection and data set resolution |
| RailInfo | Information about a payment rail |
| SettlementResult | Settlement result from settling a payment rail |
| StorageContextCallbacks | Callbacks for storage service creation process |
| StorageInfo | Comprehensive storage service information |
| StorageOptions | Storage service options |
| StorageServiceOptions | Options for creating or selecting a storage context |
| SubgraphConfig | Configuration for the SubgraphService, determining how to connect to a Synapse-compatible subgraph for provider discovery. |
| SubgraphRetrievalService | Defines the contract for a service that can retrieve provider information from a data source, typically a Synapse-compatible subgraph. |
| SynapseOptions | Options 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 | - |
| UploadOptions | Options for uploading individual pieces to an existing storage context |
| UploadResult | Upload result information |
| UploadTask | Upload task tracking |
Type Aliases
Section titled “Type Aliases”| Type Alias | Description |
|---|---|
| Address | - |
| DataSetId | - |
| DownloadOptions | Download options Currently empty, reserved for future options |
| FilecoinNetworkType | Supported Filecoin network types |
| MetadataEntry | - |
| PieceCID | - |
| PrivateKey | - |
| ServiceProvider | - |
| TokenAmount | - |
| TokenIdentifier | Token identifier for balance queries |
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| CHAIN_IDS | Network chain IDs |
| CONTRACT_ABIS | Contract ABIs |
| CONTRACT_ADDRESSES | Contract addresses |
| EIP2612_PERMIT_TYPES | EIP-2612 typed data schema (Permit) |
| GENESIS_TIMESTAMPS | Genesis timestamps for Filecoin networks (Unix timestamp in seconds) |
| METADATA_KEYS | Common metadata keys |
| RPC_URLS | Recommended RPC endpoints for Filecoin networks |
| SIZE_CONSTANTS | Data size constants |
| TIME_CONSTANTS | Time and size constants |
| TIMING_CONSTANTS | Timing constants for blockchain operations |
| TOKENS | Token identifiers |