|
1 | | -# Streamflow JS SDK v8.0.0 Release Notes |
| 1 | +# Streamflow JS SDK Release Notes |
2 | 2 |
|
3 | | -## Overview |
| 3 | +## v10.0.0 |
4 | 4 |
|
5 | | -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. |
| 5 | +### Breaking Changes |
6 | 6 |
|
7 | | -This guide focuses on the steps you need to take in your application to upgrade to v8. |
| 7 | +* **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. |
| 8 | +* **Removed Multi-Chain Support:** All non-Solana blockchain implementations have been removed from the SDK: |
| 9 | + * **Aptos** support removed (`packages/stream/aptos/`) |
| 10 | + * **EVM** (Ethereum/Polygon/Avalanche) support removed (`packages/stream/evm/`) |
| 11 | + * **Sui** support removed (`packages/stream/sui/`) |
| 12 | + * 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. |
| 13 | +* **Removed GenericStreamClient:** The `GenericStreamClient` and `BaseStreamClient` classes have been removed. The SDK now only provides `SolanaStreamClient` (exported as `SolanaStreamClient`). Update your imports: |
| 14 | + * **Before:** `import { GenericStreamClient } from "@streamflow/stream/common"` |
| 15 | + * **After:** `import { SolanaStreamClient } from "@streamflow/stream"` |
| 16 | +* **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. |
8 | 17 |
|
9 | | -## Migration Steps for Your Application |
| 18 | +### New Features |
10 | 19 |
|
11 | | -Here's what you need to do to update your application to use Streamflow SDK v8: |
| 20 | +* **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: |
| 21 | + * Creating price-based vesting streams |
| 22 | + * Creating price-based token locks |
| 23 | + * Fetching and accessing aligned stream data |
| 24 | + * Integration with Streamflow's Oracle API |
12 | 25 |
|
13 | | -* **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`). |
14 | | -* **Verify Import Paths for Sub-modules:** |
15 | | - * 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. |
16 | | - * **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. |
17 | | -* **Verify IDL JSON Imports:** If you import Streamflow's IDL JSON files directly, ensure you use the correct syntax for your environment: |
18 | | - * **ESM/TypeScript:** `import myIdl from "@streamflow/[package_name]/solana/idl/[idl_name].json" with { type: "json" };` |
19 | | - * **CommonJS:** `const myIdl = require("@streamflow/[package_name]/solana/idl/[idl_name].json");` |
20 | | -* **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: |
| 26 | +### Enhancements |
21 | 27 |
|
22 | | - * **NPM Scoped Packages:** |
23 | | - * `@coral-xyz/` |
24 | | - * `@coral-xyz/borsh`: `^0.30.1` |
25 | | - * `@solana/` |
26 | | - * `@solana/buffer-layout`: `4.0.1` |
27 | | - * `@solana/spl-token`: `0.4.9` |
28 | | - * `@solana/wallet-adapter-base`: `0.9.19` |
29 | | - * `@solana/web3.js`: `1.95.4` |
30 | | - * **Other Packages:** |
31 | | - * `bn.js`: `5.2.1` |
32 | | - * `borsh`: `^2.0.0` |
| 28 | +* **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. |
| 29 | +* **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. |
| 30 | +* **Removed Treasury ATA Creation:** The SDK no longer automatically creates Streamflow treasury ATA accounts, reducing transaction size and costs. |
| 31 | +* **Squads Ephemeral Signatures Support:** Fixed support for Squads multisig wallets using ephemeral signatures. |
| 32 | +* **Better Error Handling:** Improved error handling and null/undefined checks throughout the SDK. |
33 | 33 |
|
34 | | - *(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).* |
35 | | - The easiest way to include these is using a bundler's plugin. |
36 | | - For polyfills take a look: |
37 | | - 1. Vite - https://www.npmjs.com/package/vite-plugin-node-polyfills |
38 | | - 2. Rsbuild - https://github.com/rspack-contrib/rsbuild-plugin-node-polyfill |
39 | | - 3. Webpack - https://www.npmjs.com/package/node-polyfill-webpack-plugin |
| 34 | +### Documentation Updates |
40 | 35 |
|
41 | | -## Technical Details (Why these changes?) |
| 36 | +* Enhanced `@streamflow/stream` README with detailed examples for price-based stream creation |
| 37 | +* Added examples for fetching aligned stream properties using `getOne()`, `get()`, and `searchStreams()` |
| 38 | +* Documented Oracle API integration for fetching price oracle addresses |
| 39 | +* Removed references to non-Solana chains from documentation |
42 | 40 |
|
43 | | -*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. |
| 41 | +### Migration Guide |
| 42 | + |
| 43 | +If you're upgrading from v8.x or v9.x to v10.0.0: |
| 44 | + |
| 45 | +1. **Update Imports:** |
| 46 | + * Remove any imports from `@streamflow/stream/common`, `@streamflow/stream/aptos`, `@streamflow/stream/evm`, or `@streamflow/stream/sui` |
| 47 | + * Use only `@streamflow/stream` for Solana-specific imports |
| 48 | + * Replace `GenericStreamClient` with `SolanaStreamClient` |
| 49 | + |
| 50 | +2. **Update Stream Type References:** |
| 51 | + * Remove any code that references `StreamType.Payment` |
| 52 | + * Update your code to use `StreamType.Vesting`, `StreamType.Lock`, or `StreamType.All` |
| 53 | + |
| 54 | +3. **Review Partner Fee Configuration:** |
| 55 | + * 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 |
| 56 | + * Update partner fee logic if needed |
| 57 | + |
| 58 | +4. **Update Dependencies:** |
| 59 | + * Remove any non-Solana blockchain dependencies from your `package.json` |
| 60 | + * Ensure you're only using Solana-related packages |
| 61 | + |
| 62 | +5. **Test Metadata Handling:** |
| 63 | + * If you're using custom metadata public keys, test that the new `metadataPubKeys` array parameter works correctly with your implementation |
0 commit comments