@streamflow/stream 10.0.0-alpha.p313.85091cd → 10.0.0-alpha.p313.8cfb43a

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.
@@ -583,7 +583,7 @@ declare class SolanaStreamClient {
583
583
  * @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
584
584
  * @returns Create multiple transaction instructions
585
585
  */
586
- buildCreateMultipleTransactionInstructions(data: ICreateMultipleStreamData, extParams: IPrepareCreateStreamExt): Promise<{
586
+ buildCreateMultipleTransactionInstructions(data: ICreateMultipleStreamData, extParams: IPrepareCreateStreamExt, applyCustomAfterInstructions?: boolean): Promise<{
587
587
  instructionsBatch: {
588
588
  ixs: TransactionInstruction[];
589
589
  metadata: Keypair | undefined;
@@ -619,7 +619,7 @@ declare class SolanaStreamClient {
619
619
  * @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
620
620
  * @returns Multiple transaction information
621
621
  */
622
- buildCreateMultipleTransactions(data: ICreateMultipleStreamData, extParams: IPrepareCreateStreamExt): Promise<{
622
+ buildCreateMultipleTransactions(data: ICreateMultipleStreamData, extParams: IPrepareCreateStreamExt, applyCustomAfterInstructions?: boolean): Promise<{
623
623
  transactions: BatchItem[];
624
624
  metadatas: string[];
625
625
  metadataToRecipient: MetadataRecipientHashMap;
@@ -2969,14 +2969,13 @@ var SolanaStreamClient = class {
2969
2969
  * @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
2970
2970
  * @returns Create multiple transaction instructions
2971
2971
  */
2972
- async buildCreateMultipleTransactionInstructions(data, extParams) {
2972
+ async buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions = true) {
2973
2973
  const { recipients, ...streamParams } = data;
2974
2974
  const { sender, metadataPubKeys: metadataPubKeysExt, isNative, customInstructions } = extParams;
2975
2975
  assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
2976
2976
  const metadatas = [];
2977
2977
  const metadataToRecipient = {};
2978
2978
  const instructionsBatch = [];
2979
- const metadataPubKeys = metadataPubKeysExt || [];
2980
2979
  const partnerPublicKey = data.partner ? new PublicKey(data.partner) : WITHDRAWOR_PUBLIC_KEY;
2981
2980
  const mintPublicKey = new PublicKey(data.tokenId);
2982
2981
  if (recipients.length === 0) {
@@ -2986,14 +2985,16 @@ var SolanaStreamClient = class {
2986
2985
  const recipientData = recipients[i];
2987
2986
  const createStreamData = { ...streamParams, ...recipientData };
2988
2987
  const createStreamExtParams = {
2989
- metadataPubKeys: metadataPubKeys[i] ? [metadataPubKeys[i]] : void 0,
2990
- ...extParams
2988
+ ...extParams,
2989
+ metadataPubKeys: metadataPubKeysExt?.[i] ? [metadataPubKeysExt[i]] : void 0
2991
2990
  };
2992
2991
  const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
2993
2992
  createStreamData,
2994
2993
  createStreamExtParams
2995
2994
  );
2996
- await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
2995
+ if (applyCustomAfterInstructions) {
2996
+ await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
2997
+ }
2997
2998
  metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
2998
2999
  metadatas.push(metadataPubKey.toBase58());
2999
3000
  instructionsBatch.push({
@@ -3041,9 +3042,9 @@ var SolanaStreamClient = class {
3041
3042
  * @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
3042
3043
  * @returns Multiple transaction information
3043
3044
  */
3044
- async buildCreateMultipleTransactions(data, extParams) {
3045
+ async buildCreateMultipleTransactions(data, extParams, applyCustomAfterInstructions = true) {
3045
3046
  const { sender } = extParams;
3046
- const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams);
3047
+ const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions);
3047
3048
  const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
3048
3049
  const batch = [];
3049
3050
  for (const { ixs, metadata, recipient } of instructionsBatch) {
@@ -3794,7 +3795,7 @@ var SolanaStreamClient = class {
3794
3795
  async flatBuildCreateMultipleTransactionInstructions(data, extParams) {
3795
3796
  const dataArray = Array.isArray(data) ? data : [data];
3796
3797
  const results = await Promise.all(
3797
- dataArray.map((item) => this.buildCreateMultipleTransactionInstructions(item, extParams))
3798
+ dataArray.map((item, index) => this.buildCreateMultipleTransactionInstructions(item, extParams, index === 0))
3798
3799
  );
3799
3800
  return {
3800
3801
  instructionsBatch: results.flatMap((r) => r.instructionsBatch),