Installation
- Solana (SOL)
- Filecoin (USDFC)
Works with any Solana wallet adapter (Phantom, Solflare, Ledger, etc.)
Basic Usage
Import and use the SDK in your React component:Environment Types
The SDK supports three environments:Core Methods
The SDK provides a couple of methods (we’ll add more as we see fit, in the future):estimateStorageCost
Calculate upload costs before committing
createDeposit
Upload files and create onchain deposit
getSolPrice
Get real-time SOL/USD exchange rate
getUserUploadHistory
Fetch all uploads for a wallet address
renewStorageDuration
Extend storage duration for existing uploads
Type Safety
The SDK is type-safe. Import types as needed:Configuration
Network Selection
The environment parameter determines which Solana network to use:devnet: Local developmenttestnet: Public testing with test SOLmainnet: Production with real SOL
Custom RPC URL (Optional)
By default, the SDK uses public Solana RPC endpoints. For production applications, you should use your own RPC provider (like Helius or QuickNode) to avoid rate limits:Common Patterns
Checking Balance Before Upload
Toast Notifications
Email Notifications (Optional)
Vite Configuration
If using Vite, you’ll need Node.js polyfills for the browser:vite.config.ts:
This prevents
ReferenceError: process is not defined and provides necessary Node.js polyfills for Solana Web3.js to work in the browser.Next Steps
Upload Files
Learn how to upload files and create deposits
View History
Fetch and display upload history
Renew Storage
Extend storage duration
Core Concepts
Understand how it works
Support
GitHub Issues
Report bugs or request features
SOL Package
View on npm
FIL Package
View on npm