@streamflow/stream 8.0.1 → 8.0.2-alpha.p287.a3616ff
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/cjs/index.cjs +6 -19
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +6 -19
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/esm/index.js +7 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.js +7 -20
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/solana/index.js
CHANGED
|
@@ -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, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, checkOrCreateAtaBatch } from '@streamflow/common/solana';
|
|
6
|
+
import { isSignerKeypair, isSignerWallet, executeTransaction, buildSendThrottler, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, getMintAndProgram, prepareBaseInstructions, ata, createVersionedTransaction, 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,7 +2154,9 @@ 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,
|
|
2157
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, sender.publicKey, void 0, [
|
|
2158
|
+
metadata
|
|
2159
|
+
]);
|
|
2158
2160
|
const signature = await signAndExecuteTransaction(
|
|
2159
2161
|
this.connection,
|
|
2160
2162
|
extParams.sender,
|
|
@@ -2378,7 +2380,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2378
2380
|
ixs,
|
|
2379
2381
|
extParams.sender.publicKey,
|
|
2380
2382
|
void 0,
|
|
2381
|
-
metadata
|
|
2383
|
+
[metadata]
|
|
2382
2384
|
);
|
|
2383
2385
|
const signature = await signAndExecuteTransaction(
|
|
2384
2386
|
this.connection,
|
|
@@ -2540,16 +2542,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2540
2542
|
}
|
|
2541
2543
|
const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
|
|
2542
2544
|
for (const { ixs, metadata, recipient } of instructionsBatch) {
|
|
2543
|
-
|
|
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 });
|
|
2545
|
+
batch.push({ tx: createVersionedTransaction(ixs, sender.publicKey, hash.blockhash, [metadata]), recipient });
|
|
2553
2546
|
}
|
|
2554
2547
|
const prepareInstructions = await this.getCreateATAInstructions(
|
|
2555
2548
|
[STREAMFLOW_TREASURY_PUBLIC_KEY, partnerPublicKey],
|
|
@@ -2563,14 +2556,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2563
2556
|
prepareInstructions.push(...nativeInstructions);
|
|
2564
2557
|
}
|
|
2565
2558
|
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);
|
|
2572
2559
|
batch.push({
|
|
2573
|
-
tx,
|
|
2560
|
+
tx: createVersionedTransaction(prepareInstructions, sender.publicKey, hash.blockhash),
|
|
2574
2561
|
recipient: sender.publicKey.toBase58()
|
|
2575
2562
|
});
|
|
2576
2563
|
}
|