@streamflow/stream 8.7.0-alpha.0 → 8.7.0-alpha.p304.6732440

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@ import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAp
2
2
  export { i as StreamflowAptos } from './index-DYIamO0j.cjs';
3
3
  import { E as EvmStreamClient } from './index-BMZATAYa.cjs';
4
4
  export { i as StreamflowEVM } from './index-BMZATAYa.cjs';
5
- import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-Dl7EztUT.cjs';
6
- export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-Dl7EztUT.cjs';
5
+ import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-Bll7jg8V.cjs';
6
+ export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-Bll7jg8V.cjs';
7
7
  import { S as SuiStreamClient } from './index-Y0HH2ugY.cjs';
8
8
  export { i as StreamflowSui } from './index-Y0HH2ugY.cjs';
9
9
  import { S as Stream, A as AlignedStream, I as ICreateStreamData, a as ICreateAlignedStreamData, b as StreamType, B as BaseStreamClient, c as SolanaStreamClientOptions, d as AptosStreamClientOptions, e as SuiStreamClientOptions, E as EvmStreamClientOptions, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-DOyJqO7R.cjs';
@@ -2457,6 +2457,10 @@ var SolanaStreamClient = class extends BaseStreamClient {
2457
2457
  /**
2458
2458
  * Builds transaction instructions for creating a new stream/vesting contract without creating a transaction.
2459
2459
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
2460
+ *
2461
+ * For native SOL (isNative: true), SOL wrapping instructions are automatically included in the correct order
2462
+ * (before stream creation) to ensure the WSOL account exists when the stream creation instruction executes.
2463
+ *
2460
2464
  * @param {ICreateStreamData} data - Stream parameters including recipient, token, amount, schedule, and permissions
2461
2465
  * @param {Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
2462
2466
  * @returns Transaction instructions and metadata ID
@@ -2474,6 +2478,13 @@ var SolanaStreamClient = class extends BaseStreamClient {
2474
2478
  true,
2475
2479
  tokenProgramId ? new web3_js.PublicKey(tokenProgramId) : void 0
2476
2480
  );
2481
+ if (isNative) {
2482
+ const totalFee = await this.getTotalFee({
2483
+ address: partnerPublicKey.toString()
2484
+ });
2485
+ const totalAmount = calculateTotalAmountToDeposit(amount, totalFee);
2486
+ ixs.push(...await solana.prepareWrappedAccount(this.connection, tempSender.publicKey, totalAmount));
2487
+ }
2477
2488
  const {
2478
2489
  ixs: createIxs,
2479
2490
  metadata,
@@ -2483,13 +2494,6 @@ var SolanaStreamClient = class extends BaseStreamClient {
2483
2494
  sender: tempSender
2484
2495
  });
2485
2496
  ixs.push(...createIxs);
2486
- if (isNative) {
2487
- const totalFee = await this.getTotalFee({
2488
- address: partnerPublicKey.toString()
2489
- });
2490
- const totalAmount = calculateTotalAmountToDeposit(amount, totalFee);
2491
- ixs.push(...await solana.prepareWrappedAccount(this.connection, tempSender.publicKey, totalAmount));
2492
- }
2493
2497
  await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
2494
2498
  return {
2495
2499
  ixs,
@@ -2500,6 +2504,10 @@ var SolanaStreamClient = class extends BaseStreamClient {
2500
2504
  /**
2501
2505
  * Builds a transaction for creating a new stream/vesting contract without signing or executing it.
2502
2506
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
2507
+ *
2508
+ * For native SOL (isNative: true), SOL wrapping instructions are automatically included in the correct order
2509
+ * (before stream creation) to ensure the WSOL account exists when the stream creation instruction executes.
2510
+ *
2503
2511
  * @param {ICreateStreamData} data - Stream parameters including recipient, token, amount, schedule, and permissions
2504
2512
  * @param {Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
2505
2513
  * @returns Transaction and metadata information
@@ -2946,6 +2954,25 @@ var SolanaStreamClient = class extends BaseStreamClient {
2946
2954
  /**
2947
2955
  * Builds multiple transactions for creating stream/vesting contracts without signing or executing them.
2948
2956
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
2957
+ *
2958
+ * IMPORTANT: When using native SOL (isNative: true), you MUST execute the prepareTx FIRST and wait for confirmation
2959
+ * before executing the stream creation transactions. Otherwise, stream creation will fail with "InvalidAccountData".
2960
+ *
2961
+ * @example
2962
+ * ```typescript
2963
+ * const result = await streamClient.buildCreateMultipleTransactions(data, { isNative: true, senderPublicKey });
2964
+ *
2965
+ * // CRITICAL: Execute prepareTx first if it exists
2966
+ * if (result.prepareTx) {
2967
+ * await connection.sendAndConfirmTransaction(result.prepareTx, [signer]);
2968
+ * }
2969
+ *
2970
+ * // Only then execute stream creation transactions
2971
+ * for (const item of result.transactions) {
2972
+ * await connection.sendAndConfirmTransaction(item.tx, [signer]);
2973
+ * }
2974
+ * ```
2975
+ *
2949
2976
  * @param {ICreateMultipleStreamData} data - Stream base parameters and array of recipients with individual amounts and settings
2950
2977
  * @param {Omit<ICreateStreamSolanaExt, "sender"> & { senderPublicKey: PublicKey }} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
2951
2978
  * @returns Multiple transaction information