@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.
package/dist/esm/index.js CHANGED
@@ -3393,6 +3393,12 @@ var SolanaStreamClient = class {
3393
3393
  ...extParams,
3394
3394
  metadataPubKeys: metadataPubKeysExt?.[i] ? [metadataPubKeysExt[i]] : void 0
3395
3395
  };
3396
+ const wrapInstructions = [];
3397
+ if (isNative) {
3398
+ const totalFee = await this.getTotalFee({ address: partnerPublicKey.toString() });
3399
+ const recipientAmount = calculateTotalAmountToDeposit(recipientData.amount, totalFee);
3400
+ wrapInstructions.push(...await prepareWrappedAccount(this.connection, sender.publicKey, recipientAmount));
3401
+ }
3396
3402
  const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
3397
3403
  createStreamData,
3398
3404
  createStreamExtParams
@@ -3403,17 +3409,12 @@ var SolanaStreamClient = class {
3403
3409
  metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
3404
3410
  metadatas.push(metadataPubKey.toBase58());
3405
3411
  instructionsBatch.push({
3406
- ixs,
3412
+ ixs: [...wrapInstructions, ...ixs],
3407
3413
  metadata,
3408
3414
  recipient: recipientData.recipient
3409
3415
  });
3410
3416
  }
3411
3417
  const prepareInstructions = await this.getCreateATAInstructions([partnerPublicKey], mintPublicKey, sender, true);
3412
- if (isNative) {
3413
- const totalDepositedAmount = recipients.reduce((acc, recipient) => recipient.amount.add(acc), new BN3(0));
3414
- const nativeInstructions = await prepareWrappedAccount(this.connection, sender.publicKey, totalDepositedAmount);
3415
- prepareInstructions.push(...nativeInstructions);
3416
- }
3417
3418
  return {
3418
3419
  instructionsBatch,
3419
3420
  metadatas,