@streamflow/stream 11.3.0 → 11.3.1

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.
@@ -3419,6 +3419,12 @@ var SolanaStreamClient = class {
3419
3419
  ...extParams,
3420
3420
  metadataPubKeys: metadataPubKeysExt?.[i] ? [metadataPubKeysExt[i]] : void 0
3421
3421
  };
3422
+ const wrapInstructions = [];
3423
+ if (isNative) {
3424
+ const totalFee = await this.getTotalFee({ address: partnerPublicKey.toString() });
3425
+ const recipientAmount = calculateTotalAmountToDeposit(recipientData.amount, totalFee);
3426
+ wrapInstructions.push(...await common.prepareWrappedAccount(this.connection, sender.publicKey, recipientAmount));
3427
+ }
3422
3428
  const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
3423
3429
  createStreamData,
3424
3430
  createStreamExtParams
@@ -3429,17 +3435,12 @@ var SolanaStreamClient = class {
3429
3435
  metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
3430
3436
  metadatas.push(metadataPubKey.toBase58());
3431
3437
  instructionsBatch.push({
3432
- ixs,
3438
+ ixs: [...wrapInstructions, ...ixs],
3433
3439
  metadata,
3434
3440
  recipient: recipientData.recipient
3435
3441
  });
3436
3442
  }
3437
3443
  const prepareInstructions = await this.getCreateATAInstructions([partnerPublicKey], mintPublicKey, sender, true);
3438
- if (isNative) {
3439
- const totalDepositedAmount = recipients.reduce((acc, recipient) => recipient.amount.add(acc), new BN3__default.default(0));
3440
- const nativeInstructions = await common.prepareWrappedAccount(this.connection, sender.publicKey, totalDepositedAmount);
3441
- prepareInstructions.push(...nativeInstructions);
3442
- }
3443
3444
  return {
3444
3445
  instructionsBatch,
3445
3446
  metadatas,