@streamflow/stream 9.0.3 → 9.0.4

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.
@@ -3587,10 +3587,20 @@ var SolanaStreamClient = class extends BaseStreamClient {
3587
3587
  const accounts = await this.connection.getProgramAccounts(this.programId, {
3588
3588
  filters
3589
3589
  });
3590
- return accounts.map(({ pubkey, account }) => ({
3591
- publicKey: pubkey,
3592
- account: new Contract(decodeStream(account.data))
3593
- }));
3590
+ const mapped = await Promise.all(
3591
+ accounts.map(async ({ pubkey, account }) => {
3592
+ const stream = decodeStream(account.data);
3593
+ if (this.isAlignedUnlock(pubkey, stream.sender)) {
3594
+ const alignedProxy = await this.alignedProxyProgram.account.contract.fetch(
3595
+ deriveContractPDA(this.alignedProxyProgram.programId, pubkey)
3596
+ );
3597
+ common.invariant(alignedProxy, "Couldn't get aligned proxy account info");
3598
+ return { publicKey: pubkey, account: new AlignedContract(stream, alignedProxy) };
3599
+ }
3600
+ return { publicKey: pubkey, account: new Contract(stream) };
3601
+ })
3602
+ );
3603
+ return mapped;
3594
3604
  }
3595
3605
  /**
3596
3606
  * Attempts updating the stream auto withdrawal params and amount per period