Overview
Architecture
All 5 SDK packages, their dependency graph, API layers, and build output.
Packages
The Streamflow JS SDK is a pnpm monorepo that publishes 5 Solana protocol packages on npm. Each package targets a specific on-chain protocol.
| Package | Role |
|---|---|
@streamflow/common | Foundation - shared types, BN utilities, Solana transaction pipeline, compute estimation |
@streamflow/stream | Core vesting and lock protocol - SolanaStreamClient + composable API |
@streamflow/staking | Staking pools and reward distribution - SolanaStakingClient |
@streamflow/distributor | Merkle airdrop protocol - SolanaDistributorClient, SolanaAlignedDistributorClient |
@streamflow/launchpad | Token launchpad with dynamic vesting - SolanaLaunchpadClient |
Dependency graph
@streamflow/common is the foundation every other package builds on. @streamflow/launchpad is the only cross-protocol dependency - it depends on both common and stream.
@streamflow/common
├── @streamflow/stream
│ └── @streamflow/launchpad
├── @streamflow/staking
└── @streamflow/distributor@streamflow/common is declared as a direct dependency of each package and is resolved automatically - no explicit installation required.
Package details
API pattern
Every write operation across all packages pairs a prepare*Instructions() method with an execute() call. See prepare* / execute Pattern for a full explanation.
Runtime requirements
- Node.js >= 18 required across all packages.
- Peer dependencies -
@solana/web3.jsandbn.jsare declared as peer dependencies and must be installed alongside any@streamflow/*package. - Browser - requires polyfills for Node.js built-ins. See Installation for bundler-specific setup.