@streamflow/stream 10.0.0-alpha.p313.85091cd → 10.0.0-alpha.p313.8cfb43a
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 +9 -8
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +9 -8
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +2 -2
- package/dist/esm/index.js +9 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +2 -2
- package/dist/esm/solana/index.js +9 -8
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -2995,14 +2995,13 @@ var SolanaStreamClient = class {
|
|
|
2995
2995
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
|
|
2996
2996
|
* @returns Create multiple transaction instructions
|
|
2997
2997
|
*/
|
|
2998
|
-
async buildCreateMultipleTransactionInstructions(data, extParams) {
|
|
2998
|
+
async buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions = true) {
|
|
2999
2999
|
const { recipients, ...streamParams } = data;
|
|
3000
3000
|
const { sender, metadataPubKeys: metadataPubKeysExt, isNative, customInstructions } = extParams;
|
|
3001
3001
|
common.assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3002
3002
|
const metadatas = [];
|
|
3003
3003
|
const metadataToRecipient = {};
|
|
3004
3004
|
const instructionsBatch = [];
|
|
3005
|
-
const metadataPubKeys = metadataPubKeysExt || [];
|
|
3006
3005
|
const partnerPublicKey = data.partner ? new web3_js.PublicKey(data.partner) : WITHDRAWOR_PUBLIC_KEY;
|
|
3007
3006
|
const mintPublicKey = new web3_js.PublicKey(data.tokenId);
|
|
3008
3007
|
if (recipients.length === 0) {
|
|
@@ -3012,14 +3011,16 @@ var SolanaStreamClient = class {
|
|
|
3012
3011
|
const recipientData = recipients[i];
|
|
3013
3012
|
const createStreamData = { ...streamParams, ...recipientData };
|
|
3014
3013
|
const createStreamExtParams = {
|
|
3015
|
-
|
|
3016
|
-
|
|
3014
|
+
...extParams,
|
|
3015
|
+
metadataPubKeys: metadataPubKeysExt?.[i] ? [metadataPubKeysExt[i]] : void 0
|
|
3017
3016
|
};
|
|
3018
3017
|
const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
|
|
3019
3018
|
createStreamData,
|
|
3020
3019
|
createStreamExtParams
|
|
3021
3020
|
);
|
|
3022
|
-
|
|
3021
|
+
if (applyCustomAfterInstructions) {
|
|
3022
|
+
await this.applyCustomAfterInstructions(ixs, customInstructions, metadataPubKey);
|
|
3023
|
+
}
|
|
3023
3024
|
metadataToRecipient[metadataPubKey.toBase58()] = recipientData;
|
|
3024
3025
|
metadatas.push(metadataPubKey.toBase58());
|
|
3025
3026
|
instructionsBatch.push({
|
|
@@ -3067,9 +3068,9 @@ var SolanaStreamClient = class {
|
|
|
3067
3068
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender public key, native token handling, and custom instructions
|
|
3068
3069
|
* @returns Multiple transaction information
|
|
3069
3070
|
*/
|
|
3070
|
-
async buildCreateMultipleTransactions(data, extParams) {
|
|
3071
|
+
async buildCreateMultipleTransactions(data, extParams, applyCustomAfterInstructions = true) {
|
|
3071
3072
|
const { sender } = extParams;
|
|
3072
|
-
const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams);
|
|
3073
|
+
const { instructionsBatch, metadatas, metadataToRecipient, prepareInstructions } = await this.buildCreateMultipleTransactionInstructions(data, extParams, applyCustomAfterInstructions);
|
|
3073
3074
|
const { value: hash, context } = await this.connection.getLatestBlockhashAndContext();
|
|
3074
3075
|
const batch = [];
|
|
3075
3076
|
for (const { ixs, metadata, recipient } of instructionsBatch) {
|
|
@@ -3820,7 +3821,7 @@ var SolanaStreamClient = class {
|
|
|
3820
3821
|
async flatBuildCreateMultipleTransactionInstructions(data, extParams) {
|
|
3821
3822
|
const dataArray = Array.isArray(data) ? data : [data];
|
|
3822
3823
|
const results = await Promise.all(
|
|
3823
|
-
dataArray.map((item) => this.buildCreateMultipleTransactionInstructions(item, extParams))
|
|
3824
|
+
dataArray.map((item, index) => this.buildCreateMultipleTransactionInstructions(item, extParams, index === 0))
|
|
3824
3825
|
);
|
|
3825
3826
|
return {
|
|
3826
3827
|
instructionsBatch: results.flatMap((r) => r.instructionsBatch),
|