@streamflow/stream 10.0.0-alpha.p313.4046054 → 10.0.0-alpha.p313.85091cd
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 +26 -11
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/index.cjs +26 -11
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +10 -9
- package/dist/esm/index.js +26 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +10 -9
- package/dist/esm/solana/index.js +26 -11
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -2664,7 +2664,7 @@ var SolanaStreamClient = class {
|
|
|
2664
2664
|
return { ixs, txId: signature, metadataId };
|
|
2665
2665
|
}
|
|
2666
2666
|
async prepareCreateInstructions(streamParams, extParams) {
|
|
2667
|
-
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.
|
|
2667
|
+
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.prepareCreateLinearStreamInstructions(streamParams, extParams);
|
|
2668
2668
|
return { ixs, metadata, metadataPubKey };
|
|
2669
2669
|
}
|
|
2670
2670
|
async prepareCreateAlignedUnlockInstructions(streamParams, extParams) {
|
|
@@ -2774,7 +2774,7 @@ var SolanaStreamClient = class {
|
|
|
2774
2774
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
2775
2775
|
* @returns Create stream instructions
|
|
2776
2776
|
*/
|
|
2777
|
-
async
|
|
2777
|
+
async prepareCreateLinearStreamInstructions({
|
|
2778
2778
|
recipient,
|
|
2779
2779
|
tokenId: mint,
|
|
2780
2780
|
start,
|
|
@@ -3100,7 +3100,7 @@ var SolanaStreamClient = class {
|
|
|
3100
3100
|
if (!sender.publicKey) {
|
|
3101
3101
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3102
3102
|
}
|
|
3103
|
-
const { instructionsBatch, metadatas,
|
|
3103
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
3104
3104
|
const errors = [];
|
|
3105
3105
|
const signatures = [];
|
|
3106
3106
|
const metadataPubKeys = metadataPubKeysExt || [];
|
|
@@ -3165,7 +3165,7 @@ var SolanaStreamClient = class {
|
|
|
3165
3165
|
if (!sender.publicKey) {
|
|
3166
3166
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3167
3167
|
}
|
|
3168
|
-
const { instructionsBatch, metadatas,
|
|
3168
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
3169
3169
|
const errors = [];
|
|
3170
3170
|
const signatures = [];
|
|
3171
3171
|
const batch = [];
|
|
@@ -3327,7 +3327,7 @@ var SolanaStreamClient = class {
|
|
|
3327
3327
|
}
|
|
3328
3328
|
const { sender: senderPublicKey } = decodeStream(account.data);
|
|
3329
3329
|
const isAlignedUnlock = this.isAlignedUnlock(streamPublicKey, senderPublicKey);
|
|
3330
|
-
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.
|
|
3330
|
+
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.prepareCancelLinearStream(cancelData, extParams);
|
|
3331
3331
|
return ixs;
|
|
3332
3332
|
}
|
|
3333
3333
|
/**
|
|
@@ -3375,7 +3375,7 @@ var SolanaStreamClient = class {
|
|
|
3375
3375
|
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet, token account validation, and compute settings
|
|
3376
3376
|
* @returns Transaction instructions
|
|
3377
3377
|
*/
|
|
3378
|
-
async
|
|
3378
|
+
async prepareCancelLinearStream({ id }, { invoker, checkTokenAccounts, computePrice, computeLimit }) {
|
|
3379
3379
|
common.assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3380
3380
|
const streamPublicKey = new web3_js.PublicKey(id);
|
|
3381
3381
|
const escrowAcc = await this.connection.getAccountInfo(streamPublicKey);
|
|
@@ -3788,11 +3788,11 @@ var SolanaStreamClient = class {
|
|
|
3788
3788
|
return DEFAULT_STREAMFLOW_FEE;
|
|
3789
3789
|
}
|
|
3790
3790
|
/**
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3791
|
+
* Returns total fee percent, streamflow fees + partner fees
|
|
3792
|
+
* @param getFeesData structure with address for which we need to derive fee, either sender or partner usually
|
|
3793
|
+
* @param chainSpecificParams additional parameters required by chain client
|
|
3794
|
+
* @returns fee as floating number, so if fee is 0.99%, it will return 0.99
|
|
3795
|
+
*/
|
|
3796
3796
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3797
3797
|
async getTotalFee(getFeesData) {
|
|
3798
3798
|
const fees = await this.getFees(getFeesData);
|
|
@@ -3817,6 +3817,21 @@ var SolanaStreamClient = class {
|
|
|
3817
3817
|
const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
|
|
3818
3818
|
return senderPublicKey.equals(pda);
|
|
3819
3819
|
}
|
|
3820
|
+
async flatBuildCreateMultipleTransactionInstructions(data, extParams) {
|
|
3821
|
+
const dataArray = Array.isArray(data) ? data : [data];
|
|
3822
|
+
const results = await Promise.all(
|
|
3823
|
+
dataArray.map((item) => this.buildCreateMultipleTransactionInstructions(item, extParams))
|
|
3824
|
+
);
|
|
3825
|
+
return {
|
|
3826
|
+
instructionsBatch: results.flatMap((r) => r.instructionsBatch),
|
|
3827
|
+
metadatas: results.flatMap((r) => r.metadatas),
|
|
3828
|
+
prepareInstructions: results.flatMap((r) => r.prepareInstructions),
|
|
3829
|
+
metadataToRecipient: results.reduce(
|
|
3830
|
+
(acc, r) => Object.assign(acc, r.metadataToRecipient),
|
|
3831
|
+
{}
|
|
3832
|
+
)
|
|
3833
|
+
};
|
|
3834
|
+
}
|
|
3820
3835
|
/**
|
|
3821
3836
|
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
3822
3837
|
*/
|