Skip to content
Merged

v10 #313

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d75587b
[skip alpha] Remove generic client and some aptos and sui code
tatomir-streamflow Oct 7, 2025
46fc529
[skip alpha] remove dependencies and build targets/exports/imports
tatomir-streamflow Oct 7, 2025
706212e
[skip alpha] remove sui and aptos mention from readme
tatomir-streamflow Oct 7, 2025
2865f1b
[skip alpha] Remove Solana named types, move constants, types and uti…
tatomir-streamflow Oct 13, 2025
22f6df2
[skip alpha] refactor to make it work
tatomir-streamflow Oct 13, 2025
31dd9c7
[skip alpha] some more
tatomir-streamflow Oct 13, 2025
a0825ea
bump version to v10
tatomir-streamflow Oct 13, 2025
6220f74
fix extra type in import statement
tatomir-streamflow Oct 13, 2025
3ce4d29
Fix examples build
tatomir-streamflow Oct 13, 2025
22db3a0
some missed deps
tatomir-streamflow Oct 15, 2025
18b7be3
merge master
tatomir-streamflow Oct 15, 2025
5c17c1c
remove payments
dperdic-streamflow Oct 10, 2025
97df580
bump package versions
dperdic-streamflow Oct 10, 2025
4470e29
remove payments from moved type folder
tatomir-streamflow Oct 15, 2025
4046054
Merge branch 'master' into alpha/v10
tatomir-streamflow Oct 16, 2025
e531e2c
Revert "remove payments"
tatomir-streamflow Oct 16, 2025
836f72d
Reapply "remove payments"
tatomir-streamflow Oct 16, 2025
fe3720a
better naming for prepare instructions
tatomir-streamflow Oct 16, 2025
85091cd
support for array of stream data
tatomir-streamflow Oct 19, 2025
4b20e85
applyCustomInstructions only once
tatomir-streamflow Oct 22, 2025
ec978a8
lint
tatomir-streamflow Oct 22, 2025
588e7ca
Merge branch 'master' into alpha/v10
tatomir-streamflow Oct 22, 2025
ac76c04
revert public API, needs fixing
tatomir-streamflow Oct 22, 2025
e143b57
Refactor metadata handling in SolanaStreamClient to use metadataPubKe…
RolginRoman Oct 28, 2025
b8f5b98
Merge pull request #317 from streamflow-finance/alpha/fix-squads-ephe…
RolginRoman Oct 28, 2025
77ad1fe
proper non-null check for fee response
tatomir-streamflow Oct 28, 2025
62d0fcc
stricter check for null/undefined
tatomir-streamflow Oct 29, 2025
8cfb43a
Merge branch 'master' into alpha/v10
tatomir-streamflow Oct 29, 2025
46c7838
feat: use sender as default partner (#320)
Yolley Nov 4, 2025
58f3031
feat: new partner fee structure
Yolley Nov 19, 2025
b11284b
lint
Yolley Nov 19, 2025
621547f
fix program ids set and partner schema
Yolley Nov 19, 2025
98ed56b
lint
Yolley Nov 19, 2025
15b4539
rebase
Yolley Nov 20, 2025
a3a844d
Merge branch 'master' into alpha/v10
tatomir-streamflow Nov 24, 2025
6849613
Merge branch 'feat/update_partner_structure' into alpha/v10
tatomir-streamflow Nov 24, 2025
43acc5b
Update docs
tatomir-streamflow Nov 24, 2025
fe2295d
Update oracle API endpoint in docs and update release-notes
tatomir-streamflow Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Streamflow

Streamflow is a token vesting and streaming payments platform.
Streamflow is a token vesting platform.

There are several ways to use **Streamflow**:

Expand All @@ -23,7 +23,7 @@ API Documentation available here:
## JS SDK to interact with Streamflow protocols

This repo consists of js-sdk to interact with several protocol exposed by streamflow:
- `packages/stream` - [Core Streamflow Protocol](packages/stream/README.md) that allows to create a vesting/payment/lock Stream to a Recipient;
- `packages/stream` - [Core Streamflow Protocol](packages/stream/README.md) that allows to create a vesting/lock Stream to a Recipient;
- `packages/distributor` - [Distributor Streamflow Protocol](packages/distributor/README.md) that allows to Airdrop tokens to large amount of Recipients (thousands or even millions);
- `packages/common` - Common utilities and types used by Streamflow SDK;

Expand Down
86 changes: 53 additions & 33 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,63 @@
# Streamflow JS SDK v8.0.0 Release Notes
# Streamflow JS SDK Release Notes

## Overview
## v10.0.0

Version 8.0.0 improves how the Streamflow SDK works with modern JavaScript environments (like ES Modules and CommonJS) and different bundlers. This update makes using the SDK more reliable and predictable across various project setups.
### Breaking Changes

This guide focuses on the steps you need to take in your application to upgrade to v8.
* **Removed Payments Stream Type:** The `StreamType.Payment` enum value has been removed. The `StreamType` enum now only includes `All`, `Vesting`, and `Lock`. If your code references `StreamType.Payment`, you'll need to update it to use one of the remaining types or remove the reference.
* **Removed Multi-Chain Support:** All non-Solana blockchain implementations have been removed from the SDK:
* **Aptos** support removed (`packages/stream/aptos/`)
* **EVM** (Ethereum/Polygon/Avalanche) support removed (`packages/stream/evm/`)
* **Sui** support removed (`packages/stream/sui/`)
* The SDK is now **Solana-only**. If you were using any of these implementations, please see the v9 branch of the SDK which we will continue to support, but not activelty improve or add new features.
* **Removed GenericStreamClient:** The `GenericStreamClient` and `BaseStreamClient` classes have been removed. The SDK now only provides `SolanaStreamClient` (exported as `SolanaStreamClient`). Update your imports:
* **Before:** `import { GenericStreamClient } from "@streamflow/stream/common"`
* **After:** `import { SolanaStreamClient } from "@streamflow/stream"`
* **Partner Fee Structure Changes:** The partner fee structure has been updated. The `partner` parameter now defaults to the sender's address if not provided. Review your stream creation code to ensure partner fees are configured correctly.

## Migration Steps for Your Application
### New Features

Here's what you need to do to update your application to use Streamflow SDK v8:
* **Price-based Streams (Aligned Streams) Documentation:** Added comprehensive documentation for creating and managing price-based streams that dynamically adjust unlock rates based on token price oracles. The documentation includes:
* Creating price-based vesting streams
* Creating price-based token locks
* Fetching and accessing aligned stream data
* Integration with Streamflow's Oracle API

* **Update Dependencies:** In your `package.json`, change the version for all `@streamflow/*` packages to `^8.0.0` (or the specific v8 release number) and run your package manager's install command (e.g., `npm install`, `yarn install`, `pnpm install`).
* **Verify Import Paths for Sub-modules:**
* If you only import from the main package entry point (e.g., `import { ... } from "@streamflow/stream";` or `require("@streamflow/stream")`), these imports should work without changes.
* **If you import directly from sub-paths** (e.g., `@streamflow/distributor/solana` or internal build files like `dist/...`), review these. You should now use the officially supported entry points like `import { MerkleDistributor } from "@streamflow/distributor/solana";`. Check the relevant package's documentation or `package.json` `exports` field if you need specific sub-modules.
* **Verify IDL JSON Imports:** If you import Streamflow's IDL JSON files directly, ensure you use the correct syntax for your environment:
* **ESM/TypeScript:** `import myIdl from "@streamflow/[package_name]/solana/idl/[idl_name].json" with { type: "json" };`
* **CommonJS:** `const myIdl = require("@streamflow/[package_name]/solana/idl/[idl_name].json");`
* **Check Peer Dependencies:** The Streamflow SDK relies on certain external libraries (peer dependencies) that are *not* included directly in the SDK bundles. Ensure the following packages, with at least the specified versions, are listed as dependencies in your project's `package.json` and installed:
### Enhancements

* **NPM Scoped Packages:**
* `@coral-xyz/`
* `@coral-xyz/borsh`: `^0.30.1`
* `@solana/`
* `@solana/buffer-layout`: `4.0.1`
* `@solana/spl-token`: `0.4.9`
* `@solana/wallet-adapter-base`: `0.9.19`
* `@solana/web3.js`: `1.95.4`
* **Other Packages:**
* `bn.js`: `5.2.1`
* `borsh`: `^2.0.0`
* **Improved Metadata Handling:** Enhanced support for custom metadata public keys via the `metadataPubKeys` parameter in stream creation methods. You can now pass an array of metadata public keys for batch operations.
* **Fixed Double ATA Creation:** Resolved an issue where WSOL (wrapped SOL) streams would attempt to create duplicate Associated Token Accounts when the recipient and sender were the same address.
* **Removed Treasury ATA Creation:** The SDK no longer automatically creates Streamflow treasury ATA accounts, reducing transaction size and costs.
* **Squads Ephemeral Signatures Support:** Fixed support for Squads multisig wallets using ephemeral signatures.
* **Better Error Handling:** Improved error handling and null/undefined checks throughout the SDK.

*(Note: Node.js built-in modules like `buffer`, `crypto`, `fs`, etc., are also externalized but do not need to be explicitly installed as they are part of the Node.js environment).*
The easiest way to include these is using a bundler's plugin.
For polyfills take a look:
1. Vite - https://www.npmjs.com/package/vite-plugin-node-polyfills
2. Rsbuild - https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill
3. Webpack - https://www.npmjs.com/package/node-polyfill-webpack-plugin
### Documentation Updates

## Technical Details (Why these changes?)
* Enhanced `@streamflow/stream` README with detailed examples for price-based stream creation
* Added examples for fetching aligned stream properties using `getOne()`, `get()`, and `searchStreams()`
* Documented Oracle API integration for fetching price oracle addresses
* Removed references to non-Solana chains from documentation

*For users interested in the underlying changes:* Version 8 introduces a standardized build process using `tsup` across all packages. This creates distinct `dist/esm` (ECMAScript Modules) and `dist/cjs` (CommonJS) output directories. The `package.json` `exports` map in each package has been carefully configured to ensure that Node.js and bundlers automatically select the correct format (ESM or CJS) based on how you import the package. This resolves previous inconsistencies, particularly with loading specific files like IDLs in CommonJS projects. IDL `.json` files are now explicitly copied during the build and correctly referenced in the exports map. The list of externalized peer dependencies (defined in `tsup.config.base.ts`) remains largely the same, requiring users to manage these dependencies in their own projects.
### Migration Guide

If you're upgrading from v8.x or v9.x to v10.0.0:

1. **Update Imports:**
* Remove any imports from `@streamflow/stream/common`, `@streamflow/stream/aptos`, `@streamflow/stream/evm`, or `@streamflow/stream/sui`
* Use only `@streamflow/stream` for Solana-specific imports
* Replace `GenericStreamClient` with `SolanaStreamClient`

2. **Update Stream Type References:**
* Remove any code that references `StreamType.Payment`
* Update your code to use `StreamType.Vesting`, `StreamType.Lock`, or `StreamType.All`

3. **Review Partner Fee Configuration:**
* If you were explicitly setting `partner` to `undefined` or relying on default behavior, verify that the new default (sender address) works for your use case
* Update partner fee logic if needed

4. **Update Dependencies:**
* Remove any non-Solana blockchain dependencies from your `package.json`
* Ensure you're only using Solana-related packages

5. **Test Metadata Handling:**
* If you're using custom metadata public keys, test that the new `metadataPubKeys` array parameter works correctly with your implementation
12 changes: 6 additions & 6 deletions examples/js-cjs-bundled/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
* 4. Bundling with Vite
*/

const { StreamflowSolana } = require("@streamflow/stream");
const { SolanaStreamClient } = require("@streamflow/stream");
const { StreamflowDistributorSolana } = require("@streamflow/distributor");
const { SolanaStakingClient } = require("@streamflow/staking");
const { SolanaLaunchpadClient } = require("@streamflow/launchpad");
const { ICluster } = require("@streamflow/common");
// Other entrypoints to test that the package.json is correct
const { MerkleDistributor } = require("@streamflow/distributor/solana");
const { prepareTransaction } = require("@streamflow/common/solana");
const { prepareTransaction } = require("@streamflow/common");

// Import IDL files to test import resolving
const streamflowAlignedUnlocksIDL = require("@streamflow/stream/solana/idl/streamflow_aligned_unlocks.json");
Expand Down Expand Up @@ -45,10 +45,10 @@ function verifyEnvironment() {
// but we can check if the modules were loaded correctly
try {
// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
throw new Error("StreamflowSolana.SolanaStreamClient is not a constructor function");
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: StreamflowSolana.SolanaStreamClient loaded correctly");
console.log("Verified: SolanaStreamClient loaded correctly");

// Verify DistributorClient is loaded correctly
if (typeof StreamflowDistributorSolana.SolanaDistributorClient !== "function") {
Expand Down Expand Up @@ -145,7 +145,7 @@ async function main() {
const cluster = ICluster.Devnet;

// Correct initialization:
const streamClient = new StreamflowSolana.SolanaStreamClient({ clusterUrl, cluster });
const streamClient = new SolanaStreamClient({ clusterUrl, cluster });

const distributorClient = new StreamflowDistributorSolana.SolanaDistributorClient({
clusterUrl,
Expand Down
8 changes: 4 additions & 4 deletions examples/js-cjs-unbundled/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
*/

// Import specific exports from each package using CommonJS require
const { StreamflowSolana } = require("@streamflow/stream");
const { SolanaStreamClient } = require("@streamflow/stream");
const { ICluster, ContractError } = require("@streamflow/common");
const { StreamflowDistributorSolana } = require("@streamflow/distributor");
const { SolanaStakingClient } = require("@streamflow/staking");
const { SolanaLaunchpadClient } = require("@streamflow/launchpad");

// Other entrypoints to test that the package.json is correct
const { MerkleDistributor } = require("@streamflow/distributor/solana");
const { prepareTransaction } = require("@streamflow/common/solana");
const { prepareTransaction } = require("@streamflow/common");

// Import IDL files to test import resolving
const streamflowAlignedUnlocksIDL = require("@streamflow/stream/solana/idl/streamflow_aligned_unlocks.json");
Expand Down Expand Up @@ -52,7 +52,7 @@ function verifyEnvironment() {
}

// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: SolanaStreamClient loaded correctly");
Expand Down Expand Up @@ -152,7 +152,7 @@ async function main() {

// Initialize the Streamflow Solana client
console.log("Initializing Streamflow Solana client...");
const streamClient = new StreamflowSolana.SolanaStreamClient({ clusterUrl, cluster });
const streamClient = new SolanaStreamClient({ clusterUrl, cluster });

// Initialize the Distributor Solana client
console.log("Initializing Distributor Solana client...");
Expand Down
6 changes: 3 additions & 3 deletions examples/js-esm-bundled/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 4. Bundling with Vite
*/

import { StreamflowSolana } from "@streamflow/stream";
import { SolanaStreamClient } from "@streamflow/stream";
import { StreamflowDistributorSolana } from "@streamflow/distributor";
import { SolanaStakingClient } from "@streamflow/staking";
import { SolanaLaunchpadClient } from "@streamflow/launchpad";
Expand Down Expand Up @@ -42,7 +42,7 @@ function verifyEnvironment() {
// but we can check if the modules were loaded correctly
try {
// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: SolanaStreamClient loaded correctly");
Expand Down Expand Up @@ -135,7 +135,7 @@ async function main() {
console.log("Initializing Streamflow clients...");

// Stream client
const streamClient = new StreamflowSolana.SolanaStreamClient({
const streamClient = new SolanaStreamClient({
clusterUrl,
cluster,
});
Expand Down
8 changes: 4 additions & 4 deletions examples/js-esm-unbundled/src/start-node18.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
*/

// Import specific exports from each package
import { StreamflowSolana } from "@streamflow/stream";
import { SolanaStreamClient } from "@streamflow/stream";
import { ICluster, ContractError } from "@streamflow/common";
import { StreamflowDistributorSolana } from "@streamflow/distributor";
import { SolanaStakingClient } from "@streamflow/staking";
import { SolanaLaunchpadClient } from "@streamflow/launchpad";
// Other entrypoints to test that the package.json is correct
import { MerkleDistributor } from "@streamflow/distributor/solana";
import {prepareTransaction} from "@streamflow/common/solana";
import {prepareTransaction} from "@streamflow/common";

// Import IDL files to test import resolving
import streamflowAlignedUnlocksIDL from "@streamflow/stream/solana/idl/streamflow_aligned_unlocks.json" assert { type: "json" };
Expand Down Expand Up @@ -53,7 +53,7 @@ function verifyEnvironment() {
}

// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: SolanaStreamClient loaded correctly");
Expand Down Expand Up @@ -136,7 +136,7 @@ async function main() {

// Initialize the Streamflow Solana client
console.log("Initializing Streamflow Solana client...");
const streamClient = new StreamflowSolana.SolanaStreamClient(clusterUrl, cluster);
const streamClient = new SolanaStreamClient(clusterUrl, cluster);

// Initialize the Distributor Solana client
console.log("Initializing Distributor Solana client...");
Expand Down
8 changes: 4 additions & 4 deletions examples/js-esm-unbundled/src/start-node20.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
*/

// Import specific exports from each package
import { StreamflowSolana } from "@streamflow/stream";
import { SolanaStreamClient } from "@streamflow/stream";
import { ICluster, ContractError } from "@streamflow/common";
import { StreamflowDistributorSolana } from "@streamflow/distributor";
import { SolanaStakingClient } from "@streamflow/staking";
import { SolanaLaunchpadClient } from "@streamflow/launchpad";
// Other entrypoints to test that the package.json is correct
import { MerkleDistributor } from "@streamflow/distributor/solana";
import {prepareTransaction} from "@streamflow/common/solana";
import {prepareTransaction} from "@streamflow/common";

// Import IDL files to test import resolving
import streamflowAlignedUnlocksIDL from "@streamflow/stream/solana/idl/streamflow_aligned_unlocks.json" with { type: "json" };
Expand Down Expand Up @@ -53,7 +53,7 @@ function verifyEnvironment() {
}

// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: SolanaStreamClient loaded correctly");
Expand Down Expand Up @@ -136,7 +136,7 @@ async function main() {

// Initialize the Streamflow Solana client
console.log("Initializing Streamflow Solana client...");
const streamClient = new StreamflowSolana.SolanaStreamClient(clusterUrl, cluster);
const streamClient = new SolanaStreamClient(clusterUrl, cluster);

// Initialize the Distributor Solana client
console.log("Initializing Distributor Solana client...");
Expand Down
8 changes: 4 additions & 4 deletions examples/ts-cjs-bundled/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Stream, StreamflowSolana } from "@streamflow/stream";
import { Stream, SolanaStreamClient } from "@streamflow/stream";
import { ICluster } from "@streamflow/common";
import { SolanaStakingClient } from "@streamflow/staking";
import { StreamflowDistributorSolana } from "@streamflow/distributor";
import { SolanaLaunchpadClient } from "@streamflow/launchpad";
// Other entrypoints to test that the package.json is correct
import { MerkleDistributor } from "@streamflow/distributor/solana";
import {prepareTransaction} from "@streamflow/common/solana";
import {prepareTransaction} from "@streamflow/common";

// Import IDL files to test import resolving
// Note: Using require for JSON imports in CJS context
Expand Down Expand Up @@ -36,7 +36,7 @@ function verifyEnvironment() {
// but we can check if the modules were loaded correctly
try {
// Verify StreamClient is loaded correctly
if (typeof StreamflowSolana.SolanaStreamClient !== "function") {
if (typeof SolanaStreamClient !== "function") {
throw new Error("SolanaStreamClient is not a constructor function");
}
console.log("Verified: SolanaStreamClient loaded correctly");
Expand Down Expand Up @@ -132,7 +132,7 @@ async function main() {
const cluster = ICluster.Devnet;

// Initialize the Streamflow client
const streamClient = new StreamflowSolana.SolanaStreamClient({ clusterUrl, cluster });
const streamClient = new SolanaStreamClient({ clusterUrl, cluster });
console.log("SolanaStreamClient initialized successfully");

console.log("Available clusters:", Object.values(ICluster));
Expand Down
Loading
Loading