@streamflow/stream 8.0.1-alpha.p287.54fe41f → 8.0.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.
@@ -3,7 +3,7 @@ import bs58 from 'bs58';
3
3
  import { Buffer } from 'buffer';
4
4
  import { NATIVE_MINT, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
5
5
  import { PublicKey, TransactionInstruction, Connection, Keypair, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
6
- import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, createVersionedTransaction, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
6
+ import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
7
7
  import * as borsh from 'borsh';
8
8
  import { Program } from '@coral-xyz/anchor';
9
9
  import { ICluster, getBN } from '@streamflow/common';
@@ -2154,9 +2154,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
2154
2154
  ixs.push(...await prepareWrappedAccount(this.connection, sender.publicKey, totalAmount));
2155
2155
  }
2156
2156
  await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
2157
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, [
2158
- metadata
2159
- ]);
2157
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, metadata);
2160
2158
  const signature = await signAndExecuteTransaction(
2161
2159
  this.connection,
2162
2160
  extParams.sender,
@@ -2380,7 +2378,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
2380
2378
  ixs,
2381
2379
  extParams.sender.publicKey,
2382
2380
  void 0,
2383
- [metadata]
2381
+ metadata
2384
2382
  );
2385
2383
  const signature = await signAndExecuteTransaction(
2386
2384
  this.connection,
@@ -2542,7 +2540,16 @@ var SolanaStreamClient = class extends BaseStreamClient {
2542
2540
  }
2543
2541
  const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
2544
2542
  for (const { ixs, metadata, recipient } of instructionsBatch) {
2545
- batch.push({ tx: createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
2543
+ const messageV0 = new TransactionMessage({
2544
+ payerKey: sender.publicKey,
2545
+ recentBlockhash: hash.blockhash,
2546
+ instructions: ixs
2547
+ }).compileToV0Message();
2548
+ const tx = new VersionedTransaction(messageV0);
2549
+ if (metadata) {
2550
+ tx.sign([metadata]);
2551
+ }
2552
+ batch.push({ tx, recipient });
2546
2553
  }
2547
2554
  const prepareInstructions = await this.getCreateATAInstructions(
2548
2555
  [STREAMFLOW_TREASURY_PUBLIC_KEY, partnerPublicKey],
@@ -2556,8 +2563,14 @@ var SolanaStreamClient = class extends BaseStreamClient {
2556
2563
  prepareInstructions.push(...nativeInstructions);
2557
2564
  }
2558
2565
  if (prepareInstructions.length > 0) {
2566
+ const messageV0 = new TransactionMessage({
2567
+ payerKey: sender.publicKey,
2568
+ recentBlockhash: hash.blockhash,
2569
+ instructions: prepareInstructions
2570
+ }).compileToV0Message();
2571
+ const tx = new VersionedTransaction(messageV0);
2559
2572
  batch.push({
2560
- tx: createVersionedTransaction(prepareInstructions, sender.publicKey, hash.blockhash),
2573
+ tx,
2561
2574
  recipient: sender.publicKey.toBase58()
2562
2575
  });
2563
2576
  }