@streamflow/stream 9.0.2 → 9.0.3

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.
@@ -219,6 +219,7 @@ declare class SolanaStreamClient extends BaseStreamClient {
219
219
  getConnection(): Connection;
220
220
  getCommitment(): Commitment | undefined;
221
221
  getProgramId(): string;
222
+ getAlignedProxyProgramId(): string;
222
223
  /**
223
224
  * Builds transaction instructions for creating a new stream/vesting contract without creating a transaction.
224
225
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
@@ -493,14 +494,14 @@ declare class SolanaStreamClient extends BaseStreamClient {
493
494
  * @returns Error code
494
495
  */
495
496
  extractErrorCode(err: Error): string | null;
497
+ /**
498
+ * Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
499
+ */
500
+ isAlignedUnlock(streamPublicKey: PublicKey, senderPublicKey: PublicKey): boolean;
496
501
  /**
497
502
  * Utility function to generate metadata for a Contract or return existing Pubkey
498
503
  */
499
504
  private getOrCreateStreamMetadata;
500
- /**
501
- * Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
502
- */
503
- private isAlignedUnlock;
504
505
  /**
505
506
  * Returns insrtuctions for creating associated token accounts for the provided owners
506
507
  */
@@ -5048,6 +5048,9 @@ var SolanaStreamClient = class extends BaseStreamClient {
5048
5048
  getProgramId() {
5049
5049
  return this.programId.toBase58();
5050
5050
  }
5051
+ getAlignedProxyProgramId() {
5052
+ return this.alignedProxyProgram.programId.toBase58();
5053
+ }
5051
5054
  /**
5052
5055
  * Builds transaction instructions for creating a new stream/vesting contract without creating a transaction.
5053
5056
  * All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
@@ -6276,6 +6279,13 @@ var SolanaStreamClient = class extends BaseStreamClient {
6276
6279
  const logs = "logs" in err && Array.isArray(err.logs) ? err.logs : void 0;
6277
6280
  return extractSolanaErrorCode(err.toString() ?? "Unknown error!", logs);
6278
6281
  }
6282
+ /**
6283
+ * Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
6284
+ */
6285
+ isAlignedUnlock(streamPublicKey, senderPublicKey) {
6286
+ const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
6287
+ return senderPublicKey.equals(pda);
6288
+ }
6279
6289
  /**
6280
6290
  * Utility function to generate metadata for a Contract or return existing Pubkey
6281
6291
  */
@@ -6290,13 +6300,6 @@ var SolanaStreamClient = class extends BaseStreamClient {
6290
6300
  }
6291
6301
  return { metadata, metadataPubKey };
6292
6302
  }
6293
- /**
6294
- * Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
6295
- */
6296
- isAlignedUnlock(streamPublicKey, senderPublicKey) {
6297
- const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
6298
- return senderPublicKey.equals(pda);
6299
- }
6300
6303
  /**
6301
6304
  * Returns insrtuctions for creating associated token accounts for the provided owners
6302
6305
  */