@streamflow/stream 9.0.1 → 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.
- package/dist/cjs/{index-oCYfzJrc.d.cts → index-BgGtpOPg.d.cts} +5 -4
- package/dist/cjs/index.cjs +11 -8
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/solana/index.cjs +11 -8
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +1 -1
- package/dist/esm/{index-BNQVJtIE.d.ts → index-Dp5DXxr-.d.ts} +5 -4
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +11 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +1 -1
- package/dist/esm/solana/index.js +11 -8
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Z as Account, a5 as AlignedContract, M as AlignedUnlocksContract, a8 as BatchItem, aa as BatchItemError, ab as BatchItemResult, a9 as BatchItemSuccess, U as ChangeOracleParams, y as ClientCreationOptions, a4 as Contract, R as CreateParams, V as CreateTestOracleParams, a6 as DecodedStream, $ as ICreateSolanaExt, a3 as ICreateStreamInstructions, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, a1 as IPrepareCreateStreamSolanaExt, a2 as IPrepareStreamSolanaExt, Y as ISearchStreams, b as ITopUpStreamSolanaExt, a0 as ITransactionSolanaExtWithInstructions, ac as InstructionGenerator, a7 as MetadataRecipientHashMap, N as OracleType, S as SolanaStreamClient, Q as TestOracle, X as UpdateTestOracleParams, ah as cancelStreamInstruction, x as constants, ad as createStreamInstruction, ae as createUncheckedStreamInstruction, z as decodeStream, J as deriveContractPDA, K as deriveEscrowPDA, L as deriveTestOraclePDA, H as extractSolanaErrorCode, G as sendAndConfirmStreamRawTransaction, B as signAllTransactionWithRecipients, _ as timelockIDL, aj as topupStreamInstruction, ai as transferStreamInstruction, ag as updateStreamInstruction, af as withdrawStreamInstruction } from '../index-
|
|
1
|
+
export { Z as Account, a5 as AlignedContract, M as AlignedUnlocksContract, a8 as BatchItem, aa as BatchItemError, ab as BatchItemResult, a9 as BatchItemSuccess, U as ChangeOracleParams, y as ClientCreationOptions, a4 as Contract, R as CreateParams, V as CreateTestOracleParams, a6 as DecodedStream, $ as ICreateSolanaExt, a3 as ICreateStreamInstructions, I as ICreateStreamSolanaExt, a as IInteractStreamSolanaExt, a1 as IPrepareCreateStreamSolanaExt, a2 as IPrepareStreamSolanaExt, Y as ISearchStreams, b as ITopUpStreamSolanaExt, a0 as ITransactionSolanaExtWithInstructions, ac as InstructionGenerator, a7 as MetadataRecipientHashMap, N as OracleType, S as SolanaStreamClient, Q as TestOracle, X as UpdateTestOracleParams, ah as cancelStreamInstruction, x as constants, ad as createStreamInstruction, ae as createUncheckedStreamInstruction, z as decodeStream, J as deriveContractPDA, K as deriveEscrowPDA, L as deriveTestOraclePDA, H as extractSolanaErrorCode, G as sendAndConfirmStreamRawTransaction, B as signAllTransactionWithRecipients, _ as timelockIDL, aj as topupStreamInstruction, ai as transferStreamInstruction, ag as updateStreamInstruction, af as withdrawStreamInstruction } from '../index-BgGtpOPg.cjs';
|
|
2
2
|
export { ContractError, IChain, ICluster } from '@streamflow/common';
|
|
3
3
|
import 'p-queue';
|
|
4
4
|
import '@solana/web3.js';
|
|
@@ -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
|
*/
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { A as AptosStreamClient, I as ICreateStreamAptosExt, a as ITransactionAp
|
|
|
2
2
|
export { i as StreamflowAptos } from './index-D54wSYym.js';
|
|
3
3
|
import { E as EvmStreamClient } from './index-elpYUBph.js';
|
|
4
4
|
export { i as StreamflowEVM } from './index-elpYUBph.js';
|
|
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-Dp5DXxr-.js';
|
|
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-Dp5DXxr-.js';
|
|
7
7
|
import { S as SuiStreamClient } from './index-DrzqsoIB.js';
|
|
8
8
|
export { i as StreamflowSui } from './index-DrzqsoIB.js';
|
|
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.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -5022,6 +5022,9 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5022
5022
|
getProgramId() {
|
|
5023
5023
|
return this.programId.toBase58();
|
|
5024
5024
|
}
|
|
5025
|
+
getAlignedProxyProgramId() {
|
|
5026
|
+
return this.alignedProxyProgram.programId.toBase58();
|
|
5027
|
+
}
|
|
5025
5028
|
/**
|
|
5026
5029
|
* Builds transaction instructions for creating a new stream/vesting contract without creating a transaction.
|
|
5027
5030
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
@@ -5159,7 +5162,7 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
5159
5162
|
floorPrice
|
|
5160
5163
|
} = streamParams;
|
|
5161
5164
|
const { isNative, sender, computeLimit, computePrice, metadataPubKeys } = extParams;
|
|
5162
|
-
invariant(
|
|
5165
|
+
invariant(priceOracle || !oracleType || oracleType === "none", "Price oracle is required for the specified oracle type");
|
|
5163
5166
|
assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
|
|
5164
5167
|
const recipientPublicKey = new PublicKey(recipient);
|
|
5165
5168
|
const mintPublicKey = isNative ? NATIVE_MINT : new PublicKey(mint);
|
|
@@ -6250,6 +6253,13 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
6250
6253
|
const logs = "logs" in err && Array.isArray(err.logs) ? err.logs : void 0;
|
|
6251
6254
|
return extractSolanaErrorCode(err.toString() ?? "Unknown error!", logs);
|
|
6252
6255
|
}
|
|
6256
|
+
/**
|
|
6257
|
+
* Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
|
|
6258
|
+
*/
|
|
6259
|
+
isAlignedUnlock(streamPublicKey, senderPublicKey) {
|
|
6260
|
+
const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
|
|
6261
|
+
return senderPublicKey.equals(pda);
|
|
6262
|
+
}
|
|
6253
6263
|
/**
|
|
6254
6264
|
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
6255
6265
|
*/
|
|
@@ -6264,13 +6274,6 @@ var SolanaStreamClient = class extends BaseStreamClient {
|
|
|
6264
6274
|
}
|
|
6265
6275
|
return { metadata, metadataPubKey };
|
|
6266
6276
|
}
|
|
6267
|
-
/**
|
|
6268
|
-
* Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
|
|
6269
|
-
*/
|
|
6270
|
-
isAlignedUnlock(streamPublicKey, senderPublicKey) {
|
|
6271
|
-
const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
|
|
6272
|
-
return senderPublicKey.equals(pda);
|
|
6273
|
-
}
|
|
6274
6277
|
/**
|
|
6275
6278
|
* Returns insrtuctions for creating associated token accounts for the provided owners
|
|
6276
6279
|
*/
|