@streamflow/stream 8.0.1 → 8.0.2-alpha.p287.46f7492

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, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
12
+ import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, createVersionedTransaction, 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,7 +4748,9 @@ 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, metadata);
4751
+ const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, [
4752
+ metadata
4753
+ ]);
4752
4754
  const signature = await signAndExecuteTransaction(
4753
4755
  this.connection,
4754
4756
  extParams.sender,
@@ -4972,7 +4974,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
4972
4974
  ixs,
4973
4975
  extParams.sender.publicKey,
4974
4976
  void 0,
4975
- metadata
4977
+ [metadata]
4976
4978
  );
4977
4979
  const signature = await signAndExecuteTransaction(
4978
4980
  this.connection,
@@ -5134,16 +5136,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
5134
5136
  }
5135
5137
  const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
5136
5138
  for (const { ixs, metadata, recipient } of instructionsBatch) {
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 });
5139
+ batch.push({ tx: createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
5147
5140
  }
5148
5141
  const prepareInstructions = await this.getCreateATAInstructions(
5149
5142
  [STREAMFLOW_TREASURY_PUBLIC_KEY, partnerPublicKey],
@@ -5157,14 +5150,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
5157
5150
  prepareInstructions.push(...nativeInstructions);
5158
5151
  }
5159
5152
  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);
5166
5153
  batch.push({
5167
- tx,
5154
+ tx: createVersionedTransaction(prepareInstructions, sender.publicKey, hash.blockhash),
5168
5155
  recipient: sender.publicKey.toBase58()
5169
5156
  });
5170
5157
  }