@streamflow/stream 8.0.0-alpha.p287.5172056 → 8.0.0

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
@@ -9,7 +9,7 @@ import { toChecksumAddress } from 'ethereum-checksum-address';
9
9
  import bs58 from 'bs58';
10
10
  import { NATIVE_MINT, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token';
11
11
  import { PublicKey, TransactionInstruction, Connection, Keypair, SYSVAR_RENT_PUBKEY, SystemProgram, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
12
- import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, createVersionedTransaction, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
12
+ import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
13
13
  import * as borsh from 'borsh';
14
14
  import { Program } from '@coral-xyz/anchor';
15
15
  import * as BufferLayout from '@solana/buffer-layout';
@@ -4748,9 +4748,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
4748
4748
  ixs.push(...await prepareWrappedAccount(this.connection, sender.publicKey, totalAmount));
4749
4749
  }
4750
4750
  await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
4751
- const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, [
4752
- metadata
4753
- ]);
4751
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, metadata);
4754
4752
  const signature = await signAndExecuteTransaction(
4755
4753
  this.connection,
4756
4754
  extParams.sender,
@@ -4974,7 +4972,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
4974
4972
  ixs,
4975
4973
  extParams.sender.publicKey,
4976
4974
  void 0,
4977
- [metadata]
4975
+ metadata
4978
4976
  );
4979
4977
  const signature = await signAndExecuteTransaction(
4980
4978
  this.connection,
@@ -5136,7 +5134,16 @@ var SolanaStreamClient = class extends BaseStreamClient {
5136
5134
  }
5137
5135
  const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
5138
5136
  for (const { ixs, metadata, recipient } of instructionsBatch) {
5139
- batch.push({ tx: createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
5137
+ const messageV0 = new TransactionMessage({
5138
+ payerKey: sender.publicKey,
5139
+ recentBlockhash: hash.blockhash,
5140
+ instructions: ixs
5141
+ }).compileToV0Message();
5142
+ const tx = new VersionedTransaction(messageV0);
5143
+ if (metadata) {
5144
+ tx.sign([metadata]);
5145
+ }
5146
+ batch.push({ tx, recipient });
5140
5147
  }
5141
5148
  const prepareInstructions = await this.getCreateATAInstructions(
5142
5149
  [STREAMFLOW_TREASURY_PUBLIC_KEY, partnerPublicKey],
@@ -5150,8 +5157,14 @@ var SolanaStreamClient = class extends BaseStreamClient {
5150
5157
  prepareInstructions.push(...nativeInstructions);
5151
5158
  }
5152
5159
  if (prepareInstructions.length > 0) {
5160
+ const messageV0 = new TransactionMessage({
5161
+ payerKey: sender.publicKey,
5162
+ recentBlockhash: hash.blockhash,
5163
+ instructions: prepareInstructions
5164
+ }).compileToV0Message();
5165
+ const tx = new VersionedTransaction(messageV0);
5153
5166
  batch.push({
5154
- tx: createVersionedTransaction(prepareInstructions, sender.publicKey, hash.blockhash),
5167
+ tx,
5155
5168
  recipient: sender.publicKey.toBase58()
5156
5169
  });
5157
5170
  }