@streamflow/stream 9.2.0-alpha.p0.5034440 → 9.2.1-alpha.p321.02efd07
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-ByMlPIUq.d.cts → index-CPUhIwK2.d.cts} +4 -0
- package/dist/cjs/index.cjs +38 -16
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/solana/index.cjs +38 -16
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +1 -1
- package/dist/esm/{index-DsFyl13W.d.ts → index-DLVKn7Ae.d.ts} +4 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +38 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +1 -1
- package/dist/esm/solana/index.js +38 -16
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAp
|
|
|
2
2
|
export { i as StreamflowAptos } from './index-DYIamO0j.cjs';
|
|
3
3
|
import { E as EvmStreamClient } from './index-BMZATAYa.cjs';
|
|
4
4
|
export { i as StreamflowEVM } from './index-BMZATAYa.cjs';
|
|
5
|
-
import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-
|
|
6
|
-
export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-
|
|
5
|
+
import { S as SolanaStreamClient, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, b as ITopUpStreamSolanaExt } from './index-CPUhIwK2.cjs';
|
|
6
|
+
export { s as AIRDROP_AMOUNT, q as AIRDROP_TEST_TOKEN, j as ALIGNED_COMPUTE_LIMIT, A as ALIGNED_PRECISION_FACTOR_POW, h as ALIGNED_UNLOCKS_PROGRAM_ID, k as CONTRACT_DISCRIMINATOR, m as CONTRACT_SEED, C as CREATE_PARAMS_PADDING, D as DEFAULT_STREAMFLOW_FEE, E as ESCROW_SEED, r as FEES_METADATA_SEED, F as FEE_ORACLE_PUBLIC_KEY, O as ORIGINAL_CONTRACT_SENDER_OFFSET, u as PARTNERS_SCHEMA, o as PARTNER_ORACLE_PROGRAM_ID, t as PARTNER_SCHEMA, P as PROGRAM_ID, w as SOLANA_ERROR_MAP, v as SOLANA_ERROR_MATCH_REGEX, p as STREAMFLOW_TREASURY_PUBLIC_KEY, g as STREAM_STRUCT_OFFSETS, f as STREAM_STRUCT_OFFSET_CLOSED, e as STREAM_STRUCT_OFFSET_MINT, d as STREAM_STRUCT_OFFSET_RECIPIENT, c as STREAM_STRUCT_OFFSET_SENDER, i as StreamflowSolana, l as TEST_ORACLE_DISCRIMINATOR, n as TEST_ORACLE_SEED, T as TX_FINALITY_CONFIRMED, W as WITHDRAWOR_PUBLIC_KEY } from './index-CPUhIwK2.cjs';
|
|
7
7
|
import { S as SuiStreamClient } from './index-Y0HH2ugY.cjs';
|
|
8
8
|
export { i as StreamflowSui } from './index-Y0HH2ugY.cjs';
|
|
9
9
|
import { S as Stream, A as AlignedStream, I as ICreateStreamData, a as ICreateAlignedStreamData, b as StreamType, B as BaseStreamClient, c as SolanaStreamClientOptions, d as AptosStreamClientOptions, e as SuiStreamClientOptions, E as EvmStreamClientOptions, f as ICreateStreamSuiExt, g as ICreateResult, h as ICreateMultipleStreamData, i as IMultiTransactionResult, j as IWithdrawData, k as ITransactionSuiExt, l as ITransactionResult, m as ICancelData, n as ITransferData, o as ITopUpData, p as IGetOneData, q as IGetAllData, r as IUpdateData, s as IGetFeesData, t as IFees } from './BaseStreamClient-DOyJqO7R.cjs';
|
|
@@ -2998,6 +2998,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
2998
2998
|
const metadatas = [];
|
|
2999
2999
|
const metadataToRecipient = {};
|
|
3000
3000
|
const instructionsBatch = [];
|
|
3001
|
+
const metadataPubKeys = metadataPubKeysExt || [];
|
|
3001
3002
|
const partnerPublicKey = data.partner ? new web3_js.PublicKey(data.partner) : WITHDRAWOR_PUBLIC_KEY;
|
|
3002
3003
|
const mintPublicKey = new web3_js.PublicKey(data.tokenId);
|
|
3003
3004
|
if (recipients.length === 0) {
|
|
@@ -3007,8 +3008,8 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
3007
3008
|
const recipientData = recipients[i];
|
|
3008
3009
|
const createStreamData = { ...streamParams, ...recipientData };
|
|
3009
3010
|
const createStreamExtParams = {
|
|
3010
|
-
|
|
3011
|
-
|
|
3011
|
+
metadataPubKeys: metadataPubKeys[i] ? [metadataPubKeys[i]] : void 0,
|
|
3012
|
+
...extParams
|
|
3012
3013
|
};
|
|
3013
3014
|
const { ixs, metadata, metadataPubKey } = await this.prepareCreateInstructions(
|
|
3014
3015
|
createStreamData,
|
|
@@ -3674,20 +3675,41 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
3674
3675
|
const accounts = await this.connection.getProgramAccounts(this.programId, {
|
|
3675
3676
|
filters
|
|
3676
3677
|
});
|
|
3677
|
-
const
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3678
|
+
const decoded = this.decodeStreamsFromAccounts(accounts);
|
|
3679
|
+
const alignedEntries = this.collectAlignedEntries(decoded);
|
|
3680
|
+
const alignedProxies = await this.fetchAlignedProxiesByEntries(alignedEntries);
|
|
3681
|
+
return this.mapDecodedToProgramAccounts(decoded, alignedEntries, alignedProxies);
|
|
3682
|
+
}
|
|
3683
|
+
decodeStreamsFromAccounts(accounts) {
|
|
3684
|
+
return accounts.map(({ pubkey, account }) => ({
|
|
3685
|
+
pubkey,
|
|
3686
|
+
stream: decodeStream(account.data)
|
|
3687
|
+
}));
|
|
3688
|
+
}
|
|
3689
|
+
collectAlignedEntries(decoded) {
|
|
3690
|
+
const entries = [];
|
|
3691
|
+
decoded.forEach(({ pubkey, stream }, index) => {
|
|
3692
|
+
if (this.isAlignedUnlock(pubkey, stream.sender)) {
|
|
3693
|
+
entries.push({ index, pda: deriveContractPDA(this.alignedProxyProgram.programId, pubkey) });
|
|
3694
|
+
}
|
|
3695
|
+
});
|
|
3696
|
+
return entries;
|
|
3697
|
+
}
|
|
3698
|
+
async fetchAlignedProxiesByEntries(aligned) {
|
|
3699
|
+
if (aligned.length === 0) return [];
|
|
3700
|
+
const res = await this.alignedProxyProgram.account.contract.fetchMultiple(aligned.map((a) => a.pda));
|
|
3701
|
+
return res;
|
|
3702
|
+
}
|
|
3703
|
+
mapDecodedToProgramAccounts(decoded, alignedEntries, alignedProxies) {
|
|
3704
|
+
return decoded.map(({ pubkey, stream }, idx) => {
|
|
3705
|
+
const alignedIdx = alignedEntries.findIndex((a) => a.index === idx);
|
|
3706
|
+
if (alignedIdx !== -1) {
|
|
3707
|
+
const alignedProxy = alignedProxies[alignedIdx];
|
|
3708
|
+
common.invariant(alignedProxy, "Couldn't get aligned proxy account info");
|
|
3709
|
+
return { publicKey: pubkey, account: new AlignedContract(stream, alignedProxy) };
|
|
3710
|
+
}
|
|
3711
|
+
return { publicKey: pubkey, account: new Contract(stream) };
|
|
3712
|
+
});
|
|
3691
3713
|
}
|
|
3692
3714
|
/**
|
|
3693
3715
|
* Attempts updating the stream auto withdrawal params and amount per period
|