@streamflow/stream 13.3.1 → 13.4.0
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-B2NHAfM3.d.cts → index-BqHEM38f.d.cts} +1 -0
- package/dist/cjs/index.cjs +36 -10
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/solana/api/index.cjs +34 -10
- package/dist/cjs/solana/api/index.cjs.map +1 -1
- package/dist/cjs/solana/api/index.d.cts +1 -1
- package/dist/cjs/solana/descriptor/streamflow_aligned_unlocks.d.cts +11 -0
- package/dist/cjs/solana/index.cjs +36 -10
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +15 -3
- package/dist/esm/{index-aMPWxsk6.d.ts → index-CYAitoQO.d.ts} +1 -0
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +108 -84
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/api/index.d.ts +1 -1
- package/dist/esm/solana/api/index.js +107 -83
- package/dist/esm/solana/api/index.js.map +1 -1
- package/dist/esm/solana/descriptor/idl/streamflow_aligned_unlocks.json +12 -1
- package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.d.ts +11 -0
- package/dist/esm/solana/index.d.ts +15 -3
- package/dist/esm/solana/index.js +108 -84
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DecodedStream, B as BatchItem, a as BatchItemResult, R as RoutedFeeDestination, I as IUpdateData, S as StreamType, b as Stream, A as AlignedStream, c as ICreateStreamData, d as ICreateAlignedStreamData, e as ISearchStreams } from '../index-
|
|
2
|
-
export { f as Account, g as AlignedContract, h as AlignedProxyErrorCode, i as AlignedStreamData, j as AlignedUnlocksContract, k as BatchCreationItem, l as BatchExecuteResult, m as BatchInstructionResult, n as BatchItemError, o as BatchItemSuccess, p as BuildTransactionFn, q as BuildTransactionOptions, r as BuiltTransaction, C as CancelFn, s as ChangeOracleParams, t as ClientCreationOptions, u as Contract, v as ContractErrorCode, w as CreateBatchFn, x as CreateFn, y as CreateInstructionResult, z as CreateParams, E as CreateTestOracleParams, F as Env, G as ExecuteBatchFn, H as ExecuteBatchSequentialFn, J as ExecuteFn, K as ExecutionEnv, L as IAlignedStreamConfig, M as IBaseStreamConfig, N as ICancelData, O as IClaimRoutedFeeData, P as ICreateExt, Q as ICreateLinearStreamData, T as ICreateLockBatchParams, U as ICreateLockParams, V as ICreateMultiError, W as ICreateMultipleAlignedStreamData, X as ICreateMultipleLinearStreamData, Y as ICreateMultipleStreamData, Z as ICreateResult, _ as ICreateStreamExt, $ as ICreateStreamInstructions, a0 as ICreateVestingBatchParams, a1 as ICreateVestingParams, a2 as IFees, a3 as IGetAllData, a4 as IGetFeesData, a5 as IGetOneData, a6 as IInteractData, a7 as IInteractStreamExt, a8 as ILockBatchRecipient, a9 as IMultiTransactionResult, aa as IPrepareCreateStreamExt, ab as IPrepareStreamExt, ac as IPrepareTopUpstreamExt, ad as IRecipient, ae as ITopUpData, af as ITopUpStreamExt, ag as ITransactionExtWithInstructions, ah as ITransactionResult, ai as ITransferData, aj as IVestingBatchRecipient, ak as IWithdrawData, al as InstructionGenerator, am as InstructionResult, an as Invoker, ao as LinearStream, ap as MetadataRecipientHashMap, aq as NativeOptions, ar as OracleType, as as OracleTypeName, at as SignFn, au as SolanaStreamClient, av as StreamClientOptions, aw as StreamClientOptionsWithConnection, ax as StreamDirection, ay as TestOracle, az as TopupFn, aA as TransactionSchedulingOptions, aB as TransferFn, aC as UpdateFn, aD as UpdateTestOracleParams, aE as WithdrawFn, aF as buildLockBatchParams, aG as buildLockParams, aH as buildTransaction, aI as buildVestingBatchParams, aJ as buildVestingParams, aK as cancel, aL as computeAmountPerPeriod, aM as create, aN as createBatch, aO as createClientFromEnv, aP as createLock, aQ as createLockBatch, aR as createVesting, aS as createVestingBatch, aT as execute, aU as executeBatch, aV as executeBatchSequential, aW as resolveConnection, aX as resolveDuration, aY as sign, aZ as topup, a_ as transfer, a$ as update, b0 as withdraw } from '../index-
|
|
1
|
+
import { D as DecodedStream, B as BatchItem, a as BatchItemResult, R as RoutedFeeDestination, I as IUpdateData, S as StreamType, b as Stream, A as AlignedStream, c as ICreateStreamData, d as ICreateAlignedStreamData, e as ISearchStreams } from '../index-BqHEM38f.cjs';
|
|
2
|
+
export { f as Account, g as AlignedContract, h as AlignedProxyErrorCode, i as AlignedStreamData, j as AlignedUnlocksContract, k as BatchCreationItem, l as BatchExecuteResult, m as BatchInstructionResult, n as BatchItemError, o as BatchItemSuccess, p as BuildTransactionFn, q as BuildTransactionOptions, r as BuiltTransaction, C as CancelFn, s as ChangeOracleParams, t as ClientCreationOptions, u as Contract, v as ContractErrorCode, w as CreateBatchFn, x as CreateFn, y as CreateInstructionResult, z as CreateParams, E as CreateTestOracleParams, F as Env, G as ExecuteBatchFn, H as ExecuteBatchSequentialFn, J as ExecuteFn, K as ExecutionEnv, L as IAlignedStreamConfig, M as IBaseStreamConfig, N as ICancelData, O as IClaimRoutedFeeData, P as ICreateExt, Q as ICreateLinearStreamData, T as ICreateLockBatchParams, U as ICreateLockParams, V as ICreateMultiError, W as ICreateMultipleAlignedStreamData, X as ICreateMultipleLinearStreamData, Y as ICreateMultipleStreamData, Z as ICreateResult, _ as ICreateStreamExt, $ as ICreateStreamInstructions, a0 as ICreateVestingBatchParams, a1 as ICreateVestingParams, a2 as IFees, a3 as IGetAllData, a4 as IGetFeesData, a5 as IGetOneData, a6 as IInteractData, a7 as IInteractStreamExt, a8 as ILockBatchRecipient, a9 as IMultiTransactionResult, aa as IPrepareCreateStreamExt, ab as IPrepareStreamExt, ac as IPrepareTopUpstreamExt, ad as IRecipient, ae as ITopUpData, af as ITopUpStreamExt, ag as ITransactionExtWithInstructions, ah as ITransactionResult, ai as ITransferData, aj as IVestingBatchRecipient, ak as IWithdrawData, al as InstructionGenerator, am as InstructionResult, an as Invoker, ao as LinearStream, ap as MetadataRecipientHashMap, aq as NativeOptions, ar as OracleType, as as OracleTypeName, at as SignFn, au as SolanaStreamClient, av as StreamClientOptions, aw as StreamClientOptionsWithConnection, ax as StreamDirection, ay as TestOracle, az as TopupFn, aA as TransactionSchedulingOptions, aB as TransferFn, aC as UpdateFn, aD as UpdateTestOracleParams, aE as WithdrawFn, aF as buildLockBatchParams, aG as buildLockParams, aH as buildTransaction, aI as buildVestingBatchParams, aJ as buildVestingParams, aK as cancel, aL as computeAmountPerPeriod, aM as create, aN as createBatch, aO as createClientFromEnv, aP as createLock, aQ as createLockBatch, aR as createVesting, aS as createVestingBatch, aT as execute, aU as executeBatch, aV as executeBatchSequential, aW as resolveConnection, aX as resolveDuration, aY as sign, aZ as topup, a_ as transfer, a$ as update, b0 as withdraw } from '../index-BqHEM38f.cjs';
|
|
3
3
|
import { ConfirmationParams, ThrottleParams } from '@streamflow/common';
|
|
4
4
|
export { ContractError, ICluster, getBN, getNumberFromBN } from '@streamflow/common';
|
|
5
5
|
import { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
@@ -26,6 +26,18 @@ declare const getMetadataKey: (streamPubkey: PublicKey, oldMetadata: PublicKey)
|
|
|
26
26
|
* @returns total tokens amount that Contract will retrieve from the Sender
|
|
27
27
|
*/
|
|
28
28
|
declare const calculateTotalAmountToDeposit: (depositedAmount: BN, totalFee: number) => BN;
|
|
29
|
+
/**
|
|
30
|
+
* Encode a contract name into the fixed 64 byte buffer the protocol stores it in.
|
|
31
|
+
* @param name contract name, up to 64 bytes once utf-8 encoded
|
|
32
|
+
* @returns right padded 64 byte buffer
|
|
33
|
+
*/
|
|
34
|
+
declare const encodeStreamName: (name: string) => Buffer;
|
|
35
|
+
/**
|
|
36
|
+
* Encode a contract name into an Array - used to pass as anchor param
|
|
37
|
+
* @param name contract name, up to 64 bytes once utf-8 encoded
|
|
38
|
+
* @returns array of numbers
|
|
39
|
+
*/
|
|
40
|
+
declare const encodeStreamNameAsArray: (name: string) => Array<number>;
|
|
29
41
|
declare const decodeStream: (buf: Buffer) => DecodedStream;
|
|
30
42
|
/**
|
|
31
43
|
* Sign passed BatchItems with wallet request or KeyPair
|
|
@@ -614,4 +626,4 @@ declare const createClient: (options?: ApiClientOptions) => ApiClient;
|
|
|
614
626
|
|
|
615
627
|
declare const transformContract: (schema: ContractSchema) => Promise<Stream>;
|
|
616
628
|
|
|
617
|
-
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedStream, type ApiClient, type ApiClientOptions, BatchItem, BatchItemResult, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type Chain, type ContractSchema, type ContractType, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, DecodedStream, type DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type GetContractsOptions, ICreateAlignedStreamData, ICreateStreamData, ISearchStreams, IUpdateData, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, type PriceOracleType, REPOPULATED_METADATA_SEED, RoutedFeeDestination, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, Stream, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TabulariumContract, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, claimRoutedFeeStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
|
|
629
|
+
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedStream, type ApiClient, type ApiClientOptions, BatchItem, BatchItemResult, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, type Chain, type ContractSchema, type ContractType, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, DecodedStream, type DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, type GetContractsOptions, ICreateAlignedStreamData, ICreateStreamData, ISearchStreams, IUpdateData, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, type PriceOracleType, REPOPULATED_METADATA_SEED, RoutedFeeDestination, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, Stream, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, type TabulariumContract, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, claimRoutedFeeStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, encodeStreamName, encodeStreamNameAsArray, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, _default as timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction };
|
|
@@ -69,6 +69,7 @@ interface IUpdateData extends IInteractData {
|
|
|
69
69
|
transferableBySender?: boolean;
|
|
70
70
|
transferableByRecipient?: boolean;
|
|
71
71
|
cancelableBySender?: boolean;
|
|
72
|
+
name?: string;
|
|
72
73
|
}
|
|
73
74
|
type ICancelData = IInteractData;
|
|
74
75
|
type RoutedFeeDestination = "treasury" | "sender";
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { f as Account, g as AlignedContract, h as AlignedProxyErrorCode, A as AlignedStream, i as AlignedStreamData, j as AlignedUnlocksContract, k as BatchCreationItem, l as BatchExecuteResult, m as BatchInstructionResult, B as BatchItem, n as BatchItemError, a as BatchItemResult, o as BatchItemSuccess, p as BuildTransactionFn, q as BuildTransactionOptions, r as BuiltTransaction, C as CancelFn, s as ChangeOracleParams, t as ClientCreationOptions, u as Contract, v as ContractErrorCode, w as CreateBatchFn, x as CreateFn, y as CreateInstructionResult, z as CreateParams, E as CreateTestOracleParams, D as DecodedStream, F as Env, G as ExecuteBatchFn, H as ExecuteBatchSequentialFn, J as ExecuteFn, K as ExecutionEnv, L as IAlignedStreamConfig, M as IBaseStreamConfig, N as ICancelData, O as IClaimRoutedFeeData, d as ICreateAlignedStreamData, P as ICreateExt, Q as ICreateLinearStreamData, T as ICreateLockBatchParams, U as ICreateLockParams, V as ICreateMultiError, W as ICreateMultipleAlignedStreamData, X as ICreateMultipleLinearStreamData, Y as ICreateMultipleStreamData, Z as ICreateResult, c as ICreateStreamData, _ as ICreateStreamExt, $ as ICreateStreamInstructions, a0 as ICreateVestingBatchParams, a1 as ICreateVestingParams, a2 as IFees, a3 as IGetAllData, a4 as IGetFeesData, a5 as IGetOneData, a6 as IInteractData, a7 as IInteractStreamExt, a8 as ILockBatchRecipient, a9 as IMultiTransactionResult, aa as IPrepareCreateStreamExt, ab as IPrepareStreamExt, ac as IPrepareTopUpstreamExt, ad as IRecipient, e as ISearchStreams, ae as ITopUpData, af as ITopUpStreamExt, ag as ITransactionExtWithInstructions, ah as ITransactionResult, ai as ITransferData, I as IUpdateData, aj as IVestingBatchRecipient, ak as IWithdrawData, al as InstructionGenerator, am as InstructionResult, an as Invoker, ao as LinearStream, ap as MetadataRecipientHashMap, aq as NativeOptions, ar as OracleType, as as OracleTypeName, R as RoutedFeeDestination, at as SignFn, au as SolanaStreamClient, b as Stream, av as StreamClientOptions, aw as StreamClientOptionsWithConnection, ax as StreamDirection, S as StreamType, ay as TestOracle, az as TopupFn, aA as TransactionSchedulingOptions, aB as TransferFn, aC as UpdateFn, aD as UpdateTestOracleParams, aE as WithdrawFn, aF as buildLockBatchParams, aG as buildLockParams, aH as buildTransaction, aI as buildVestingBatchParams, aJ as buildVestingParams, aK as cancel, aL as computeAmountPerPeriod, aM as create, aN as createBatch, aO as createClientFromEnv, aP as createLock, aQ as createLockBatch, aR as createVesting, aS as createVestingBatch, aT as execute, aU as executeBatch, aV as executeBatchSequential, aW as resolveConnection, aX as resolveDuration, aY as sign, aZ as topup, a_ as transfer, a$ as update, b0 as withdraw } from './index-
|
|
2
|
-
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, ApiClient, ApiClientOptions, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Chain, ContractSchema, ContractType, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, GetContractsOptions, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, PriceOracleType, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, TabulariumContract, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, claimRoutedFeeStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction } from './solana/index.js';
|
|
1
|
+
export { f as Account, g as AlignedContract, h as AlignedProxyErrorCode, A as AlignedStream, i as AlignedStreamData, j as AlignedUnlocksContract, k as BatchCreationItem, l as BatchExecuteResult, m as BatchInstructionResult, B as BatchItem, n as BatchItemError, a as BatchItemResult, o as BatchItemSuccess, p as BuildTransactionFn, q as BuildTransactionOptions, r as BuiltTransaction, C as CancelFn, s as ChangeOracleParams, t as ClientCreationOptions, u as Contract, v as ContractErrorCode, w as CreateBatchFn, x as CreateFn, y as CreateInstructionResult, z as CreateParams, E as CreateTestOracleParams, D as DecodedStream, F as Env, G as ExecuteBatchFn, H as ExecuteBatchSequentialFn, J as ExecuteFn, K as ExecutionEnv, L as IAlignedStreamConfig, M as IBaseStreamConfig, N as ICancelData, O as IClaimRoutedFeeData, d as ICreateAlignedStreamData, P as ICreateExt, Q as ICreateLinearStreamData, T as ICreateLockBatchParams, U as ICreateLockParams, V as ICreateMultiError, W as ICreateMultipleAlignedStreamData, X as ICreateMultipleLinearStreamData, Y as ICreateMultipleStreamData, Z as ICreateResult, c as ICreateStreamData, _ as ICreateStreamExt, $ as ICreateStreamInstructions, a0 as ICreateVestingBatchParams, a1 as ICreateVestingParams, a2 as IFees, a3 as IGetAllData, a4 as IGetFeesData, a5 as IGetOneData, a6 as IInteractData, a7 as IInteractStreamExt, a8 as ILockBatchRecipient, a9 as IMultiTransactionResult, aa as IPrepareCreateStreamExt, ab as IPrepareStreamExt, ac as IPrepareTopUpstreamExt, ad as IRecipient, e as ISearchStreams, ae as ITopUpData, af as ITopUpStreamExt, ag as ITransactionExtWithInstructions, ah as ITransactionResult, ai as ITransferData, I as IUpdateData, aj as IVestingBatchRecipient, ak as IWithdrawData, al as InstructionGenerator, am as InstructionResult, an as Invoker, ao as LinearStream, ap as MetadataRecipientHashMap, aq as NativeOptions, ar as OracleType, as as OracleTypeName, R as RoutedFeeDestination, at as SignFn, au as SolanaStreamClient, b as Stream, av as StreamClientOptions, aw as StreamClientOptionsWithConnection, ax as StreamDirection, S as StreamType, ay as TestOracle, az as TopupFn, aA as TransactionSchedulingOptions, aB as TransferFn, aC as UpdateFn, aD as UpdateTestOracleParams, aE as WithdrawFn, aF as buildLockBatchParams, aG as buildLockParams, aH as buildTransaction, aI as buildVestingBatchParams, aJ as buildVestingParams, aK as cancel, aL as computeAmountPerPeriod, aM as create, aN as createBatch, aO as createClientFromEnv, aP as createLock, aQ as createLockBatch, aR as createVesting, aS as createVestingBatch, aT as execute, aU as executeBatch, aV as executeBatchSequential, aW as resolveConnection, aX as resolveDuration, aY as sign, aZ as topup, a_ as transfer, a$ as update, b0 as withdraw } from './index-CYAitoQO.js';
|
|
2
|
+
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, ApiClient, ApiClientOptions, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Chain, ContractSchema, ContractType, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, DynamicContractSchema, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, GetContractsOptions, MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, PriceOracleType, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, TabulariumContract, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildStreamType, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancelStreamInstruction, claimRoutedFeeStreamInstruction, createClient, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, encodeStreamName, encodeStreamNameAsArray, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, sendAndConfirmStreamRawTransaction, signAllTransactionWithRecipients, timelockIDL, topupStreamInstruction, transferStreamInstruction, transformContract, updateStreamInstruction, withdrawStreamInstruction } from './solana/index.js';
|
|
3
3
|
export { ContractError, ICluster, getBN, getNumberFromBN } from '@streamflow/common';
|
|
4
4
|
import '@solana/wallet-adapter-base';
|
|
5
5
|
import '@solana/web3.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BN3 from 'bn.js';
|
|
2
2
|
import bs58 from 'bs58';
|
|
3
|
-
import { Buffer } from 'buffer';
|
|
3
|
+
import { Buffer as Buffer$1 } from 'buffer';
|
|
4
4
|
import { NATIVE_MINT, ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, getTransferHook, addExtraAccountMetasForExecute } from '@solana/spl-token';
|
|
5
5
|
import { PublicKey, TransactionInstruction, Connection, Keypair, SystemProgram, SYSVAR_RENT_PUBKEY, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
|
|
6
6
|
import { ICluster, getNumberFromBN, isSignerKeypair, isSignerWallet, executeTransaction, ContractError, buildSendThrottler, assertHasPublicKey, prepareWrappedAccount, prepareTransaction, signAndExecuteTransaction, invariant, getMintAndProgram, ata, prepareBaseInstructions, getBN, createVersionedTransaction, executeMultipleTransactions, getMultipleAccountsInfoBatched, getProgramAccounts, isDev, checkOrCreateAtaBatch, pk } from '@streamflow/common';
|
|
@@ -261,16 +261,16 @@ var FEE_ORACLE_PUBLIC_KEY = {
|
|
|
261
261
|
var ALIGNED_COMPUTE_LIMIT = 3e5;
|
|
262
262
|
var CONTRACT_DISCRIMINATOR = [172, 138, 115, 242, 121, 67, 183, 26];
|
|
263
263
|
var TEST_ORACLE_DISCRIMINATOR = [198, 49, 63, 134, 232, 251, 168, 28];
|
|
264
|
-
var CONTRACT_SEED = Buffer.from("contract", "utf-8");
|
|
265
|
-
var ESCROW_SEED = Buffer.from("strm", "utf-8");
|
|
266
|
-
var TEST_ORACLE_SEED = Buffer.from("test-oracle", "utf-8");
|
|
267
|
-
var METADATA_SEED = Buffer.from("strm-met", "utf-8");
|
|
268
|
-
var REPOPULATED_METADATA_SEED = Buffer.from("strm-rep", "utf-8");
|
|
264
|
+
var CONTRACT_SEED = Buffer$1.from("contract", "utf-8");
|
|
265
|
+
var ESCROW_SEED = Buffer$1.from("strm", "utf-8");
|
|
266
|
+
var TEST_ORACLE_SEED = Buffer$1.from("test-oracle", "utf-8");
|
|
267
|
+
var METADATA_SEED = Buffer$1.from("strm-met", "utf-8");
|
|
268
|
+
var REPOPULATED_METADATA_SEED = Buffer$1.from("strm-rep", "utf-8");
|
|
269
269
|
var STREAMFLOW_TREASURY_PUBLIC_KEY = new PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
270
270
|
var WITHDRAWOR = "wdrwhnCv4pzW8beKsbPa4S2UDZrXenjg16KJdKSpb5u";
|
|
271
271
|
var WITHDRAWOR_PUBLIC_KEY = new PublicKey(WITHDRAWOR);
|
|
272
272
|
var AIRDROP_TEST_TOKEN = "Gssm3vfi8s65R31SBdmQRq6cKeYojGgup7whkw4VCiQj";
|
|
273
|
-
var FEES_METADATA_SEED = Buffer.from("strm_fees");
|
|
273
|
+
var FEES_METADATA_SEED = Buffer$1.from("strm_fees");
|
|
274
274
|
var DEFAULT_CREATION_FEE_SOL = 9e7;
|
|
275
275
|
var DEFAULT_AUTO_CLAIM_FEE_SOL = 19e7;
|
|
276
276
|
var DEFAULT_STREAMFLOW_FEE = 0.19;
|
|
@@ -514,7 +514,13 @@ var encodeUpdateStream = (values, data) => {
|
|
|
514
514
|
structs.push(BufferLayout.u8("cancelable_by_sender_exists"));
|
|
515
515
|
structs.push(BufferLayout.u8("cancelable_by_sender"));
|
|
516
516
|
} else {
|
|
517
|
-
structs.push(BufferLayout.u8("
|
|
517
|
+
structs.push(BufferLayout.u8("cancelable_by_sender_exists"));
|
|
518
|
+
}
|
|
519
|
+
if (values.stream_name) {
|
|
520
|
+
structs.push(BufferLayout.u8("stream_name_exists"));
|
|
521
|
+
structs.push(BufferLayout.blob(64, "stream_name"));
|
|
522
|
+
} else {
|
|
523
|
+
structs.push(BufferLayout.u8("stream_name_exists"));
|
|
518
524
|
}
|
|
519
525
|
return BufferLayout.struct(structs).encode(
|
|
520
526
|
{
|
|
@@ -529,7 +535,9 @@ var encodeUpdateStream = (values, data) => {
|
|
|
529
535
|
transferable_by_recipient_exists: values.transferable_by_recipient !== void 0 ? 1 : 0,
|
|
530
536
|
transferable_by_recipient: values.transferable_by_recipient ?? 0,
|
|
531
537
|
cancelable_by_sender_exists: values.cancelable_by_sender !== void 0 ? 1 : 0,
|
|
532
|
-
cancelable_by_sender: values.cancelable_by_sender ?? 0
|
|
538
|
+
cancelable_by_sender: values.cancelable_by_sender ?? 0,
|
|
539
|
+
stream_name_exists: values.stream_name ? 1 : 0,
|
|
540
|
+
stream_name: values.stream_name ?? 0
|
|
533
541
|
},
|
|
534
542
|
data
|
|
535
543
|
);
|
|
@@ -552,6 +560,13 @@ var calculateTotalAmountToDeposit = (depositedAmount, totalFee) => {
|
|
|
552
560
|
const totalFeeNormalized = new BN3(totalFee * FEE_NORMALIZER);
|
|
553
561
|
return depositedAmount.mul(totalFeeNormalized.add(FEE_MULTIPLIER)).div(FEE_MULTIPLIER);
|
|
554
562
|
};
|
|
563
|
+
var encodeStreamName = (name) => {
|
|
564
|
+
const encoded = new TextEncoder().encode(name);
|
|
565
|
+
return Buffer.alloc(64).fill(encoded, 0, encoded.byteLength);
|
|
566
|
+
};
|
|
567
|
+
var encodeStreamNameAsArray = (name) => {
|
|
568
|
+
return Array.from(encodeStreamName(name));
|
|
569
|
+
};
|
|
555
570
|
var decodeStream = (buf) => {
|
|
556
571
|
const raw = streamLayout.decode(buf);
|
|
557
572
|
return {
|
|
@@ -707,16 +722,14 @@ var createStreamInstruction = async (data, programId, accounts) => {
|
|
|
707
722
|
if (accounts.partnerLink) {
|
|
708
723
|
keys.push({ pubkey: accounts.partnerLink.pubkey, isSigner: accounts.partnerLink.isSigner, isWritable: false });
|
|
709
724
|
}
|
|
710
|
-
let bufferData = Buffer.alloc(createStreamLayout.span);
|
|
711
|
-
const encodedUIntArray = new TextEncoder().encode(data.name);
|
|
712
|
-
const streamNameBuffer = Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
725
|
+
let bufferData = Buffer$1.alloc(createStreamLayout.span);
|
|
713
726
|
const decodedData = {
|
|
714
|
-
start_time: data.start.toArrayLike(Buffer, "le", 8),
|
|
715
|
-
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer, "le", 8),
|
|
716
|
-
period: data.period.toArrayLike(Buffer, "le", 8),
|
|
717
|
-
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer, "le", 8),
|
|
718
|
-
cliff: data.cliff.toArrayLike(Buffer, "le", 8),
|
|
719
|
-
cliff_amount: data.cliffAmount.toArrayLike(Buffer, "le", 8),
|
|
727
|
+
start_time: data.start.toArrayLike(Buffer$1, "le", 8),
|
|
728
|
+
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer$1, "le", 8),
|
|
729
|
+
period: data.period.toArrayLike(Buffer$1, "le", 8),
|
|
730
|
+
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer$1, "le", 8),
|
|
731
|
+
cliff: data.cliff.toArrayLike(Buffer$1, "le", 8),
|
|
732
|
+
cliff_amount: data.cliffAmount.toArrayLike(Buffer$1, "le", 8),
|
|
720
733
|
cancelable_by_sender: Number(data.cancelableBySender),
|
|
721
734
|
cancelable_by_recipient: Number(data.cancelableByRecipient),
|
|
722
735
|
automatic_withdrawal: Number(data.automaticWithdrawal),
|
|
@@ -727,15 +740,15 @@ var createStreamInstruction = async (data, programId, accounts) => {
|
|
|
727
740
|
can_update_rate: Number(data.canUpdateRate),
|
|
728
741
|
_can_update_rate_discriminator: 1,
|
|
729
742
|
pausable: Number(data.canPause),
|
|
730
|
-
stream_name:
|
|
731
|
-
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer, "le", 8)
|
|
743
|
+
stream_name: encodeStreamName(data.name),
|
|
744
|
+
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer$1, "le", 8)
|
|
732
745
|
};
|
|
733
746
|
const encodeLength = createStreamLayout.encode(decodedData, bufferData);
|
|
734
747
|
bufferData = bufferData.slice(0, encodeLength);
|
|
735
|
-
bufferData = Buffer.concat([
|
|
736
|
-
Buffer.from(await sha256.digest("global:create")).slice(0, 8),
|
|
748
|
+
bufferData = Buffer$1.concat([
|
|
749
|
+
Buffer$1.from(await sha256.digest("global:create")).slice(0, 8),
|
|
737
750
|
bufferData,
|
|
738
|
-
Buffer.alloc(10)
|
|
751
|
+
Buffer$1.alloc(10)
|
|
739
752
|
]);
|
|
740
753
|
return new TransactionInstruction({
|
|
741
754
|
keys,
|
|
@@ -767,16 +780,16 @@ var createUncheckedStreamInstruction = async (data, programId, accounts) => {
|
|
|
767
780
|
isWritable: true
|
|
768
781
|
});
|
|
769
782
|
}
|
|
770
|
-
let bufferData = Buffer.alloc(createUncheckedStreamLayout.span);
|
|
783
|
+
let bufferData = Buffer$1.alloc(createUncheckedStreamLayout.span);
|
|
771
784
|
const encodedUIntArray = new TextEncoder().encode(data.name);
|
|
772
|
-
const streamNameBuffer = Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
785
|
+
const streamNameBuffer = Buffer$1.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
773
786
|
const decodedData = {
|
|
774
|
-
start_time: data.start.toArrayLike(Buffer, "le", 8),
|
|
775
|
-
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer, "le", 8),
|
|
776
|
-
period: data.period.toArrayLike(Buffer, "le", 8),
|
|
777
|
-
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer, "le", 8),
|
|
778
|
-
cliff: data.cliff.toArrayLike(Buffer, "le", 8),
|
|
779
|
-
cliff_amount: data.cliffAmount.toArrayLike(Buffer, "le", 8),
|
|
787
|
+
start_time: data.start.toArrayLike(Buffer$1, "le", 8),
|
|
788
|
+
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer$1, "le", 8),
|
|
789
|
+
period: data.period.toArrayLike(Buffer$1, "le", 8),
|
|
790
|
+
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer$1, "le", 8),
|
|
791
|
+
cliff: data.cliff.toArrayLike(Buffer$1, "le", 8),
|
|
792
|
+
cliff_amount: data.cliffAmount.toArrayLike(Buffer$1, "le", 8),
|
|
780
793
|
cancelable_by_sender: Number(data.cancelableBySender),
|
|
781
794
|
cancelable_by_recipient: Number(data.cancelableByRecipient),
|
|
782
795
|
automatic_withdrawal: Number(data.automaticWithdrawal),
|
|
@@ -784,7 +797,7 @@ var createUncheckedStreamInstruction = async (data, programId, accounts) => {
|
|
|
784
797
|
transferable_by_recipient: Number(data.transferableByRecipient),
|
|
785
798
|
can_topup: Number(data.canTopup),
|
|
786
799
|
stream_name: streamNameBuffer,
|
|
787
|
-
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer, "le", 8),
|
|
800
|
+
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer$1, "le", 8),
|
|
788
801
|
recipient: data.recipient.toBuffer(),
|
|
789
802
|
partner: data.partner.toBuffer(),
|
|
790
803
|
pausable: Number(data.canPause),
|
|
@@ -793,7 +806,7 @@ var createUncheckedStreamInstruction = async (data, programId, accounts) => {
|
|
|
793
806
|
const encodeLength = createUncheckedStreamLayout.encode(decodedData, bufferData);
|
|
794
807
|
bufferData = bufferData.slice(0, encodeLength);
|
|
795
808
|
const digest = accounts.payer ? await sha256.digest("global:create_unchecked_with_payer") : await sha256.digest("global:create_unchecked");
|
|
796
|
-
bufferData = Buffer.concat([Buffer.from(digest).slice(0, 8), bufferData, Buffer.alloc(10)]);
|
|
809
|
+
bufferData = Buffer$1.concat([Buffer$1.from(digest).slice(0, 8), bufferData, Buffer$1.alloc(10)]);
|
|
797
810
|
return new TransactionInstruction({
|
|
798
811
|
keys,
|
|
799
812
|
programId,
|
|
@@ -836,18 +849,18 @@ var createStreamV2Instruction = async (data, programId, accounts) => {
|
|
|
836
849
|
if (accounts.partnerLink) {
|
|
837
850
|
keys.push({ pubkey: accounts.partnerLink.pubkey, isSigner: accounts.partnerLink.isSigner, isWritable: false });
|
|
838
851
|
}
|
|
839
|
-
let bufferData = Buffer.alloc(createStreamV2Layout.span);
|
|
852
|
+
let bufferData = Buffer$1.alloc(createStreamV2Layout.span);
|
|
840
853
|
const encodedUIntArray = new TextEncoder().encode(data.name);
|
|
841
|
-
const streamNameBuffer = Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
842
|
-
const nonceBuffer = Buffer.alloc(4);
|
|
854
|
+
const streamNameBuffer = Buffer$1.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
855
|
+
const nonceBuffer = Buffer$1.alloc(4);
|
|
843
856
|
nonceBuffer.writeUInt32LE(data.nonce);
|
|
844
857
|
const decodedData = {
|
|
845
|
-
start_time: data.start.toArrayLike(Buffer, "le", 8),
|
|
846
|
-
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer, "le", 8),
|
|
847
|
-
period: data.period.toArrayLike(Buffer, "le", 8),
|
|
848
|
-
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer, "le", 8),
|
|
849
|
-
cliff: data.cliff.toArrayLike(Buffer, "le", 8),
|
|
850
|
-
cliff_amount: data.cliffAmount.toArrayLike(Buffer, "le", 8),
|
|
858
|
+
start_time: data.start.toArrayLike(Buffer$1, "le", 8),
|
|
859
|
+
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer$1, "le", 8),
|
|
860
|
+
period: data.period.toArrayLike(Buffer$1, "le", 8),
|
|
861
|
+
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer$1, "le", 8),
|
|
862
|
+
cliff: data.cliff.toArrayLike(Buffer$1, "le", 8),
|
|
863
|
+
cliff_amount: data.cliffAmount.toArrayLike(Buffer$1, "le", 8),
|
|
851
864
|
cancelable_by_sender: Number(data.cancelableBySender),
|
|
852
865
|
cancelable_by_recipient: Number(data.cancelableByRecipient),
|
|
853
866
|
automatic_withdrawal: Number(data.automaticWithdrawal),
|
|
@@ -855,17 +868,17 @@ var createStreamV2Instruction = async (data, programId, accounts) => {
|
|
|
855
868
|
transferable_by_recipient: Number(data.transferableByRecipient),
|
|
856
869
|
can_topup: Number(data.canTopup),
|
|
857
870
|
stream_name: streamNameBuffer,
|
|
858
|
-
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer, "le", 8),
|
|
871
|
+
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer$1, "le", 8),
|
|
859
872
|
pausable: Number(data.canPause),
|
|
860
873
|
can_update_rate: Number(data.canUpdateRate),
|
|
861
874
|
nonce: nonceBuffer
|
|
862
875
|
};
|
|
863
876
|
const encodeLength = createStreamV2Layout.encode(decodedData, bufferData);
|
|
864
877
|
bufferData = bufferData.slice(0, encodeLength);
|
|
865
|
-
bufferData = Buffer.concat([
|
|
866
|
-
Buffer.from(await sha256.digest("global:create_v2")).slice(0, 8),
|
|
878
|
+
bufferData = Buffer$1.concat([
|
|
879
|
+
Buffer$1.from(await sha256.digest("global:create_v2")).slice(0, 8),
|
|
867
880
|
bufferData,
|
|
868
|
-
Buffer.alloc(10)
|
|
881
|
+
Buffer$1.alloc(10)
|
|
869
882
|
]);
|
|
870
883
|
return new TransactionInstruction({
|
|
871
884
|
keys,
|
|
@@ -897,18 +910,18 @@ var createUncheckedStreamV2Instruction = async (data, programId, accounts) => {
|
|
|
897
910
|
isWritable: true
|
|
898
911
|
});
|
|
899
912
|
}
|
|
900
|
-
let bufferData = Buffer.alloc(createUncheckedStreamV2Layout.span);
|
|
913
|
+
let bufferData = Buffer$1.alloc(createUncheckedStreamV2Layout.span);
|
|
901
914
|
const encodedUIntArray = new TextEncoder().encode(data.name);
|
|
902
|
-
const streamNameBuffer = Buffer.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
903
|
-
const nonceBuffer = Buffer.alloc(4);
|
|
915
|
+
const streamNameBuffer = Buffer$1.alloc(64).fill(encodedUIntArray, 0, encodedUIntArray.byteLength);
|
|
916
|
+
const nonceBuffer = Buffer$1.alloc(4);
|
|
904
917
|
nonceBuffer.writeUInt32LE(data.nonce);
|
|
905
918
|
const decodedData = {
|
|
906
|
-
start_time: data.start.toArrayLike(Buffer, "le", 8),
|
|
907
|
-
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer, "le", 8),
|
|
908
|
-
period: data.period.toArrayLike(Buffer, "le", 8),
|
|
909
|
-
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer, "le", 8),
|
|
910
|
-
cliff: data.cliff.toArrayLike(Buffer, "le", 8),
|
|
911
|
-
cliff_amount: data.cliffAmount.toArrayLike(Buffer, "le", 8),
|
|
919
|
+
start_time: data.start.toArrayLike(Buffer$1, "le", 8),
|
|
920
|
+
net_amount_deposited: data.depositedAmount.toArrayLike(Buffer$1, "le", 8),
|
|
921
|
+
period: data.period.toArrayLike(Buffer$1, "le", 8),
|
|
922
|
+
amount_per_period: data.amountPerPeriod.toArrayLike(Buffer$1, "le", 8),
|
|
923
|
+
cliff: data.cliff.toArrayLike(Buffer$1, "le", 8),
|
|
924
|
+
cliff_amount: data.cliffAmount.toArrayLike(Buffer$1, "le", 8),
|
|
912
925
|
cancelable_by_sender: Number(data.cancelableBySender),
|
|
913
926
|
cancelable_by_recipient: Number(data.cancelableByRecipient),
|
|
914
927
|
automatic_withdrawal: Number(data.automaticWithdrawal),
|
|
@@ -916,7 +929,7 @@ var createUncheckedStreamV2Instruction = async (data, programId, accounts) => {
|
|
|
916
929
|
transferable_by_recipient: Number(data.transferableByRecipient),
|
|
917
930
|
can_topup: Number(data.canTopup),
|
|
918
931
|
stream_name: streamNameBuffer,
|
|
919
|
-
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer, "le", 8),
|
|
932
|
+
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer$1, "le", 8),
|
|
920
933
|
recipient: data.recipient.toBuffer(),
|
|
921
934
|
partner: data.partner.toBuffer(),
|
|
922
935
|
pausable: Number(data.canPause),
|
|
@@ -926,7 +939,7 @@ var createUncheckedStreamV2Instruction = async (data, programId, accounts) => {
|
|
|
926
939
|
const encodeLength = createUncheckedStreamV2Layout.encode(decodedData, bufferData);
|
|
927
940
|
bufferData = bufferData.slice(0, encodeLength);
|
|
928
941
|
const digest = accounts.payer ? await sha256.digest("global:create_unchecked_with_payer_v2") : await sha256.digest("global:create_unchecked_v2");
|
|
929
|
-
bufferData = Buffer.concat([Buffer.from(digest).slice(0, 8), bufferData, Buffer.alloc(10)]);
|
|
942
|
+
bufferData = Buffer$1.concat([Buffer$1.from(digest).slice(0, 8), bufferData, Buffer$1.alloc(10)]);
|
|
930
943
|
return new TransactionInstruction({
|
|
931
944
|
keys,
|
|
932
945
|
programId,
|
|
@@ -963,11 +976,11 @@ var withdrawStreamInstruction = async (amount, programId, {
|
|
|
963
976
|
{ pubkey: mint, isSigner: false, isWritable: true },
|
|
964
977
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false }
|
|
965
978
|
];
|
|
966
|
-
let data = Buffer.alloc(withdrawStreamLayout.span);
|
|
967
|
-
const decodedData = { amount: amount.toArrayLike(Buffer, "le", 8) };
|
|
979
|
+
let data = Buffer$1.alloc(withdrawStreamLayout.span);
|
|
980
|
+
const decodedData = { amount: amount.toArrayLike(Buffer$1, "le", 8) };
|
|
968
981
|
const encodeLength = withdrawStreamLayout.encode(decodedData, data);
|
|
969
982
|
data = data.slice(0, encodeLength);
|
|
970
|
-
data = Buffer.concat([Buffer.from(await sha256.digest("global:withdraw")).slice(0, 8), data, Buffer.alloc(10)]);
|
|
983
|
+
data = Buffer$1.concat([Buffer$1.from(await sha256.digest("global:withdraw")).slice(0, 8), data, Buffer$1.alloc(10)]);
|
|
971
984
|
return new TransactionInstruction({
|
|
972
985
|
keys,
|
|
973
986
|
programId,
|
|
@@ -981,18 +994,19 @@ var updateStreamInstruction = async (params, programId, { authority, metadata, w
|
|
|
981
994
|
{ pubkey: withdrawor, isSigner: false, isWritable: true },
|
|
982
995
|
{ pubkey: systemProgram, isSigner: false, isWritable: false }
|
|
983
996
|
];
|
|
984
|
-
let data = Buffer.alloc(100);
|
|
997
|
+
let data = Buffer$1.alloc(100);
|
|
985
998
|
const decodedData = {
|
|
986
999
|
enable_automatic_withdrawal: Number(params.enableAutomaticWithdrawal),
|
|
987
|
-
withdraw_frequency: params.withdrawFrequency ? params.withdrawFrequency.toArrayLike(Buffer, "le", 8) : void 0,
|
|
988
|
-
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer, "le", 8) : void 0,
|
|
1000
|
+
withdraw_frequency: params.withdrawFrequency ? params.withdrawFrequency.toArrayLike(Buffer$1, "le", 8) : void 0,
|
|
1001
|
+
amount_per_period: params.amountPerPeriod ? params.amountPerPeriod.toArrayLike(Buffer$1, "le", 8) : void 0,
|
|
989
1002
|
transferable_by_sender: params.transferableBySender !== void 0 ? Number(params.transferableBySender) : void 0,
|
|
990
1003
|
transferable_by_recipient: params.transferableByRecipient !== void 0 ? Number(params.transferableByRecipient) : void 0,
|
|
991
|
-
cancelable_by_sender: params.cancelableBySender !== void 0 ? Number(params.cancelableBySender) : void 0
|
|
1004
|
+
cancelable_by_sender: params.cancelableBySender !== void 0 ? Number(params.cancelableBySender) : void 0,
|
|
1005
|
+
stream_name: params.name !== void 0 ? encodeStreamName(params.name) : void 0
|
|
992
1006
|
};
|
|
993
1007
|
const encodeLength = encodeUpdateStream(decodedData, data);
|
|
994
1008
|
data = data.slice(0, encodeLength);
|
|
995
|
-
data = Buffer.concat([Buffer.from(await sha256.digest("global:update")).slice(0, 8), data, Buffer.alloc(20)]);
|
|
1009
|
+
data = Buffer$1.concat([Buffer$1.from(await sha256.digest("global:update")).slice(0, 8), data, Buffer$1.alloc(20)]);
|
|
996
1010
|
return new TransactionInstruction({
|
|
997
1011
|
keys,
|
|
998
1012
|
programId,
|
|
@@ -1033,7 +1047,7 @@ var cancelStreamInstruction = async (programId, {
|
|
|
1033
1047
|
{ pubkey: mint, isSigner: false, isWritable: true },
|
|
1034
1048
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false }
|
|
1035
1049
|
];
|
|
1036
|
-
const data = Buffer.concat([Buffer.from(await sha256.digest("global:cancel")).slice(0, 8), Buffer.alloc(10)]);
|
|
1050
|
+
const data = Buffer$1.concat([Buffer$1.from(await sha256.digest("global:cancel")).slice(0, 8), Buffer$1.alloc(10)]);
|
|
1037
1051
|
return new TransactionInstruction({
|
|
1038
1052
|
keys,
|
|
1039
1053
|
programId,
|
|
@@ -1062,9 +1076,9 @@ var transferStreamInstruction = async (programId, {
|
|
|
1062
1076
|
{ pubkey: associatedTokenProgram, isSigner: false, isWritable: false },
|
|
1063
1077
|
{ pubkey: systemProgram, isSigner: false, isWritable: false }
|
|
1064
1078
|
];
|
|
1065
|
-
const data = Buffer.concat([
|
|
1066
|
-
Buffer.from(await sha256.digest("global:transfer_recipient")).slice(0, 8),
|
|
1067
|
-
Buffer.alloc(10)
|
|
1079
|
+
const data = Buffer$1.concat([
|
|
1080
|
+
Buffer$1.from(await sha256.digest("global:transfer_recipient")).slice(0, 8),
|
|
1081
|
+
Buffer$1.alloc(10)
|
|
1068
1082
|
]);
|
|
1069
1083
|
return new TransactionInstruction({
|
|
1070
1084
|
keys,
|
|
@@ -1092,10 +1106,10 @@ var claimRoutedFeeStreamInstruction = async (destination, programId, {
|
|
|
1092
1106
|
{ pubkey: mint, isSigner: false, isWritable: true },
|
|
1093
1107
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false }
|
|
1094
1108
|
];
|
|
1095
|
-
const data = Buffer.concat([
|
|
1096
|
-
Buffer.from(await sha256.digest("global:claim_routed_fee")).slice(0, 8),
|
|
1097
|
-
Buffer.from([destination === "treasury" ? 0 : 1]),
|
|
1098
|
-
Buffer.alloc(10)
|
|
1109
|
+
const data = Buffer$1.concat([
|
|
1110
|
+
Buffer$1.from(await sha256.digest("global:claim_routed_fee")).slice(0, 8),
|
|
1111
|
+
Buffer$1.from([destination === "treasury" ? 0 : 1]),
|
|
1112
|
+
Buffer$1.alloc(10)
|
|
1099
1113
|
]);
|
|
1100
1114
|
return new TransactionInstruction({
|
|
1101
1115
|
keys,
|
|
@@ -1135,11 +1149,11 @@ var topupStreamInstruction = async (amount, programId, {
|
|
|
1135
1149
|
{ pubkey: tokenProgram, isSigner: false, isWritable: false },
|
|
1136
1150
|
{ pubkey: systemProgram, isSigner: false, isWritable: false }
|
|
1137
1151
|
];
|
|
1138
|
-
let data = Buffer.alloc(topupStreamLayout.span);
|
|
1139
|
-
const decodedData = { amount: amount.toArrayLike(Buffer, "le", 8) };
|
|
1152
|
+
let data = Buffer$1.alloc(topupStreamLayout.span);
|
|
1153
|
+
const decodedData = { amount: amount.toArrayLike(Buffer$1, "le", 8) };
|
|
1140
1154
|
const encodeLength = topupStreamLayout.encode(decodedData, data);
|
|
1141
1155
|
data = data.slice(0, encodeLength);
|
|
1142
|
-
data = Buffer.concat([Buffer.from(await sha256.digest("global:topup")).slice(0, 8), data, Buffer.alloc(10)]);
|
|
1156
|
+
data = Buffer$1.concat([Buffer$1.from(await sha256.digest("global:topup")).slice(0, 8), data, Buffer$1.alloc(10)]);
|
|
1143
1157
|
return new TransactionInstruction({
|
|
1144
1158
|
keys,
|
|
1145
1159
|
programId,
|
|
@@ -3115,6 +3129,17 @@ var streamflow_aligned_unlocks_default = {
|
|
|
3115
3129
|
type: {
|
|
3116
3130
|
option: "bool"
|
|
3117
3131
|
}
|
|
3132
|
+
},
|
|
3133
|
+
{
|
|
3134
|
+
name: "stream_name",
|
|
3135
|
+
type: {
|
|
3136
|
+
option: {
|
|
3137
|
+
array: [
|
|
3138
|
+
"u8",
|
|
3139
|
+
64
|
|
3140
|
+
]
|
|
3141
|
+
}
|
|
3142
|
+
}
|
|
3118
3143
|
}
|
|
3119
3144
|
]
|
|
3120
3145
|
}
|
|
@@ -3156,7 +3181,7 @@ var deriveTestOraclePDA = (programId, mint, creator) => {
|
|
|
3156
3181
|
};
|
|
3157
3182
|
var deriveStreamMetadataPDA = (programId, mint, sender, nonce) => {
|
|
3158
3183
|
return PublicKey.findProgramAddressSync(
|
|
3159
|
-
[METADATA_SEED, mint.toBuffer(), sender.toBuffer(), new BN3(nonce).toArrayLike(Buffer, "be", 4)],
|
|
3184
|
+
[METADATA_SEED, mint.toBuffer(), sender.toBuffer(), new BN3(nonce).toArrayLike(Buffer$1, "be", 4)],
|
|
3160
3185
|
programId
|
|
3161
3186
|
)[0];
|
|
3162
3187
|
};
|
|
@@ -3555,8 +3580,6 @@ var SolanaStreamClient = class {
|
|
|
3555
3580
|
...await this.getCreateATAInstructions([recipientPublicKey], mintPublicKey, sender, true, tokenProgramId)
|
|
3556
3581
|
);
|
|
3557
3582
|
}
|
|
3558
|
-
const encodedUIntArray = new TextEncoder().encode(streamName);
|
|
3559
|
-
const streamNameArray = Array.from(encodedUIntArray);
|
|
3560
3583
|
const createMethod = this.alignedProxyProgram.methods.create({
|
|
3561
3584
|
startTime: new BN3(start),
|
|
3562
3585
|
netAmountDeposited: depositedAmount,
|
|
@@ -3570,7 +3593,7 @@ var SolanaStreamClient = class {
|
|
|
3570
3593
|
cancelableBySender,
|
|
3571
3594
|
canTopup,
|
|
3572
3595
|
oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
|
|
3573
|
-
streamName:
|
|
3596
|
+
streamName: encodeStreamNameAsArray(streamName),
|
|
3574
3597
|
minPrice: typeof minPrice === "number" ? getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW2) : minPrice,
|
|
3575
3598
|
maxPrice: typeof maxPrice === "number" ? getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW2) : maxPrice,
|
|
3576
3599
|
minPercentage: typeof minPercentage === "number" ? getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW2) : minPercentage,
|
|
@@ -3654,7 +3677,7 @@ var SolanaStreamClient = class {
|
|
|
3654
3677
|
({ metadata, metadataPubKey } = this.getOrCreateStreamMetadata(metadataPubKeys));
|
|
3655
3678
|
}
|
|
3656
3679
|
const [escrowTokens] = PublicKey.findProgramAddressSync(
|
|
3657
|
-
[Buffer.from("strm"), metadataPubKey.toBuffer()],
|
|
3680
|
+
[Buffer$1.from("strm"), metadataPubKey.toBuffer()],
|
|
3658
3681
|
this.programId
|
|
3659
3682
|
);
|
|
3660
3683
|
const { mint: mintAccount, tokenProgramId: detectedTokenProgramId } = await getMintAndProgram(
|
|
@@ -3788,7 +3811,7 @@ var SolanaStreamClient = class {
|
|
|
3788
3811
|
({ metadata, metadataPubKey } = this.getOrCreateStreamMetadata(metadataPubKeys));
|
|
3789
3812
|
}
|
|
3790
3813
|
const [escrowTokens] = PublicKey.findProgramAddressSync(
|
|
3791
|
-
[Buffer.from("strm"), metadataPubKey.toBuffer()],
|
|
3814
|
+
[Buffer$1.from("strm"), metadataPubKey.toBuffer()],
|
|
3792
3815
|
this.programId
|
|
3793
3816
|
);
|
|
3794
3817
|
const { mint: mintAccount, tokenProgramId } = await getMintAndProgram(this.connection, mintPublicKey);
|
|
@@ -4792,7 +4815,8 @@ var SolanaStreamClient = class {
|
|
|
4792
4815
|
await (isAlignedUnlock ? this.alignedProxyProgram.methods.updateContract({
|
|
4793
4816
|
transferableBySender: data.transferableBySender ?? null,
|
|
4794
4817
|
transferableByRecipient: data.transferableByRecipient ?? null,
|
|
4795
|
-
cancelableBySender: data.cancelableBySender ?? null
|
|
4818
|
+
cancelableBySender: data.cancelableBySender ?? null,
|
|
4819
|
+
streamName: data.name !== void 0 ? encodeStreamNameAsArray(data.name) : null
|
|
4796
4820
|
}).accounts({ sender: invoker.publicKey, streamMetadata: streamPublicKey, withdrawor: WITHDRAWOR_PUBLIC_KEY }).accountsPartial({ streamflowProgram: this.programId }).instruction() : updateStreamInstruction(data, this.programId, {
|
|
4797
4821
|
authority: invoker.publicKey,
|
|
4798
4822
|
metadata: streamPublicKey,
|
|
@@ -5848,6 +5872,6 @@ async function executeBatchSequential(builtTransactions, env) {
|
|
|
5848
5872
|
return { signatures, errors };
|
|
5849
5873
|
}
|
|
5850
5874
|
|
|
5851
|
-
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildLockBatchParams, buildLockParams, buildStreamType, buildTransaction, buildVestingBatchParams, buildVestingParams, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancel, cancelStreamInstruction, claimRoutedFeeStreamInstruction, computeAmountPerPeriod, create, createBatch, createClient, createClientFromEnv, createLock, createLockBatch, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, createVesting, createVestingBatch, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, execute, executeBatch, executeBatchSequential, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, resolveConnection, resolveDuration, sendAndConfirmStreamRawTransaction, sign, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topup, topupStreamInstruction, transfer, transferStreamInstruction, transformContract, update, updateStreamInstruction, withdraw, withdrawStreamInstruction };
|
|
5875
|
+
export { AIRDROP_AMOUNT, AIRDROP_TEST_TOKEN, ALIGNED_COMPUTE_LIMIT, ALIGNED_PRECISION_FACTOR_POW2 as ALIGNED_PRECISION_FACTOR_POW, ALIGNED_UNLOCKS_PROGRAM_ID, AlignedContract, AlignedProxyErrorCode, CONTRACT_DISCRIMINATOR, CONTRACT_SEED, CREATE_PARAMS_PADDING, Contract, ContractErrorCode, DEFAULT_AUTO_CLAIM_FEE_SOL, DEFAULT_CREATION_FEE_SOL, DEFAULT_STREAMFLOW_FEE, ESCROW_SEED, FEES_METADATA_SEED, FEE_ORACLE_PUBLIC_KEY, MAX_SAFE_UNIX_TIME_VALUE2 as MAX_SAFE_UNIX_TIME_VALUE, METADATA_SEED, ORIGINAL_CONTRACT_SENDER_OFFSET, PARTNERS_SCHEMA, PARTNER_ORACLE_PROGRAM_ID, PARTNER_SCHEMA, PROGRAM_ID, REPOPULATED_METADATA_SEED, SOLANA_ERROR_MAP, SOLANA_ERROR_MATCH_REGEX, STREAMFLOW_TREASURY_PUBLIC_KEY, STREAM_STRUCT_OFFSETS, STREAM_STRUCT_OFFSET_CLOSED, STREAM_STRUCT_OFFSET_MINT, STREAM_STRUCT_OFFSET_OLD_METADATA_KEY, STREAM_STRUCT_OFFSET_RECIPIENT, STREAM_STRUCT_OFFSET_SENDER, SolanaStreamClient, StreamDirection, StreamType, TEST_ORACLE_DISCRIMINATOR, TEST_ORACLE_SEED, TX_FINALITY_CONFIRMED, WITHDRAWOR, WITHDRAWOR_PUBLIC_KEY, WITHDRAW_AVAILABLE_AMOUNT, buildLockBatchParams, buildLockParams, buildStreamType, buildTransaction, buildVestingBatchParams, buildVestingParams, calculateTotalAmountToDeposit, calculateUnlockedAmount, cancel, cancelStreamInstruction, claimRoutedFeeStreamInstruction, computeAmountPerPeriod, create, createBatch, createClient, createClientFromEnv, createLock, createLockBatch, createStreamInstruction, createStreamV2Instruction, createUncheckedStreamInstruction, createUncheckedStreamV2Instruction, createVesting, createVestingBatch, decodeEndTime, decodeStream, deriveContractPDA, deriveEscrowPDA, deriveRepopulatedMetadataPDA, deriveStreamMetadataPDA, deriveTestOraclePDA, encodeStreamName, encodeStreamNameAsArray, execute, executeBatch, executeBatchSequential, extractSolanaErrorCode, getMetadataKey, handleContractError, isAligned, isCliffCloseToDepositedAmount, isCreateAlignedStreamData, isDynamicLock, isTokenLock, isVesting, resolveConnection, resolveDuration, sendAndConfirmStreamRawTransaction, sign, signAllTransactionWithRecipients, timelockIDL_default as timelockIDL, topup, topupStreamInstruction, transfer, transferStreamInstruction, transformContract, update, updateStreamInstruction, withdraw, withdrawStreamInstruction };
|
|
5852
5876
|
//# sourceMappingURL=index.js.map
|
|
5853
5877
|
//# sourceMappingURL=index.js.map
|